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

Add Windows Support #138

Merged
merged 21 commits into from
May 22, 2021
Merged

Add Windows Support #138

merged 21 commits into from
May 22, 2021

Conversation

namrog84
Copy link
Contributor

@namrog84 namrog84 commented Mar 31, 2021

Summary

Add Windows support to react-native-localize #137

  • What issues does the pull request solve? Please tag them so that they will get automatically closed once the PR is merged

  • What is the feature? (if applicable)
    It adds support for Windows.

  • How did you implement the solution?
    By adding the appropriate changes to support react-native-windows.

  • What areas of the library does it impact?
    Only additive, it shouldn't impact any existing areas.

Test Plan

  1. I had to make some unchecked in changes.
    • I had removed the yarn pod-update from package.json's post install since that doesn't work on windows. But I didn't want to break or modify any existing flows.
  2. I ran yarn start-metro
  3. I ran Build Solution debug x64 and then Start Debugging.
    • Using recent version of Visual Studio 2019.
  4. I then was able to take this screenshot.

What's required for testing (prerequisites)?

Windows machine with recent version of node(yarn) and visual studio 2019.

What are the steps to reproduce (after prerequisites)?

Please see above "Test Plan" for how to run example.

Compatibility

OS Implemented
Windows

Checklist

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I mentioned this change in CHANGELOG.md.
    • I didn't see a changelog.md
  • I updated the typed files (TS and Flow)
  • I added a sample use of the API in the example project (example/App.js)
    • I added windows example project

Note:
Missing support for event listener trigger of localizationDidChange. Someone from my team will investigate and PR that in future PR.

@namrog84 namrog84 requested a review from zoontek as a code owner March 31, 2021 21:13
android/.project Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
windows/RNLocalize/RNLocalizeModule.cpp Outdated Show resolved Hide resolved
windows/RNLocalize/RNLocalizeModule.h Outdated Show resolved Hide resolved
windows/RNLocalize/RNLocalizeModule.cpp Outdated Show resolved Hide resolved
windows/RNLocalize/RNLocalizeModule.cpp Outdated Show resolved Hide resolved
windows/RNLocalize/RNLocalizeModule.cpp Outdated Show resolved Hide resolved
windows/RNLocalize/RNLocalizeModule.cpp Outdated Show resolved Hide resolved
windows/RNLocalize/RNLocalizeModuleTypes.h Outdated Show resolved Hide resolved
windows/RNLocalize/RNLocalizeModuleTypes.h Outdated Show resolved Hide resolved
windows/RNLocalize/RNLocalizeModule.cpp Outdated Show resolved Hide resolved
@namrog84
Copy link
Contributor Author

namrog84 commented Apr 2, 2021

Will address all the suggested changes Monday or Tuesday. Not around this weekend.

@namrog84
Copy link
Contributor Author

namrog84 commented Apr 6, 2021

@zoontek no rush or anything but just wanted to toss a FYI.

I updated all PR suggested changes from @asklar and have tested example app project of what is checked in as of this comment.
So I think it's ready for your review or whatever the next steps are at your convenience.

Just let me know if there are any further suggested changes I can do or change.

Thanks! 👍

Copy link
Contributor

@asklar asklar left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Contributor

@asklar asklar left a comment

Choose a reason for hiding this comment

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

thanks for addressing the comments; I had signed off but then I saw a dangling pointer (please fix before merging) and I added a couple more comments

@namrog84
Copy link
Contributor Author

namrog84 commented Apr 6, 2021

thanks for addressing the comments; I had signed off but then I saw a dangling pointer (please fix before merging) and I added a couple more comments

All good, I'll address these new ones soon! Thanks again for looking at it some more. Ill make your suggested changes and I see a few other things myself I'd like to clean up a bit more. The code was quite old/unchanged for us, so it's great to try and get this in a much better state before merging.

@zoontek
Copy link
Owner

zoontek commented Apr 14, 2021

@namrog84 @asklar I saw there's a lot of unresolved discussions. Is this PR ready to be reviewed?
As I don't own a windows computer and it is extremely painful for me to test it (virtual machine) I'd rather be sure that it is.

Thanks!

@namrog84
Copy link
Contributor Author

namrog84 commented Apr 14, 2021

It is not ready yet. I need to address a few more things. Just some real life things came up for me and I haven't been able to resolve them yet. Hopefully should be able to super soon. I will @ you when I am ready again.

@namrog84
Copy link
Contributor Author

I have now fixed and/or responded to all of @asklar comments. I have updated last few things and I believe am ready for another look now.

I have no further plans for changes unless any one has more suggestions or thoughts. We can wait a little bit in case anyone else wants to add anything before @zoontek gets a VM ready.

If there is anything I can do to make it easier for you (e.g. take screenshots/video of anything specific). Just let me know.

Copy link
Contributor

@asklar asklar left a comment

Choose a reason for hiding this comment

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

Thanks!

package.json Outdated
"localize",
"localization",
"l20n"
],
"scripts": {
"format": "prettier '**/*.{js,json,md,ts,tsx}' --write",
"prepare": "bob build"
"prepare": "bob build",
"windows": "react-native run-windows"
Copy link
Owner

Choose a reason for hiding this comment

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

Shouldn't this be in the /example app?

Copy link
Contributor Author

@namrog84 namrog84 May 17, 2021

Choose a reason for hiding this comment

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

It does sound reasonable, I think I'll just remove this. I believe this was auto added by some script. I never use these helper script on windows, since VS has such a much better flow without it.

Fixed: removed it.

@zoontek
Copy link
Owner

zoontek commented May 17, 2021

LGTM 👍

I trust you guy since I don't own a Windows computer and I can't use virtualization anymore (Apple M1)

@zoontek zoontek merged commit 257d8a8 into zoontek:master May 22, 2021
@mck1117 mck1117 mentioned this pull request Jun 3, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants