-
Notifications
You must be signed in to change notification settings - Fork 72
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
Move npm module to esm and drop node < 20 #224
Comments
Node 18 is still a supported LTS release for another year. We should definitely not drop support for it before it reaches end-of-life. |
Provided it doesn't cause any compatibility issues for existing Node users, ensuring the @hyperledger/fabric-protos package is an ES module rather than CommonJS sounds pretty reasonable to me. I'm not sure how well the protobuf compiler output lends itself to being exposed as an ES module directly or if it relies on CommonJS import/export semantics. Maybe a bundler could be used to achieve the desired result? |
But now sdk support node 14... |
Yes, the current compiler is disgusting, you need to write a new solution here... |
If you have a good idea for a better approach, you could submit a pull request? |
Hmmm, digging a bit more into ESM and CommonJS module loading... it seems that ES modules can load CommonJS modules fine (with some minor caveats related to default exports), whereas ComonJS modules cannot (easily) load ES modules. Today fabric-protos is a CommonJS module so can be used by both CommonJS and ES modules. If we change fabric-protos to be a native ES module, it will break all existing CommonJS applications that depend on fabric-protos. That doesn't sound like a great change, although I'm happy to hear from anyone with better information. |
No description provided.
The text was updated successfully, but these errors were encountered: