[0.62] Fix app template to use app.json's name for main component name (#7464)#7476
[0.62] Fix app template to use app.json's name for main component name (#7464)#7476jonthysell wants to merge 3 commits intomicrosoft:0.62-stablefrom
Conversation
#7464) This PR backports #7464 to 0.62. In react-native-community/cli#1370 the CLI was changed in a way that can produce different values for the project name (name in package.json) and the main component name (name in app.json). Historically, sometimes older templates didn't set name in the package.json at all, instead using app.json. So our CLI was written to accomodate that logic (load name from package.json if possible, then fallback to app.json). Either way, we use that single value everywhere in our template, for file and varaible names. This PR updates our template to use the value in app.json, if possible, to set the component name to load. This matches the behavior on iOS and and Android. Closes #7451
|
I don't know if we actually want to check this in - users creating new 0.62 projects can easily "fix" their app by updating the MainComponentName in App.cpp/cs to the value in app.json's name field. But if we want new 0.62 apps to work out of the box, we should check this in. |
|
My guess is that we shouldn't see too many brand new 0.62 apps. I don't think we've formalized our support, but 0.62 is feeling pretty far back. I think it would be great if we could get CI working on it again, but otherwise think we could probably call it EOL. I kind of have been wanting to formalize that more recently. E.g. something like we support "latest" with high value bug fixes, "n-1" for issues immediately blocking partners, and only security for versions older than that. Helps to make things easier for us, and helps to keep partners on our newer bits. |
|
Sounds like this is safe to close, feel free to reopen if need arises :) |
This PR backports #7464 to 0.62.
In react-native-community/cli#1370 the CLI was
changed in a way that can produce different values for the project name
(name in package.json) and the main component name (name in app.json).
Historically, sometimes older templates didn't set name in the
package.json at all, instead using app.json. So our CLI was written to
accomodate that logic (load name from package.json if possible, then
fallback to app.json). Either way, we use that single value everywhere
in our template, for file and varaible names.
This PR updates our template to use the value in app.json, if possible,
to set the component name to load. This matches the behavior on iOS and
and Android.
Closes #7451
Microsoft Reviewers: Open in CodeFlow