Skip to content

[0.62] Fix app template to use app.json's name for main component name (#7464)#7476

Closed
jonthysell wants to merge 3 commits intomicrosoft:0.62-stablefrom
jonthysell:appjson62
Closed

[0.62] Fix app template to use app.json's name for main component name (#7464)#7476
jonthysell wants to merge 3 commits intomicrosoft:0.62-stablefrom
jonthysell:appjson62

Conversation

@jonthysell
Copy link
Copy Markdown
Contributor

@jonthysell jonthysell commented Mar 25, 2021

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

#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
@jonthysell
Copy link
Copy Markdown
Contributor Author

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.

@NickGerleman
Copy link
Copy Markdown
Contributor

NickGerleman commented Mar 25, 2021

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.

@asklar
Copy link
Copy Markdown
Member

asklar commented May 27, 2021

Sounds like this is safe to close, feel free to reopen if need arises :)

@asklar asklar closed this May 27, 2021
@jonthysell jonthysell deleted the appjson62 branch June 15, 2021 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants