-
-
Notifications
You must be signed in to change notification settings - Fork 156
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: Fix #120 (running "yarn web" on Expo fails). #251
Conversation
Overall seems like the right move, just a few small questions :) |
Awesome 👍 . Ask away, will try to answer the best I can :) |
I left the questions as review comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I thought the questions would show up without submitting the review. Overall I think I'm ok with these changes, just clarification on those points would be good 👍.
The "dist" output in the v6 alpha packages contains JSX and ESNext constructs. Browsers can't handle these natively, so "yarn web" fails on Expo. Fix by using slightly less modern constructs in our dist outputs.
bdbe740
to
bb930b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good, the only thing I would say is that we need to apply this to the other addons also. I'll open a new PR with those changes.
…okjs#251) Changes tsconfig to target es6.
Issue: Fix #120. The "dist" output in the v6 alpha packages contains JSX and ESNext constructs. Browsers can't handle these natively, so "yarn web" fails on Expo. Fix by using slightly less modern constructs in our dist outputs.
What I did
Changed targets from
ESNext
toES6
(which modern browsers can run without transpiling). Changed thejsx
output settings toreact
fromreact-native
so that the JSX can also be rendered by browsers in addition to React Native. See https://www.typescriptlang.org/docs/handbook/jsx.html#basic-usage .How to test
yarn prepareAll
in the root of directory of this branchpoint the React Native Storybook dependencies to your local files:
yarn web
in the root directory of the Expo v6 alpha project that you set up. The project should start up in your browser. If you repeat this with thenext-6.0
branch instead of this branch,yarn web
should cause an error similar to this:yarn ios
andyarn android
in the Expo project as well asyarn ios
andyarn android
in the vanilla React Native project at/examples/native
in this repo. All should work.