-
Notifications
You must be signed in to change notification settings - Fork 238
feat: support both ESM and CJS and update to vitest #2444
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
Conversation
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
🦋 Changeset detectedLatest commit: eefe8fa The changes in this PR will be included in the next version bump. This PR includes changesets to release 19 packages
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 |
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
@AlexanderShenshin we got a test failure related to hedera. I'm trying to resolve all the flaky tests. Any idea how to resolve this?
Test run: https://github.com/openwallet-foundation/credo-ts/actions/runs/18387597993/job/52389831678?pr=2444 |
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Libraries we can update once we go full ESM:
TBH after compiling this list I think we may want to switch to ESM immediately. I will do some more tests, but since node 20.19+ you can import ESM from CJS in, and I think for React Native code will be transpiled, so I think we'll be good. |
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
I tested it with requiring ESM from CJS and that works fine in Node.JS starting from Node 20.19. Node 20.18 fails. I updated the engines accordingly. |
@berendsliedrecht @genaris This is ready to review now. I would like to merge it as is, then I'll update all dependencies in a separate PR before the 0.6 release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go! 🚀
@TimoGlastra Sorry for late response, I was traveling and missed your comment here. I don't think that I seen this exact error as part of flakiness behavior recently, but it's possible (either a test timeout or failed read since Hedera SDK waits for messages from Mirror Node for a limited time). The best option to remove flakiness here is to migrate to using local Hedera instance for integration tests (using Hiero Solo Action). This is something that we're planning to work on soon (first to use it in SDK and then contribute similar setup for Credo module). |
tsdown
to bundle for both CJS and ESM (bridge period) -> tsdown is based on rust, so it should help with performancevitest
since jest doesn't work well with ESM -> this should also help with performanceAll tests passing, will now create a test release and try to use it in a Node.JS (ESM and CJS) and React Native project.
Edit: I have test it in a Node.JS ESM project and it seems to work great! Next up is Node CJS and React Native
Replaces #2441