react-native-community / template

The React Native Community Template - getting started building RN apps for Android & iOS
MIT License
66 stars 16 forks source link

Update to yarn 4.x and prettier 3.x #41

Open jahead opened 3 months ago

jahead commented 3 months ago

Hey Everyone,

I posted at https://github.com/react-native-community/discussions-and-proposals/discussions/808


Hey now that the template is separate to the react native core, would it be possible to update to using yarn@4.x and prettier@3.x targeting for react native 0.76?


On a side note, I was confused as where this should be asked, I opt'ed for discussions-and-proposals as a full back because template only has issue types for bug report - this doesn't feel like a bug report.

I would be willing to help out with this

blakef commented 3 months ago

I don't think we specify a dependency of a particular version of yarn in the template, or are you thinking of the CLI doctor?

I don't have any issue with bumping prettier, unless there are substantial changes that affect the upgrade helper. The noise it generates normally means it isn't worthwhile. If you can show that the changes don't generate that noise we should definitely upgrade.

jahead commented 3 months ago

I guess I referring to this https://reactnative.dev/blog/2024/04/22/release-0.74#yarn-3-for-new-projects

But it seems like this is or was controlled at the cli level?

Yep you can see the yarn version defined here. https://github.com/react-native-community/cli/blob/6a61d5dcc99c6430b74c1095e05ffb315909b078/packages/cli/src/commands/init/init.ts#L88

for prettier and eslint for context https://github.com/facebook/react-native/pull/38545

and I think the eslint config file has changed. but I believe before we can update, the upstreams need to be updated? :/

blakef commented 3 months ago

Yes, we're limited here. Thanks for looking into this.

Is there a compelling case to upgrade other than just keeping up?

jahead commented 3 months ago

I'm not so concerned with being behind a minor or patch. I'm concerned with general maintenance with respect to both eslint and prettier have bumped major versions, and it incurs some plugin churn. Really we internally don't do much out outside of the @react-native/eslint-config as it has happy defaults.

I think that package is basically the blocker for both updating prettier and eslint, which react native core has said they will eventually get to doing in their internal repo.

I just incorrectly assumed when template was ejected that it would allow for an out of band update. Same with yarn

jonthysell commented 2 weeks ago

This is just kind of weird - every new project starting with 0.74 was put on yarn 3, we made changes in React Native Windows to accommodate it, and now it's gone? Did it go away with 0.75? 0.76?