You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use align-deps to help migrate apps to the New Architecture #1863
For app maintainers to migrate to the New Architecture, all of their native dependencies must support the New Architecture as well. This isn't the same as being merely compatible with some React Native version 0.x, since (for the time being) the New Architecture is opt-in.
A problem that has come up is that it's not easy to know ahead of time, as an app maintainer, whether all of your dependencies have new versions available that are compatible with the New Architecture. In the worst case, you might sink time and effort into beginning an upgrade, only to get blocked halfway by some third-party library and have to abandon the effort for an unknown length of time.
The idea here would be to add information to align-deps's database about various common libraries' New Architecture readiness, such that (ideally) we can recommend align-deps as part of the official New Architecture migration guide for app maintainers. In doing this, we want to (1) increase the likelihood of apps migrating successfully on the first try, (2) create visibility in the ecosystem (and thus momentum and excitement) around popular libraries migrating to the New Architecture.
There are some questions around how we source this information reliably at scale (e.g. combine efforts with https://reactnative.directory/ ?), but in the short term leveraging align-deps's standalone database of packages seems like a good way to jumpstart this capability for relatively low effort.
NOTE: I'm only lightly familiar with align-deps and the New Architecture, so I've kept this super high-level and am not opinionated on the details.
I think this would be an amazing addition to the New Architecture migration story.
It has been asked previously by the community (see react/react-native-website#3275).
As for the technical side: we don't have a simple way to know if a library is New Architecture compatible. In general, relying on codegenConfig inside package.json is a good indicator. However there might be other libraries which are New Architecture compatible and not using the Codegen. We should think about an indicator that allows us to easily understand this (like another field in the package.json or so).
Is codegenConfig always present in a fully migrated package? I extended the script we use to check for updated packages to include it:
As mentioned above, not always. There might be packages without codegenConfig which support the New Architecture. That being said, I think it's anyway a good indicator.
It'd be great to decide a standard way to communicate new arch support, and then "enforce it" by having both dep-check and directory leverage it as the official way. At that point we can communicate in all the 3 places (dep-check, RN docs website, RNDirectory) that doing "XXX" is the one way.
I've been wondering if it makes more sense for each package to add a field that signals their new-arch readiness. It would allow cli to warn when autolinking, dep-check/directory to generate the compat table, and docs to be automatically updated.
Edit: The field does not need to be binary, it could signal compatibility, e.g. "ready" -> works fine as-is, "full" -> codegen and extra steps to ensure better experience.
I've been wondering if it makes more sense for each package to add a field that signals their new-arch readiness.
Yup that's a good thing to add. Do you have any suggestion (I assume it's going to be stored inside the package.json or the react-native.config.js in some form).
Yup that's a good thing to add. Do you have any suggestion (I assume it's going to be stored inside the package.json or the react-native.config.js in some form).
I think package.json would make the most sense since you can query it using npm instead of downloading the full package just to inspect a single file.
Reacted by Nicola Corti, Lorenzo Sciandra and Alex Hunt
Hey folks; just wanted to follow up here now that thanks to Alex Hunt (@huntie) and the rest of the Metro team it seems that the exports support is going ahead and the definition of "react-native" has been accepted in node itself (nodejs/node#45367).
If I'm understanding correctly, it means that "react-native" is now officially used for that - and now we need to create a different name for section in the package.json along the lines of:
Right?
And not only that, we need to decide what to name the field for identifying react-native's new arch support, right?
On top of this, I wanted to also check in into an idea that the developers from InfiniteRed brought to us for indicating via align-deps which libs support the new arch or not.
Basically, they were proposing something a bit more in-depth than just a binary yes/no, but something more like a semaphore:
🔴 = no support for new arch at all
🟡 = we can infer that it will probably work with the new arch based on . For example, we could use the same one that RNDirectory uses, based on the presence of the codegenConfig field in package.json
🟢 = library has our custom-setting field set to true
What do you think? I think this might help and also we could potentially "mirror" this into the RNDirectory website too.
changed the title [-][Feature request] Use dep-check to help migrate apps to the New Architecture[/-][+][Feature request] Use align-deps to help migrate apps to the New Architecture[/+]on Dec 1, 2022
it means that "react-native" is now officially used for that
Clarifying: The "react-native" root field was originally defined and used by us (Metro, Webpack, others) as an alternative for the "browser" field spec/"main" field, and is already in wide use (with package exports this concept is being replaced with an exports condition of the same name — however we will not be pushing packages to migrate and remove this root field).
The impact is the same, however (and the Metro exports spec no longer depends on this decision)! We need a different root field name to "react-native" to avoid conflict, such as "react-native-config" (as previously suggested, likely good to go) or "reactNative" (potentially too indistinct).
Totally, thanks for the clarification Alex Hunt (@huntie) - we did a meeting earlier this week with Moti Zilberman (@motiz88) and Blake and other Meta folks, I'm guessing the next step is to understand how we want to go ahead with this. My current latest understanding is that internally during planning you will decide how you want to go ahead with this in H123 and then we can create some actionables.
changed the title [-][Feature request] Use align-deps to help migrate apps to the New Architecture[/-][+]Use align-deps to help migrate apps to the New Architecture[/+]on Jan 3, 2023
Reviving this thread one more time, since now we should all be approaching clarity over how the next few months would look like.
I feel that the next step would be to get a few folks in a room and make sure that we can reach an agreement on the final "spec" for this new react-native-config section of the package.json. I'm a bit foggy but I am pretty sure that Expo and the RN CLI already have some variations of local configurations (IIRC, using app.json and react-native.config.js) so I reckon that whatever shape we end up agreeing on, we should realign all these "side configurations" into a main, unified and spec'd one.
I'd like to get a few folks in a room to discuss details and after that, setup a "final" RFC for how to approach so that we can coordinate the needed work. As attendees, I'm thinking some representatives from CLI, Expo, Metro and rnx-kit, keeping the number of people below 10.
Reacted by Alex Hunt, Riccardo Cipolleschi, Adam Trzciński, Michał Pierzchała, Joshua Yoes and Nicola Corti
An update on this: since the last time we talked about this, there have been a couple of relevant updates:
libraries have started supporting new arch & bridgeless. So, indirectly, just by keeping up and having profiles for 0.73 and 0.74 for align-deps, we do have somewhat a level of support for developers using align-deps in making sure that they are using versions of libs that do have newarch/bridgeless support.
Alek Mikucki (@aleqsio) made a small handy tool that checks a repository package.json against the (manually maintained) gSheet linked in the discussion above. While not ideal nor programmatic (since it's source of truth is a man-mantained gSheet), me and Tommy think it does a pretty great job.
So devs at this point in time have a pretty decent level of support in migrating their apps to the new arch.
Because of this, we think we can close this off. Let us know if you have other thoughts on the matter.
Activity
tido64 commentedon Sep 2, 2022
We can probably use the list in reactwg/react-native-new-architecture#6 as a starting point.
tido64 commentedon Sep 8, 2022
I have a draft PR with only these packages. The rest are
null-ed out.cortinico commentedon Sep 8, 2022
I think this would be an amazing addition to the New Architecture migration story.
It has been asked previously by the community (see react/react-native-website#3275).
As for the technical side: we don't have a simple way to know if a library is New Architecture compatible. In general, relying on
codegenConfiginsidepackage.jsonis a good indicator. However there might be other libraries which are New Architecture compatible and not using the Codegen. We should think about an indicator that allows us to easily understand this (like another field in the package.json or so).tido64 commentedon Sep 8, 2022
Is
codegenConfigalways present in a fully migrated package? I extended the script we use to check for updated packages to include it:Reanimated isn't listed here because New Arch support is still in RC.
cortinico commentedon Sep 9, 2022
As mentioned above, not always. There might be packages without
codegenConfigwhich support the New Architecture. That being said, I think it's anyway a good indicator.kelset commentedon Sep 12, 2022
This conversation I think is very close to what the RNDirectory is trying to achieve through this: react-native-community/directory#870
cc Bartosz Kaszubowski (@Simek)
It'd be great to decide a standard way to communicate new arch support, and then "enforce it" by having both dep-check and directory leverage it as the official way. At that point we can communicate in all the 3 places (dep-check, RN docs website, RNDirectory) that doing "XXX" is the one way.
tido64 commentedon Sep 12, 2022
I've been wondering if it makes more sense for each package to add a field that signals their new-arch readiness. It would allow cli to warn when autolinking, dep-check/directory to generate the compat table, and docs to be automatically updated.
Edit: The field does not need to be binary, it could signal compatibility, e.g. "ready" -> works fine as-is, "full" -> codegen and extra steps to ensure better experience.
cortinico commentedon Sep 12, 2022
Yup that's a good thing to add. Do you have any suggestion (I assume it's going to be stored inside the
package.jsonor thereact-native.config.jsin some form).tido64 commentedon Sep 12, 2022
I think
package.jsonwould make the most sense since you can query it using npm instead of downloading the full package just to inspect a single file.10 remaining items
kelset commentedon Dec 1, 2022
Hey folks; just wanted to follow up here now that thanks to Alex Hunt (@huntie) and the rest of the Metro team it seems that the exports support is going ahead and the definition of
"react-native"has been accepted in node itself (nodejs/node#45367).If I'm understanding correctly, it means that
"react-native"is now officially used for that - and now we need to create a different name for section in thepackage.jsonalong the lines of:Right?
And not only that, we need to decide what to name the field for identifying react-native's new arch support, right?
On top of this, I wanted to also check in into an idea that the developers from InfiniteRed brought to us for indicating via
align-depswhich libs support the new arch or not.Basically, they were proposing something a bit more in-depth than just a binary yes/no, but something more like a semaphore:
What do you think? I think this might help and also we could potentially "mirror" this into the RNDirectory website too.
[-][Feature request] Use dep-check to help migrate apps to the New Architecture[/-][+][Feature request] Use align-deps to help migrate apps to the New Architecture[/+]huntie commentedon Dec 1, 2022
Clarifying: The
"react-native"root field was originally defined and used by us (Metro, Webpack, others) as an alternative for the"browser"field spec/"main"field, and is already in wide use (with package exports this concept is being replaced with an exports condition of the same name — however we will not be pushing packages to migrate and remove this root field).The impact is the same, however (and the Metro exports spec no longer depends on this decision)! We need a different root field name to
"react-native"to avoid conflict, such as"react-native-config"(as previously suggested, likely good to go) or"reactNative"(potentially too indistinct).kelset commentedon Dec 8, 2022
Totally, thanks for the clarification Alex Hunt (@huntie) - we did a meeting earlier this week with Moti Zilberman (@motiz88) and Blake and other Meta folks, I'm guessing the next step is to understand how we want to go ahead with this. My current latest understanding is that internally during planning you will decide how you want to go ahead with this in H123 and then we can create some actionables.
[-][Feature request] Use align-deps to help migrate apps to the New Architecture[/-][+]Use align-deps to help migrate apps to the New Architecture[/+]kelset commentedon Jan 4, 2023
Reviving this thread one more time, since now we should all be approaching clarity over how the next few months would look like.
I feel that the next step would be to get a few folks in a room and make sure that we can reach an agreement on the final "spec" for this new
react-native-configsection of thepackage.json. I'm a bit foggy but I am pretty sure that Expo and the RN CLI already have some variations of local configurations (IIRC, usingapp.jsonandreact-native.config.js) so I reckon that whatever shape we end up agreeing on, we should realign all these "side configurations" into a main, unified and spec'd one.I'd like to get a few folks in a room to discuss details and after that, setup a "final" RFC for how to approach so that we can coordinate the needed work. As attendees, I'm thinking some representatives from CLI, Expo, Metro and rnx-kit, keeping the number of people below 10.
kelset commentedon Jan 25, 2023
quick update: we are now working on said configuration standard, read more here: react-native-community/discussions-and-proposals#588
kelset commentedon Aug 7, 2023
headsup: we are still blocked on this waiting on the RFC to make progress: react-native-community/discussions-and-proposals#588
AFAIK it will be actually get closed in favour of a 3.0 rewrite as a separate PR; I'll post an update once it's there.
kelset commentedon Apr 4, 2024
An update on this: since the last time we talked about this, there have been a couple of relevant updates:
libraries have started supporting new arch & bridgeless. So, indirectly, just by keeping up and having profiles for 0.73 and 0.74 for align-deps, we do have somewhat a level of support for developers using align-deps in making sure that they are using versions of libs that do have newarch/bridgeless support.
Alek Mikucki (@aleqsio) made a small handy tool that checks a repository package.json against the (manually maintained) gSheet linked in the discussion above. While not ideal nor programmatic (since it's source of truth is a man-mantained gSheet), me and Tommy think it does a pretty great job.
So devs at this point in time have a pretty decent level of support in migrating their apps to the new arch.
Because of this, we think we can close this off. Let us know if you have other thoughts on the matter.