Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(windows) Fix autolinking and remove legacy projects #521

Merged
merged 1 commit into from Nov 16, 2021

Conversation

jonthysell
Copy link
Contributor

@jonthysell jonthysell commented Nov 16, 2021

  • Updates the module project with a newer template which will be
    detected by autolinking (RNW >= 0.63)
  • Fixes react-native.config to properly identify the windows example project
  • Removes the legacy C# project, which only confuses autolinking
  • Updates docs around windows autolinking support

A side effect of this update is that RNW 0.60/0.61 are no longer "supported".

Closes #516

* Updates the module project with a newer template which will be
  detected by autolinking (RNW >= 0.63)
* Fixes react-native.config to properly identify the windows example project
* Removes the legacy C# project, which only confuses autolinking
* Updates docs around windows autolinking support

A side effect of this update is that RNW 0.60/0.61 are no longer "supported".
@jonthysell
Copy link
Contributor Author

FYI @tero-paananen

Copy link
Contributor

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow - looks pretty great, thank you! Curious for a look from @tero-paananen if they have time
To be sure I understand, we're clipping off support for RNW < 0.62 ?
I have no problem with issuing breaking changes I just like to make helpful / authoritative release notes when they happen so there is no doubt on what broke, who's affected and how to handle it

Cheers!

@jonthysell
Copy link
Contributor Author

For context, in RNW terms, 0.60 and 0.61 are pretty ancient. RNW 0.62 helped standardize things in a way that makes support/compatibility easier. (I should know, I'm the one that did it. And implemented autolinking in 0.63.)

While the actual module code may be compatible (I didn't really have to change that) there have been lots of changes to the build files/tooling. In order to continue supporting 0.60/0.61 I'd have to create separate, parallel, build files, and one group (either <= 0.61 users or >= 0.62 users) would have to change their project linking.

Anyway, I went with the "easier to maintain in the future" option. Also, I tested this change by verifying:

  • the example app (which targets RNW 0.65) still works
  • a new RNW 0.62 app, using manual linking, works
  • a new RNW 0.63 app, using autolinking, works

Hopefully the drop of RNW 0.60/0.61 support isn't too painful, but honestly, if you're a dev out there targeting RNW, please use a newer version. :)

@mikehardy
Copy link
Contributor

Without being too brutal about it, past a few releases back I'm of the opinion "if it breaks you, don't upgrade" and then get on with the easier to maintain bit. Maintainer time is I think the scarce resource in the ecosystem so I'm totally fine with semver major, dropping RNW<62 and moving right along. Thanks for the explanation!

@tero-paananen
Copy link
Contributor

tero-paananen commented Nov 16, 2021

That PR is ok for me of course. I will try to get time to test this on Windows tomorrow.

@tero-paananen
Copy link
Contributor

That PR is ok for me of course. I will try to get time to test this on Windows tomorrow.

The module and the example app both builds and works. I tested using Visual Studio 16.11.6.

@tero-paananen
Copy link
Contributor

tero-paananen commented Nov 16, 2021

One side note. I am not sure does this module (master) work on Windows if there is SIM card in use. One our customer says that our app works and another that there is some issues when using SIM card. We do not have Windows device with SIM card.

@mikehardy mikehardy merged commit 45628d8 into react-native-netinfo:master Nov 16, 2021
@mikehardy
Copy link
Contributor

Great - merged it with the appropriate release note I believe, should auto-launch momentarily. Always happy to merge these high quality PRs :-), thanks!

github-actions bot pushed a commit that referenced this pull request Nov 16, 2021
# [7.0.0](v6.2.1...v7.0.0) (2021-11-16)

* fix(windows)!: Fix autolinking and remove legacy projects (#521) ([45628d8](45628d8)), closes [#521](#521)

### BREAKING CHANGES

* Drop support for react-native-windows 0.61 and lower. Update to RNW 0.62 or higher
@matt-oakes
Copy link
Collaborator

🎉 This PR is included in version 7.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@namrog84
Copy link
Contributor

This is so awesome! <3

sourceDir: 'example\\windows',
solutionFile: 'NetInfoExample.sln',
project: {
projectFile: 'NetInfoExample\\NetInfoExample.vcxproj',
Copy link
Contributor

@namrog84 namrog84 Nov 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonthysell @mikehardy
I am not sure if this has been fixed in newer versions of react native. But the usage of \\ here could be problematic for ios users in other indirect scenarios.

See my other PR where we ran into similar issues, we ended up having to patch for a while.
wonday/react-native-orientation-locker#188

Was this fixed in newer versions of RNW? Could this still be problematic for anyone on RNW63 and RNW64 or whichever versions that are still supported but older?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to patch this immediately it was painful here c9a2966

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autolinking on rn-windows 0.66.3 gives error
5 participants