-
Notifications
You must be signed in to change notification settings - Fork 47.5k
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
Make React compatible with ES Modules and Pika #15885
Make React compatible with ES Modules and Pika #15885
Conversation
See https://www.pika.dev/about/ for basic information about Pika. When searching for React (https://www.pika.dev/search?q=react) in Pika's interface, it shows: ``` EXACT MATCH! react Package found! However, no ES "module" entrypoint was detected in its package.json manifest. If possible, explore the site for a more web-friendly alternative. ``` It looks like this commit in my PR is all that's needed, because React is fortunately already written using ES Module syntax.
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Ok I just signed the CA. |
No significant bundle size changes to report. Generated by 🚫 dangerJS |
I added a second commit that makes the same exact change for ReactDOM. This PR should now be sufficient for most (all?) React users to now use Pika and ES Modules to load React. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
If it's true, that's a shame. Guess we'll have to wait to use React with Pika and use Preact@next in the meantime. Thanks @TrySound. Feel free to close this PR if it doesn't make sense in context of being merged after those two PRs are merged. |
From what I see pika is able to provide own version of react for components. |
Oh perfect, how did I miss that! Thanks @TrySound this will help a ton :) |
For anyone else who finds this issue, we've added a note for how to use React with @pika/web You can also search "react esm" on pika.dev to find a few different options for React & ReactDOM, published as ESM: |
Thanks @FredKSchott, though it seems that react-esm has been deleted |
Can you share a link to the deleted thing? I see react-esm & @reactesm both available: https://www.npmjs.com/package/react-esm |
Sorry I think I drew the wrong conclusion, however react-esm is not working on PikaCDN, it returns a 404: |
Ah, that looks like a bug in the CDN resolver logic. Thanks for sharing, I'll get that fixed asap |
awesome thanks a lot! |
See https://www.pika.dev/about/ for basic information about Pika.
When searching for React (https://www.pika.dev/search?q=react) in Pika's interface, it shows:
It looks like this commit in my PR is all that's needed, because React is fortunately already written using ES Module syntax.