-
-
Notifications
You must be signed in to change notification settings - Fork 589
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
Browserify artifact deprecation #3189
Comments
(previously on this subject: element-hq/element-web#11876) |
Here are download numbers for the browserified assets from v23.0.0: Since we also release on npm, this doesn't tell the full story of course but it at least hints at usage being fairly low. If you are currently a user of the browser version of matrix-js-sdk, we'd like to hear about your use case to better inform our decision about whether or not to deprecate this release channel. |
As someone who has used this file for a few small projects, it's quite convenient to have a JS file you can just drop in and then use the Matrix SDK without having to get deep into JavaScript packaging tools. I guess it's not really an important use case, but it's possible I'm not the only one. |
Nope, this proposal is to cull the complexity of generating & maintaining such a bundle |
I am porting my React Native application which uses the SDK, to web. (Using React Native Web.) I came across this issue in the course of trying to pare down my bundled JS size... which I think is very much related to the original intent of providing this packaging. This is a screenshot of my bundle analysis... Matrix SDK is by far the largest dependency. I am not using E2EE and so I think I can exclude that directory from packaging in a rather blunt way... but it is still "large." (Gzipped it's 153k.) I am rapidly coming up to speed on my JS/TS in the course of this project... however webpack and other bundling tooling is a really dark art. I'm curious how I might be able to reduce the initial-load overhead of pulling in the SDK. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Given feedback here and after re-discussing internally we've decided to go ahead with the deprecation. An official note will be included in the release notes of the cycle starting on July 11th and we'll aim to stop releasing the artifact in October 2023. Summarizing the issues with the browserify artifact that have led to this decsion:
|
The browserify build doesn't cause this, the js-sdk supporting operation without Olm does |
The browserify artifact has been deprecated this release cycle, scheduled for full removal in the October 10th release |
Shouldn't https://github.com/matrix-org/matrix-js-sdk#in-a-browser be updated? |
(and the first line of the README which says "This SDK can be run in a browser ..." ?) |
Yup |
I mean it can... Element Web does it. We just don't ship a pre-built web bundle for you. It doesn't require any node-specific libs. |
True enough I suppose. The problem is really that the "In Node.js" section conflates "node.js" and "using the SDK in anything with JS modules" |
@t3chguy Any guidance on how someone might actually prebuild the web bundle themselves? |
@Purgenta using a tool like Vite, Webpack, Rollup, or Browserify, look up Vite's library mode. |
* The Browserify artifact is being deprecated, scheduled for removal in the October 10th release cycle. ([\matrix-org#3189](matrix-org#3189)). * ElementR: Add `CryptoApi#bootstrapSecretStorage` ([\matrix-org#3483](matrix-org#3483)). Contributed by @florianduros. * Deprecate `MatrixClient.findVerificationRequestDMInProgress`, `MatrixClient.getVerificationRequestsToDeviceInProgress`, and `MatrixClient.requestVerification`, in favour of methods in `CryptoApi`. ([\matrix-org#3474](matrix-org#3474)). * Introduce a new `Crypto.VerificationRequest` interface, and deprecate direct access to the old `VerificationRequest` class. Also deprecate some related classes that were exported from `src/crypto/verification/request/VerificationRequest` ([\matrix-org#3449](matrix-org#3449)). * OIDC: navigate to authorization endpoint ([\matrix-org#3499](matrix-org#3499)). Contributed by @kerryarchibald. * Support for interactive device verification in Element-R. ([\matrix-org#3505](matrix-org#3505)). * Support for interactive device verification in Element-R. ([\matrix-org#3508](matrix-org#3508)). * Support for interactive device verification in Element-R. ([\matrix-org#3490](matrix-org#3490)). Fixes element-hq/element-web#25316. * Element-R: Store cross signing keys in secret storage ([\matrix-org#3498](matrix-org#3498)). Contributed by @florianduros. * OIDC: add dynamic client registration util function ([\matrix-org#3481](matrix-org#3481)). Contributed by @kerryarchibald. * Add getLastUnthreadedReceiptFor utility to Thread delegating to the underlying Room ([\matrix-org#3493](matrix-org#3493)). * ElementR: Add `rust-crypto#createRecoveryKeyFromPassphrase` implementation ([\matrix-org#3472](matrix-org#3472)). Contributed by @florianduros. * Aggregate relations regardless of whether event fits into the timeline ([\matrix-org#3496](matrix-org#3496)). Fixes element-hq/element-web#25596. * Fix bug where switching media caused media in subsequent calls to fail ([\matrix-org#3489](matrix-org#3489)). * Fix: remove polls from room state on redaction ([\matrix-org#3475](matrix-org#3475)). Fixes element-hq/element-web#25573. Contributed by @kerryarchibald. * Fix export type `GeneratedSecretStorageKey` ([\matrix-org#3479](matrix-org#3479)). Contributed by @florianduros. * Close IDB database before deleting it to prevent spurious unexpected close errors ([\matrix-org#3478](matrix-org#3478)). Fixes element-hq/element-web#25597.
* Drop support for Node 16 ([\matrix-org#3533](matrix-org#3533)). * Improve types around login, registration, UIA and identity servers ([\matrix-org#3537](matrix-org#3537)). * **The Browserify artifact is being deprecated, scheduled for removal in the October 10th release cycle. (matrix-org#3189)** * Simplify `MatrixClient::setPowerLevel` API ([\matrix-org#3570](matrix-org#3570)). Fixes element-hq/element-web#13900 and matrix-org#1844. * Deprecate `VerificationRequest.getQRCodeBytes` and replace it with the asynchronous `generateQRCode`. ([\matrix-org#3562](matrix-org#3562)). * Deprecate `VerificationRequest.beginKeyVerification()` in favour of `VerificationRequest.startVerification()`. ([\matrix-org#3528](matrix-org#3528)). * Deprecate `Crypto.VerificationRequest` application event, replacing it with `Crypto.VerificationRequestReceived`. ([\matrix-org#3514](matrix-org#3514)). * Throw saner error when peeking has its room pulled out from under it ([\matrix-org#3577](matrix-org#3577)). Fixes element-hq/element-web#18679. * OIDC: Log in ([\matrix-org#3554](matrix-org#3554)). Contributed by @kerryarchibald. * Prevent threads code from making identical simultaneous API hits ([\matrix-org#3541](matrix-org#3541)). Fixes element-hq/element-web#25395. * Update IUnsigned type to be extensible ([\matrix-org#3547](matrix-org#3547)). * add stop() api to BackupManager for clean shutdown ([\matrix-org#3553](matrix-org#3553)). * Log the message ID of any undecryptable to-device messages ([\matrix-org#3543](matrix-org#3543)). * Ignore thread relations on state events for consistency with edits ([\matrix-org#3540](matrix-org#3540)). * OIDC: validate id token ([\matrix-org#3531](matrix-org#3531)). Contributed by @kerryarchibald. * Fix read receipt sending behaviour around thread roots ([\matrix-org#3600](matrix-org#3600)). * Fix `TypedEventEmitter::removeAllListeners(void)` not working ([\matrix-org#3561](matrix-org#3561)). * Don't allow Olm unwedging rate-limiting to race ([\matrix-org#3549](matrix-org#3549)). Fixes element-hq/element-web#25716. * Fix an instance of failed to decrypt error when an in flight `/keys/query` fails. ([\matrix-org#3486](matrix-org#3486)). * Use the right anchor emoji for SAS verification ([\matrix-org#3534](matrix-org#3534)). * fix a bug which caused the wrong emoji to be shown during SAS device verification. ([\matrix-org#3523](matrix-org#3523)).
We expose a "browser version" of the js-sdk, which is a browserified version of the entire js-sdk. It's not very well documented, but it is mentioned at https://github.com/matrix-org/matrix-js-sdk#in-a-browser.
I think we should reconsider whether we want to continue to support this artifact, for several reasons:
--experimental-wasm-modules
), and jest (from v29.3) all support it natively. (There is wasmify, but I failed to get it to work and it gave a strong impression of being essentially unused.)Some background on the current E2EE support: the browserify bundle doesn't include libolm; instead, if you want to use E2EE, you need a separate
<script>
tag to load the libolm library (from the artifacts available in gitlab; libolm exposes both a two-file version using wasm and a single-file asm.js version). That means that the matrix-js-sdk doesn't have a hard dependency on libolm, with the consequences:I am keen to avoid these scenarios in the transition to Element R.
On the other hand, including all the E2EE code in the browserify bundle would bloat it significantly (see #3182).
For now, I have preserved the status quo by stubbing out the rust code altogether (#3187), but the upshot of that is - as I said earlier - if we do nothing, the browserify artifact is going to lose support for E2E encryption once we drop libolm.
One potential solution is to expose two browserify bundles - one with E2EE enabled, and one without. (Or, potentially, a main one and an auxilliary one). However, that would require a bit of work to create, document, and test, and it still leaves us with artifacts that are hard to test and - as above - I don't really think that browserify is the future.
The text was updated successfully, but these errors were encountered: