Conversation
0599f13 to
d7297cb
Compare
We expose an ES module version of the library for module bundlers to use, and generate a CommonJS version for Node. The motivation is that, for [1] I want to re-export this library from ably-js as a tree-shakable module. Tree-shakability requires that we use ES modules. I’ve output the Node bundle to a new `build` directory, since I don’t know whether the `dist` directory has some special meaning for the `ably-env deploy` script and so didn’t want to put non-CDN stuff in there. The version of Node that the README tells us to use does not support ES modules, so we generate a CommonJS bundle for the tests to use, which includes all of the internal components so that they can be tested. I tested these changes for regressions by: 1. running `npm run grunt -- test:node` 2. running `npm run grunt -- test:browser:local` 3. generating an NPM package using `npm pack`, installing it in ably-js, and running the delta tests there [1] ably/ably-js#1492
Motivation as in 9d8aeb8, and tested in the same way. I don’t know exactly _what_ about the non-class way of doing things made it not be tree-shakable; I can only speculate that it was the `.prototype.foo = ...` statements. The update to Babel is because the version we were using didn’t support class fields.
Motivation as in 9d8aeb8.
d7297cb to
0fd945b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.