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

Investigate reducing package size #13

Open
coderintherye opened this issue Aug 23, 2019 · 1 comment
Open

Investigate reducing package size #13

coderintherye opened this issue Aug 23, 2019 · 1 comment

Comments

@coderintherye
Copy link

"The package size is a bit chunky due to the CBOR implementation (80KB),
but we can get that down over time given enough cycles to remove the
unnecessary node.js Buffer polyfills that the CBOR implementation required."

This issue is to investigate what changes can be made to reduce package size and then spin those out into individuals issues to implement with code changes. Chief among them would be what Manu pointed out as the CBOR implementation size being large due to polyfills. It might be helpful to indicate which versions of modern browsers this is targeting in order to understand which polyfills are necessary. However, perhaps it is possible to just produce a CBOR implementation that doesn't require polyfills for modern browsers?

@davidlehn
Copy link
Member

The main issue is that most of the modern up-to-date CBOR packages are using Node.js Buffers. That requires a polyfill in browsers. Ideally, they would be using TypedArray features (Uint8Array, etc) that are natively supported in Node.js and browsers. Porting one of the libs to use TypedArrays is possible, it'll just take some time.

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

No branches or pull requests

2 participants