react-native-community / upgrade-helper

⚛️ A web tool to support React Native developers in upgrading their apps.
https://react-native-community.github.io/upgrade-helper
MIT License
3.67k stars 112 forks source link

Add initial support for `react-native-windows` #273

Closed lucasbento closed 3 years ago

lucasbento commented 3 years ago

Summary

This PR adds initial support for react-native-windows by accepting a package query string with react-native and react-native-windows as possible values, if none provided then react-native is used as default.

As for the diffs, for react-native-windows it uses https://github.com/acoates-ms/rnw-diff and for react-native it remains using https://github.com/react-native-community/rn-diff-purge.

Test Plan

  1. Access https://deploy-preview-273--upgrade-helper.netlify.app/?from=0.63.4&to=0.64.1;
  2. Make sure that it loads react-native diff;
  3. Access https://deploy-preview-273--upgrade-helper.netlify.app/?from=0.63.4&to=0.64.1&package=react-native;
  4. Make sure that it loads react-native diff;
  5. Access https://deploy-preview-273--upgrade-helper.netlify.app/?package=react-native-windows;
  6. Make sure that it loads react-native-windows diff.

Issues that need to be fixed

lucasbento commented 3 years ago

Some questions that need to be answered:

acoates-ms commented 3 years ago

@lucasbento How do you get the link to the changelog for react-native? We have changelog information here: https://github.com/microsoft/react-native-windows/releases. Is there some other way we should be providing this information?

Having a dropdown or something for react-native vs react-native-windows might be cool. Presumably at some point we'd love to get react-native-macos in here too.

lucasbento commented 3 years ago

How do you get the link to the changelog for react-native? We have changelog information here: microsoft/react-native-windows/releases. Is there some other way we should be providing this information?

We point to a CHANGELOG.md with the version (e.g. https://github.com/react-native-community/releases/blob/master/CHANGELOG.md#v0640), the address is always the same except for the version at the end, do you know if that's possible to do with react-native-windows?

Having a dropdown or something for react-native vs react-native-windows might be cool. Presumably at some point we'd love to get react-native-macos in here too.

That would be very cool.

acoates-ms commented 3 years ago

This is probably the best URL to use - Something like: https://github.com/microsoft/react-native-windows/releases/tag/react-native-windows_v0.65.0-preview.1 https://github.com/microsoft/react-native-windows/releases/tag/react-native-windows_v0.64.12

acoates-ms commented 3 years ago

@lucasbento -- Anything I can do to help move this along? -- We're looking at documentation for the 0.65 upgrade and would love to be able to point to upgrade-helper for that.

lucasbento commented 3 years ago

@acoates-ms sorry for the waiting on this, gonna do some work tomorrow and get it merged.

lucasbento commented 3 years ago

So, wasn't done yesterday but everything seems to be ready today.

I'm not very confident on merging this right now as I did most of it quite a while ago, @pvinis & @acoates-ms can you please help me to manual test this? you can see the URLs in the PR body.

As soon as it's approved then we can merge it.

@acoates-ms regarding the changelog URL, it's implemented now but that is only shown when a release file is created for the UsefulContentSection, if you already have any content in mind I can create something so we can check that it's working correctly.

I'm back at contributing more time to open-source so I will make sure that this PR is merged asap.

acoates-ms commented 3 years ago

The current state looks good. We can always make further improvements later.

For the UsefulContentSection, that is something that's manually added to this repo for certain releases right?

lucasbento commented 3 years ago

The current state looks good. We can always make further improvements later.

Great, just wanna make sure that we also don't have any regressions.

For the UsefulContentSection, that is something that's manually added to this repo for certain releases right?

Yes, to add content to UsefulContentSection you need to create a file under ./src/releases/react-native-windows/ with the version as the file name (e.g. 0.64.js). You also need to specify that version in ./src/releases/index.js.

lucasbento commented 3 years ago

It's merged 🎉

@acoates-ms let me know if you need any help or encounter any issues.