-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Use commonjs imports in relay-runtime #2367
Conversation
7747100
to
b087dae
Compare
Nice 👌 I think it would make sense to add a lint rule, such as this one by @janicduplessis, to this repo. There’s probably a bunch of changes needed of all open PRs and it could be hard to remember for FB employees to not use Haste imports as it will just work for them. |
Reviewed By: dwwoelfel Differential Revision: D7209118 fbshipit-source-id: 109c291e499de4ad4c0434db6f4e31db175993d6
Sorry, this is blocked by deep reliance on the When we have this, I think the open source will be cleaner, but it's a mess to change this. |
@kassens is there any point in leaving the |
In one of our environments we don't support a mix of both. The |
Very naive thought, but would it be feasible to have a script for that one environment that changes commonjs imports to haste ones and moves all the files back into a flat structure? |
@kassens would it be possible to update relay to use ES6 modules while still maintaining compatibility with the FB haste system? If it's possible, I'd like to open PR to do that to get closer to shipping optimized flat bundles (#1590 (comment)). |
Hey, I think it doesn't make sense to have this as a PR as the hardest part is figuring out the internal cleanup which probably needs to happen somewhat incrementally to keep the changes sane. (A bunch of internal references need to be updates when a module is moved). |
Doing the same that was done in 97f24f8 for react-relay in relay-runtime.
This is part of the first step in #1590 (comment).
I left the
@providesModule
in the files inrelay-runtime/util/*.js
and a few others that used directly in the other packages. I can address that in the next PR by exporting them inRelayRuntime.js
. I didn't want this one to get bigger than it already is.