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

Add shared-brotli crate which provides a library for decoding shared … #1176

Merged
merged 2 commits into from
Oct 4, 2024

Conversation

garretrieger
Copy link
Contributor

…brotli patches.

Under the hood it's a small wrapper around brotlic-sys.

@garretrieger garretrieger requested a review from cmyr October 3, 2024 23:03
@garretrieger garretrieger force-pushed the shared_brotli branch 2 times, most recently from 53274b9 to 7a882df Compare October 3, 2024 23:08
…brotli patches.

Under the hood it's a small wrapper around brotlic-sys.
Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks broadly reasonable. If you anticipate needing to add more functionality in the future it might make sense to take a slightly more modular approach (like have a Decoder struct that wraps the decoder pointer) but if we really just need this one bit of functionality than this approach seems fine.

Since we'll have to publish this crate, I would be inclined to give it a more annoying & descriptive name, and we'll need to add a readme etc before publishing.

@garretrieger
Copy link
Contributor Author

This looks broadly reasonable. If you anticipate needing to add more functionality in the future it might make sense to take a slightly more modular approach (like have a Decoder struct that wraps the decoder pointer) but if we really just need this one bit of functionality than this approach seems fine.

Unless things change in the spec this should be all that's needed. The other patch type will also need Brotli decompression but it should be able to re-use this method as well.

Since we'll have to publish this crate, I would be inclined to give it a more annoying & descriptive name, and we'll need to add a readme etc before publishing.

Sounds good.

@cmyr
Copy link
Member

cmyr commented Oct 4, 2024

Since we'll have to publish this crate, I would be inclined to give it a more annoying & descriptive name, and we'll need to add a readme etc before publishing.

Sounds good.

To clarify my 'annoying name' point; I mean this is very unlikely to be useful to anyone but us, and so I'd name it something like brotli-shared-data-decode and make clear in the readme that it has a very limited scope that is not expected to expand. Just my two cents though!

@garretrieger garretrieger force-pushed the shared_brotli branch 2 times, most recently from 0f81a25 to ca99c33 Compare October 4, 2024 20:52
@garretrieger garretrieger merged commit d0021c8 into main Oct 4, 2024
10 checks passed
@garretrieger garretrieger deleted the shared_brotli branch October 4, 2024 20:59
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.

2 participants