-
Notifications
You must be signed in to change notification settings - Fork 16
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 commonjs
import standard for node vs web
#838
Comments
For completely biased reasons I like the idea of option 2 and am curious about option 3. However, I also understand it's a selfish/biased reason for me because it just helps me with create-react-app but I'm also trying to do some research so that I can make guides in helping customers with React if we do stay with option 1. |
I would highly recommend we do not drop |
And for reference, I have tested @sethjback , it sounds like the answer is, "we must support |
From @janpieterz : I do really like having 1 package though, for consumers that’s so much easier, any tiny friction should, imho, be avoided. Wouldn’t having the Seth Back link be functional, keeping the code separate but allow 0 friction? Hmmm, this is an interesting approach! This would solve the node side of the problem. It doesn't solve the web side of the problem, wherein the dependencies cause issues with webpack and polyfills. It sounds like the right answer to this problem is:
@sethjback @janpieterz @MichaelEdwardBlack what say you? |
It's almost the only solution. Is this feasible to reach before GA, with the other work in the sprint? |
I'm pretty sure I can pull it off. It's affecting a customer, so it's sort of required pre-GA. |
Am I mis-reading this from the article? Sounds like he is suggesting a single CJS library with:
Doesn't that solve the issue without a split codebase (i.e. two packages)? You just document including that esm subdirectory / package.json for your node users, everyone else uses the regular codebase. Again - not a javascript expert here... |
That prevents splitting
Me neither, lol. We need a better front-end guy than me to own this type of thing. |
@fundthmcalculus Are the node dependency issues related to |
We have to use es2020 to get await import, older ESM doesn't fix CommonJS. |
Ah, I don't know enough. |
That sounds like a plan! |
We spoke, we’ll aim to release a single package, commonjs based. Scott will see if using |
End result: we need two okapi modules: |
We have a request to switch back from
es2020
tocommonjs
module support. This would enable older versions of node and eliminate the requirement fortype: module
, while requiring us to have separate node and web packages. We combined the packages so that we didn't have code duplication between node and web packages. That being said, we have automatic template code generation now, so the code duplication is less of an issue. Thoughts on ways forward:tsconfig.json
, and change the module format on npm publish. (testing issues?)If we pick options 2 or 3, we should probably do the same for okapi to eliminate any issues on that front. Okapi doesn't have as many dependencies, so we aren't creating issues with webpack and polyfills there.
The text was updated successfully, but these errors were encountered: