-
Notifications
You must be signed in to change notification settings - Fork 47k
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
use-sync-external-store: Add exports
field to package.json
#25231
base: main
Are you sure you want to change the base?
Conversation
Comparing: 1e3e30d...360fe3d Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
8cd5c8c
to
3cf0eb2
Compare
exports
field to package.jsonexports
field to package.json
3cf0eb2
to
62a5371
Compare
"react-native": "./shim/index.native.js", | ||
"default": "./shim/index.js" | ||
}, | ||
"./shim/index.native": "./shim/index.native.js", |
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 compat with bundlers that don't support the react-native
condition. Though I don't know if we need it. I just copied it from #24440
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.
https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/__tests__/useSyncExternalStoreNative-test.js#L45
It seems that this entry has been used in several places. I'm not sure if this is necessary.
@@ -9,7 +9,7 @@ | |||
|
|||
import * as React from 'react'; | |||
import is from 'shared/objectIs'; | |||
import {useSyncExternalStore} from 'use-sync-external-store/src/useSyncExternalStore'; | |||
import {useSyncExternalStore} from './useSyncExternalStore'; |
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.
Perhaps a similar change should be done in other places to at least match the style?
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.
What other places?
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.
Like here:
export {useSyncExternalStoreWithSelector} from 'use-sync-external-store/src/useSyncExternalStoreWithSelector'; |
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.
These are entrypoints so I'm not sure they should change. This PR is green and tested and I personally don't want make stylistic changes that invalidates all of that unless it's required to get this merged.
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.
This should fail IMHO since there are no "./src/*" exports in package.json.
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.
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.
Since the src exports will get removed at the publish stage, it might be a good idea to add it back for local development.
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.
This should fail IMHO since there are no "./src/*" exports in package.json.
react/packages/use-sync-external-store/with-selector.js
is fed to rollup and will not be shipped with the src/
path. I would suggest checking out the repository that was used for testing to see how files look after bundling.
62a5371
to
360fe3d
Compare
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated. |
bump |
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated. |
Bump |
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated. |
VERY NOT STALE |
Summary
Alternate to #24440. I needed a CI build to test the published package
How did you test this change?