-
Notifications
You must be signed in to change notification settings - Fork 46.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove SchedulerHostConfigs #20025
Remove SchedulerHostConfigs #20025
Changes from 1 commit
92691a6
c91346b
34c4769
58a89a6
1df1e95
c0d603d
1527bb9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/scheduler-unstable_no_dom.production.min.js'); | ||
} else { | ||
module.exports = require('./cjs/scheduler-unstable_no_dom.development.js'); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
"tracing.js", | ||
"tracing-profiling.js", | ||
"unstable_mock.js", | ||
"unstable_no_dom.js", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I considered calling the NoDOM version Native since the primary user will be React Native, what do you think about the naming @acdlite? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To me the primary purpose is to act as a last resort if you accidentally call this in a Node.js environment, like if you run a test without wrapping in React Native will eventually need its own scheduler, so I'd rather not call this one a React Native scheduler since it's not optimized for that at all. |
||
"unstable_post_task.js", | ||
"cjs/", | ||
"umd/" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could I just drop this check and only export the DOM version if I update the callers during the sync?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The inline require breaks the build but I'll wait to hear back on this before fixing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For www you can lift the checks into the outer module wrapper, but for OSS this seems like the right place to put them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I guess the right place is here? https://github.com/facebook/react/blob/master/packages/scheduler/npm/index.js
I don't know what the best practice is in the npm ecosystem. Ideally we would handle this at the bundler level, using something like the
browser
field.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thanks!