Feat: update react-native-fast-url to support new architecture #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on the TurboModule migration work we've been doing in this branch, here's a comprehensive PR description that follows open source contribution best practices:
🚀 Add TurboModule Support with Backward Compatibility
What does this PR do?
This PR migrates the
react-native-fast-urllibrary to support React Native's New Architecture (TurboModules) while maintaining full backward compatibility with the legacy architecture. Users can now use this library seamlessly in both old and new React Native projects without any breaking changes.Why is this change needed?
What changed?
JavaScript/TypeScript Changes
src/NativeFastUrl.tssrc/index.tsxto conditionally use TurboModule when availablecodegenConfigtopackage.jsonfor automatic code generationiOS Changes
react-native-fast-url.podspecto support CodeGen and C++17ios/FastUrl.mmto implement both legacy and TurboModule interfacesAndroid Changes
android/build.gradlewith conditional React plugin applicationoldarchandnewarchimplementationsFastUrlModuleImplfor code reuseFastUrlPackageto be aTurboReactPackagewith backward compatibilityHow to test
Legacy Architecture Testing:
New Architecture Testing:
Backward Compatibility
Technical Details
The implementation follows the official React Native New Architecture guide and uses:
Checklist
Additional Notes
This migration positions the library for long-term success with React Native's evolution while ensuring current users experience no disruption. The implementation carefully balances modern architecture support with practical backward compatibility needs.
This PR implements TurboModule support following React Native's official migration guidelines and best practices for library maintainers.