-
Notifications
You must be signed in to change notification settings - Fork 54
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
Support Webpack compilation #347
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 9fa0ef4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thanks, it sounds like this should be okay. I took this for a spin on iOS and Android and it looks good to me -- @carbonrobot confirm? |
@zibs @Nickersoft The |
Looks like it requires the following versions
So we would have to be comfortable dropping support for anything outside those ranges as well. Looking at the npmjs stats, 16.14 seems like a reasonable cutoff, so I would be ok with that. It's the oldest release with over 1mil+ weekly downloads. Everything under that is significantly less. |
@carbonrobot If it's any consolidation, I've been using react-jsx successfully via Expo for the Storybook app I'm running! |
@Nickersoft Awesome! As far as I can tell, its supported for the last couple versions, I sent out a message to someone on the Expo team for confirmation, but I feel pretty good about it. |
Okay, I was able to test this as However, @Nickersoft can you clean up this PR so that it's really only the single line change we need here? |
Awesome @zibs, thanks! Cleaned it up. So in addition to the Curious if there's a way the code could be compiled using that Babel plugin to inject the dependencies as part of this repo's build step? For reference, it's this one: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/#step-2-add-reanimateds-babel-plugin. Otherwise, dependencies need to be explicitly specified for all animation-related hooks in the project or they may not work on web. |
Friendly bump. Is there any way to use |
@zibs is this good to merge? |
@Nickersoft Thanks for the cleanup. Just to confirm, are you saying the missing hook dependency is required for Webpack compilation, or is that part of a separate bug fix? |
Yes it is @carbonrobot – in fact, I fear this may not be the only place it's required (though it's the only bug I caught). Basically by precompiling the code for web projects, downstream users aren't required to use Reanimated's Babel plugin that would typically automatically add these dependencies. In fact, most web bundlers won't transpile any source code from NPM packages like they might for a RN project. So we'd probably want to make sure we're accurately specifying Reanimated's dependencies in these hooks, though I'm not sure how widespread the issue is. |
I don't think we are yet capturing all the requirements in their documentation at this point in order to support web builds. If there are other unknown bugs, we would also need to verify and correct those before this is mergeable. There is a guide here on implementing this without using Babel by doing the following:
|
Description
This PR simply changes the output format for JSX from
react-native
toreact-jsx
, as the former results in unprocessed JSX that transpilers like Webpack don't understand. Confirmed to work on web and iOS.Fixes # (issue)
#346
Type of Change
How Has This Been Tested?
Tested manually using Storybook for web and iOS.