-
Notifications
You must be signed in to change notification settings - Fork 465
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
Create a macOS implementation of AsyncStorage + macOS example app and e2e tests #296
Merged
krizzu
merged 24 commits into
react-native-async-storage:LEGACY
from
tom-un:tomun/macos
Feb 27, 2020
Merged
Create a macOS implementation of AsyncStorage + macOS example app and e2e tests #296
krizzu
merged 24 commits into
react-native-async-storage:LEGACY
from
tom-un:tomun/macos
Feb 27, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ve.config and consume react-native-macos npm package.
Moved mac e2e scripts out of .circleci to scripts.
tido64
reviewed
Feb 20, 2020
example/macos/AsyncStorageExample-macOS/AppDelegate+RNCAsyncStorageDelegate.m
Outdated
Show resolved
Hide resolved
example/macos/AsyncStorageExample-macOS/RNCTestAsyncStorageDelegate.m
Outdated
Show resolved
Hide resolved
Co-Authored-By: Tommy Nguyen <[email protected]>
Co-Authored-By: Tommy Nguyen <[email protected]>
krizzu
approved these changes
Feb 27, 2020
@tom-un Thanks for the great work! I've tested it locally and works great! :) I'll go ahead and merge it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
This change adds a macOS implementation of AsyncStorage. It shares the same source as the iOS implementation.
The macOS react-native implementation is an "out-of-tree" platform from the core react-native repo which contains only iOS and Android implementations. Having two react-native implementations in node_modules creates some challenges for the metro bundler. The metro issue is being discussed here react-native-community/discussions-and-proposals#182. In lieu of an "official" solution I'm using a workaround involving react-native.config.js and a pair of metro.config.js files for the two react-native implementations. The identical approach was used for the macOS implementation in the react-native-webview repo as recently completed in this PR.
Test Plan:
A native macOS example app was added parallel to the iOS and Android example apps. End to end tests were created and added to the Circle CI PR scripts. The iOS and Android e2e tests were implemented using detox: but detox has no support for macOS, so the macOS tests were implemented as Xcode XCUITests. The same detox JavaScript test logic was ported into XCUITest Object C.
The macOS e2e tests can be executed similarly to the iOS and Android tests:
Or the example app can be opened in Xcode and launched. However, due to the "out-of-tree" platform issues described above, you must manually launch the metro bundler: