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

refactor: improvements to usage and browser compat #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

retrixe
Copy link

@retrixe retrixe commented Apr 29, 2024

I encountered several possible improvements while using this library in a React Native application, which I've decided to upstream (read commit messages for information).

This library is missing support for the newer anonymous NBT in 1.20.2+ which I just worked around on my side like so: https://github.com/retrixe/EnderChat/blob/809ff691c0fa39e8def7e831aa3d2d3184e0950d/src/minecraft/utils.ts#L182 I don't have the energy to work on it properly myself, so proper support is not part of this PR.

Side notes:

  • Personally, I would break the API and remove fs/zlib entirely but I've left that decision up to you
  • It may be preferable to rebase and merge this PR to preserve the commit history

Any Buffer polyfill should be bundled by consumers instead, so we don't
unnecessarily increase bundle sizes if they already have a Buffer impl.
This can be polyfilled on any JS platforms missing BigInt support.
This removes unnecessary callbacks for synchronous consumers.
Since it is optional, existing code will continue to work fine.
This allows users to shrink bundle sizes by marking them as externals.

I would prefer to do away with these entirely to shrink the library, but
I've only opted to do this much for now.
@retrixe retrixe changed the title Various refactoring commits refactor: improvements to usage and browser compat May 5, 2024
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