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

Avoid bundling unnecessary crypto library for the browser #8329

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

Conversation

je-l
Copy link

@je-l je-l commented Feb 7, 2025

Currently, Nightscout bundles a port of Node.js crypto module (crypto-browserify), which is unnecessary. Nightscout is only using the provided hash functions, which can be accessed directly from the sha.js subdependency of crypto-browserify. bundle.app.js compressed size is reduced from 614KB to 469KB. Largest contentful paint is about 10% faster.

Reduces bundle size by approx 0.5MB.

crypto-browserify uses sha.js dependency, use sha.js directly.
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