Skip to content
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

Drop js dependencies and build tools #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ruuda
Copy link
Collaborator

@ruuda ruuda commented Jun 14, 2020

This adds a few lines of JavaScript to handle base64url encoding and decoding of the array buffers that the browser returns/expects, so we can convert to the json format that the server expects.

Previously this used a third-party library, but that requires bringing in Yarn and Packer to manage this, which results in a transitive dependency on almost 600k lines of JavaScript (excluding blank lines and comments) and another 9k lines of TypeScript.

By implementing the conversion by hand, we reduce the footprint of the example by:

  • Dropping the 64 MB node_modules directory.
  • Reducing the size of the dev dependencies Nix closure by 100 MB.
  • Removing the 6.4 seconds required to run Yarn initially (on my laptop with nvme ssd).
  • Removing the 4.3 seconds required to run Parcel initially (on my laptop with nvme ssd).

@arianvp mentioned it would be good to keep the third-party base64 encoder/decoder as an option, for people who care more about the ease of use of the example, than about the total footprint. I’ll look into restoring the Yarn/Packer workflow as an option.

This adds a few lines of JavaScript to handle base64url encoding and
decoding of the array buffers that the browser returns/expects, so we
can convert to the json format that the server expects.

Previously this used a third-party library, but that requires bringing in
Yarn and Packer to manage this, which results in a transitive dependency
on almost 600k lines of JavaScript (excluding blank lines and comments)
and another 9k lines of TypeScript.

By implementing the conversion by hand, we reduce the footprint of the
example by:

 * Dropping the 64 MB node_modules directory.
 * Reducing the size of the dev dependencies Nix closure by 100 MB.
 * Removing the 6.4 seconds required to run Yarn initially.
 * Removing the 4.3 seconds required to run Parcel initially.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant