Skip to content

Conversation

TimoGlastra
Copy link
Contributor

@TimoGlastra TimoGlastra commented Oct 9, 2025

  • Use tsdown to bundle for both CJS and ESM (bridge period) -> tsdown is based on rust, so it should help with performance
  • Update to vitest since jest doesn't work well with ESM -> this should also help with performance
  • Simplify type checking -> just a single type check script instead of one for all packages. This should help with performance.

All 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

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>
@TimoGlastra TimoGlastra requested a review from a team as a code owner October 9, 2025 19:26
Copy link

changeset-bot bot commented Oct 9, 2025

🦋 Changeset detected

Latest commit: eefe8fa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@credo-ts/askar-to-drizzle-storage-migration Minor
@credo-ts/indy-sdk-to-askar-migration Minor
@credo-ts/drizzle-storage Minor
@credo-ts/question-answer Minor
@credo-ts/react-native Minor
@credo-ts/action-menu Minor
@credo-ts/redis-cache Minor
@credo-ts/anoncreds Minor
@credo-ts/openid4vc Minor
@credo-ts/indy-vdr Minor
@credo-ts/didcomm Minor
@credo-ts/tenants Minor
@credo-ts/hedera Minor
@credo-ts/askar Minor
@credo-ts/cheqd Minor
@credo-ts/webvh Minor
@credo-ts/core Minor
@credo-ts/drpc Minor
@credo-ts/node Minor

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

@TimoGlastra TimoGlastra mentioned this pull request Oct 9, 2025
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>
@TimoGlastra
Copy link
Contributor Author

TimoGlastra commented Oct 9, 2025

@AlexanderShenshin we got a test failure related to hedera. I'm trying to resolve all the flaky tests.

Any idea how to resolve this?

ERROR: Error retrieving schema 'did:hedera:testnet:DqhNQpKuA1bxPbjLGRZRtGWgE93ZWRp65ppiheoV9skV_0.0.7011265/anoncreds/v0/SCHEMA/0.0.7011269' {
  "error": {
    "serialized": "Error: Resolved HCS file payload is invalid",
    "message": "Resolved HCS file payload is invalid",
    "name": "Error",
    "stack": "Error: Resolved HCS file payload is invalid\n    at _HcsFileService.resolveFileWithoutCache (/home/runner/work/credo-ts/credo-ts/node_modules/.pnpm/@hiero-did-sdk+hcs@0.1.5_bn.js@5.2.1_react-native@0.79.4_@babel+core@7.27.7_@react-nati_4897dc6b2e0eca2b2e8b22dd7e4b2c6d/node_modules/@hiero-did-sdk/hcs/src/hcs/hcs-file-service.ts:139:13)\n    at processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at _HcsFileService.resolveFile (/home/runner/work/credo-ts/credo-ts/node_modules/.pnpm/@hiero-did-sdk+hcs@0.1.5_bn.js@5.2.1_react-native@0.79.4_@babel+core@7.27.7_@react-nati_4897dc6b2e0eca2b2e8b22dd7e4b2c6d/node_modules/@hiero-did-sdk/hcs/src/hcs/hcs-file-service.ts:104:21)\n    at /home/runner/work/credo-ts/credo-ts/node_modules/.pnpm/@hiero-did-sdk+hcs@0.1.5_bn.js@5.2.1_react-native@0.79.4_@babel+core@7.27.7_@react-nati_4897dc6b2e0eca2b2e8b22dd7e4b2c6d/node_modules/@hiero-did-sdk/hcs/src/hedera-hcs-service.ts:127:25\n    at _HederaAnoncredsRegistry.getSchema (/home/runner/work/credo-ts/credo-ts/node_modules/.pnpm/@hiero-did-sdk+anoncreds@0.1.5_bn.js@5.2.1_react-native@0.79.4_@babel+core@7.27.7_@reac_0407bf6181ef9d5db018932dca7b2205/node_modules/@hiero-did-sdk/anoncreds/src/hedera-anoncreds-registry.ts:80:21)\n    at HederaAnonCredsRegistry.getSchema (/home/runner/work/credo-ts/credo-ts/packages/hedera/src/anoncreds/HederaAnonCredsRegistry.ts:53:14)\n    at AnonCredsApi.registerCredentialDefinition (/home/runner/work/credo-ts/credo-ts/packages/anoncreds/src/AnonCredsApi.ts:265:30)\n    at /home/runner/work/credo-ts/credo-ts/packages/hedera/tests/integration/hedera-anoncreds-registry.e2e.test.ts:58:29\n    at file:///home/runner/work/credo-ts/credo-ts/node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js:752:20"
  },
  "schemaId": "did:hedera:testnet:DqhNQpKuA1bxPbjLGRZRtGWgE93ZWRp65ppiheoV9skV_0.0.7011265/anoncreds/v0/SCHEMA/0.0.7011269"
}

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>
@TimoGlastra
Copy link
Contributor Author

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>
Signed-off-by: Timo Glastra <timo@animo.id>
@TimoGlastra
Copy link
Contributor Author

TimoGlastra commented Oct 10, 2025

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.

@TimoGlastra
Copy link
Contributor Author

@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

Copy link
Contributor

@genaris genaris left a 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 TimoGlastra merged commit bc6f0c7 into main Oct 10, 2025
20 checks passed
@TimoGlastra TimoGlastra deleted the feat/esm branch October 10, 2025 16:42
@AlexanderShenshin
Copy link
Contributor

@TimoGlastra Sorry for late response, I was traveling and missed your comment here.
This error for Hedera looks like intermittent issue with reading from Hedera Testnet.

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants