matrix-org / matrix-js-sdk

Matrix Client-Server SDK for JavaScript
Apache License 2.0
1.49k stars 577 forks source link

Rename `crypto-api.ts` -> `crypto-api/index.ts` #4283

Closed richvdh closed 4 days ago

richvdh commented 5 days ago

I found it quite confusing having CryptoApi be defined so far from the crypto-api folder.

richvdh commented 5 days ago

LGTM but I think its a breaking change

Shouldn't be? import { foo } from "matrix-js-sdk/src/crypto-api"; should still work?

t3chguy commented 5 days ago

Shouldn't be? import { foo } from "matrix-js-sdk/src/crypto-api"; should still work?

Indeed, but import { foo } from "matrix-js-sdk/lib/crypto-api.js; would not. I believe ESM consumers have to import files like this

richvdh commented 5 days ago

FML. Really?

It really feels like we need better tests for this stuff, if we're going to try and support it.

Maybe this isn't worthwhile, then.

richvdh commented 4 days ago

You're right, but it looks like ESM is borked anyway: https://github.com/matrix-org/matrix-js-sdk/issues/4287

richvdh commented 4 days ago

... on which basis, I'm merging this without an X-Breaking-Change.