-
Notifications
You must be signed in to change notification settings - Fork 24.7k
refactor: use ESM exports in ReactNativeViewConfigRegistry #40787
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
refactor: use ESM exports in ReactNativeViewConfigRegistry #40787
Conversation
Hi @jbroma! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
The source of truth for ReactNativeViewConfigRegistry is actually in React, and gets synced automatically to React Native - https://github.com/facebook/react/blob/main/scripts/rollup/shims/react-native/ReactNativeViewConfigRegistry.js |
@javache ok, I will make open additional PR in React then. |
@javache considering how these files are linked through the sync script, is there going to be an option to sync just this change? I've noticed there is a ton of changes related to server components that would get synced and that's definitely not desirable. How do you see this PR going forward? Thanks! |
Just this change will be synced. We only update the renderer as part of a React npm release. |
I've added a PR in 'react': facebook/react#27508 I've also removed changes to ReactNativeViewConfigRegistry as it will be synced. |
## Summary When transpiling `react-native` with `swc` this file caused some trouble as it mixes ESM and CJS import/export syntax. This PR addresses this by converting CJS exports to ESM exports. As `ReactNativeViewConfigRegistry` is synced from `react` to `react-native` repository, it's required to make the change here. I've also aligned the mock of `ReactNativeViewConfigRegistry` to reflect current implementation. Related PR in `react-native`: facebook/react-native#40787
Merged the React PR, it should land here in the next few days, please rebase on top of that. |
@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @jbroma in 0e590c0. When will my fix make it into a release? | Upcoming Releases |
…27508) ## Summary When transpiling `react-native` with `swc` this file caused some trouble as it mixes ESM and CJS import/export syntax. This PR addresses this by converting CJS exports to ESM exports. As `ReactNativeViewConfigRegistry` is synced from `react` to `react-native` repository, it's required to make the change here. I've also aligned the mock of `ReactNativeViewConfigRegistry` to reflect current implementation. Related PR in `react-native`: facebook/react-native#40787
## Summary When transpiling `react-native` with `swc` this file caused some trouble as it mixes ESM and CJS import/export syntax. This PR addresses this by converting CJS exports to ESM exports. As `ReactNativeViewConfigRegistry` is synced from `react` to `react-native` repository, it's required to make the change here. I've also aligned the mock of `ReactNativeViewConfigRegistry` to reflect current implementation. Related PR in `react-native`: facebook/react-native#40787 DiffTrain build for commit facebook/react@ea8a861.
Summary:
When transpiling
react-native
withswc
this file caused some trouble as it mixes ESM and CJS import/export syntax. This PR addresses this by converting CJS exports to ESM exports. All other affected files were aligned to support this change.Changelog:
[INTERNAL] [CHANGED] - use ESM exports in ReactNativeViewConfigRegistry
Test Plan: