-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: add basic React Server Component support #2287
Merged
jakex7
merged 1 commit into
software-mansion:main
from
EvanBacon:@evanbacon/add-rsc-support
Oct 18, 2024
Merged
feat: add basic React Server Component support #2287
jakex7
merged 1 commit into
software-mansion:main
from
EvanBacon:@evanbacon/add-rsc-support
Oct 18, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EvanBacon
changed the title
add basic rsc support
feat: add basic React Server Component support
Jun 4, 2024
8 tasks
kkafar
pushed a commit
to software-mansion/react-native-screens
that referenced
this pull request
Sep 25, 2024
## Description Add basic support for React Server Components support. Related PRs for more context: - necolas/react-native-web#2678 - th3rdwave/react-native-safe-area-context#502 - software-mansion/react-native-svg#2287 ## Changes - Added basic React Server Component support ## Test code and steps to reproduce - It's kinda hard to test this E2E. I wrote a small jest runner in jest-expo which executes in RSC mode, but it requires React 19 to work. Here's where I tested this patch expo/expo#29404 - It will likely break between now and the full release, but this should at least reduce the number of patches required to work on Expo Router support. - There's pretty good compilation on web: ``` 2:I["../../node_modules/react-native-web/dist/exports/View/index.js",[],""] 3:I["../../node_modules/react-native-web/dist/exports/Image/index.js",[],""] 1:{"name":"ScreenStackHeaderBackButtonImage","env":"Server","owner":null} 0:D"$1" 0:["$","$L2",null,{"children":["$","$L3",null,{"resizeMode":"center","fadeDuration":0},"$1"]},"$1"] ``` - And more opaque compilation on native platforms: ``` 1:I["../../node_modules/react-native-screens/src/components/ScreenStackHeaderConfig.tsx",[],"ScreenStackHeaderBackButtonImage"] 0:["$","$L1",null,{},null] ``` ## Checklist - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Updated documentation: <!-- For adding new props to native-stack --> - [ ] https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx - [ ] Ensured that CI passes
ja1ns
pushed a commit
to WiseOwlTech/react-native-screens
that referenced
this pull request
Oct 9, 2024
## Description Add basic support for React Server Components support. Related PRs for more context: - necolas/react-native-web#2678 - th3rdwave/react-native-safe-area-context#502 - software-mansion/react-native-svg#2287 ## Changes - Added basic React Server Component support ## Test code and steps to reproduce - It's kinda hard to test this E2E. I wrote a small jest runner in jest-expo which executes in RSC mode, but it requires React 19 to work. Here's where I tested this patch expo/expo#29404 - It will likely break between now and the full release, but this should at least reduce the number of patches required to work on Expo Router support. - There's pretty good compilation on web: ``` 2:I["../../node_modules/react-native-web/dist/exports/View/index.js",[],""] 3:I["../../node_modules/react-native-web/dist/exports/Image/index.js",[],""] 1:{"name":"ScreenStackHeaderBackButtonImage","env":"Server","owner":null} 0:D"$1" 0:["$","$L2",null,{"children":["$","$L3",null,{"resizeMode":"center","fadeDuration":0},"$1"]},"$1"] ``` - And more opaque compilation on native platforms: ``` 1:I["../../node_modules/react-native-screens/src/components/ScreenStackHeaderConfig.tsx",[],"ScreenStackHeaderBackButtonImage"] 0:["$","$L1",null,{},null] ``` ## Checklist - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Updated documentation: <!-- For adding new props to native-stack --> - [ ] https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx - [ ] Ensured that CI passes
jakex7
approved these changes
Oct 18, 2024
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.
Thanks for the PR!
kkafar
pushed a commit
to software-mansion/react-native-screens
that referenced
this pull request
Oct 25, 2024
## Description Add basic support for React Server Components support. Related PRs for more context: - necolas/react-native-web#2678 - th3rdwave/react-native-safe-area-context#502 - software-mansion/react-native-svg#2287 ## Changes - Added basic React Server Component support ## Test code and steps to reproduce - It's kinda hard to test this E2E. I wrote a small jest runner in jest-expo which executes in RSC mode, but it requires React 19 to work. Here's where I tested this patch expo/expo#29404 - It will likely break between now and the full release, but this should at least reduce the number of patches required to work on Expo Router support. - There's pretty good compilation on web: ``` 2:I["../../node_modules/react-native-web/dist/exports/View/index.js",[],""] 3:I["../../node_modules/react-native-web/dist/exports/Image/index.js",[],""] 1:{"name":"ScreenStackHeaderBackButtonImage","env":"Server","owner":null} 0:D"$1" 0:["$","$L2",null,{"children":["$","$L3",null,{"resizeMode":"center","fadeDuration":0},"$1"]},"$1"] ``` - And more opaque compilation on native platforms: ``` 1:I["../../node_modules/react-native-screens/src/components/ScreenStackHeaderConfig.tsx",[],"ScreenStackHeaderBackButtonImage"] 0:["$","$L1",null,{},null] ``` ## Checklist - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Updated documentation: <!-- For adding new props to native-stack --> - [ ] https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx - [ ] Ensured that CI passes (cherry picked from commit 75c15c1)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Add basic support for React Server Components support. This package could surely be improved (at least on web) but there are a lot of class components (unsupported in RSC) which need to be rewritten to function components in order to compile down further. For now, I'm opting the entire package.
Related PRs for more context:
export * from
touse client
plugin. expo/expo#29426Test Plan