Open turt2live opened 3 months ago
I'm still a bit confused by this: the point is not so much to avoid using base64-js if Webpack or whatever happens to be providing it, the point is that the js-sdk should not require it in order to work.
I'm still a bit confused by this: the point is not so much to avoid using base64-js if Webpack or whatever happens to be providing it, the point is that the js-sdk should not require it in order to work.
well, why not? Isn't depending on base64-js better than requiring a polyfill of Buffer?
Well, yes, but that's certainly not the intention. If that's what it's doing then in practice it's broken.
well, then I think we're aligned.
TBH though, my feeling is that the attempt to avoid a dependency on base64-js has given us some complicated code that we don't really understand, and the cost isn't worth the benefit.
(aside: it might be nice if base64-js had an alternative entrypoint for nodejs which did something like Buffer.from(input).toString('base64')
instead of the pure js impl. But that's a sidebar.)
See https://github.com/matrix-org/matrix-js-sdk/pull/4338 and in particular https://github.com/matrix-org/matrix-js-sdk/pull/4338#pullrequestreview-2222292684