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

Extract LiteBuffer polyfill to a sperate rsocket-litebuffer package #112

Open
OlegDokuka opened this issue Dec 22, 2020 · 1 comment
Open
Assignees
Labels
breaking change enhancement Suggests, requests, or implements a feature or enhancement
Milestone

Comments

@OlegDokuka
Copy link
Member

Motivation

Currently, RSocket-Core implicitly brings a Buffer polyfill called LiteBuffer which is a minimalistic implementation of the Node Buffer and has a limited functionality surface to satisfy rsocket-js needs. Though it might be enough for us, for others it may be a limitation point that prevents implementing required business logic.

Desired solution

For that purpose, we have to separate LiteBuffer from the core to an external module and allow the user to bring the desired Buffer polyfill explicitly in the project dependencies

Additional context

For more info see #110

@freelancer1845
Copy link

Maybe for the 1.0 rewrite using UInt8Array and moving away from the Buffer api could be an option?

In #110 you mention that it increases complexity. But since the 1.0 rewrite is a effort to reduce the library to its core maybe it is worth the extra complexity (extra dependency in the browser vs a few bit operations?).
In the "dev" branch there are already functions like "readUInt24BE" defined so maybe the complexity is already there anyway?

Maybe not using the Buffer API would reduce compatibility problems in the future when the library is used in the browser.

Or are there other specific reasons, just for my personal interest :) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change enhancement Suggests, requests, or implements a feature or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants