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

Use Streams API instead of openpgp/web-stream-tools #5872

Open
sosnovsky opened this issue Nov 25, 2024 · 8 comments
Open

Use Streams API instead of openpgp/web-stream-tools #5872

sosnovsky opened this issue Nov 25, 2024 · 8 comments
Assignees

Comments

@sosnovsky
Copy link
Collaborator

          We are currently using the `@openpgp/web-stream-tools` library for streaming because the native Streams API doesn't support functions like `readToEnd`, which is utilized in our project.

We could implement our own readToEnd function instead.

I think we might be able to completely remove the dependency on @openpgp/web-stream-tools.

Would you like me to explore this?

Also, should I address this in the current PR or create a separate one?

Originally posted by @ioanmo226 in #5866 (comment)

@sosnovsky sosnovsky added this to the 8.5.8 milestone Nov 25, 2024
@ioanmo226
Copy link
Collaborator

ioanmo226 commented Nov 26, 2024

While migrating the logic to use the native Streams API, I discovered that it’s impossible to completely eliminate @openpgp/web-stream-tools unless the openpgp library itself is updated.

This is because the openpgp library internally relies on @openpgp/web-stream-tools for typing.

Let me know your thoughts.

image

@sosnovsky
Copy link
Collaborator Author

This dependency is listed in openpgpjs package.json - https://github.com/openpgpjs/openpgpjs/blob/main/package.json#L71, so probably we can remove it from our package.json and then it'll be used only internally by openpgpjs while we'll be using Streams API, will it work this way?

@ioanmo226
Copy link
Collaborator

Hmm.. I don't think so

image

@ioanmo226
Copy link
Collaborator

When I try to build project, node_modules openpgp type complains about @openpgp-web-stream-tools not installed

@ioanmo226
Copy link
Collaborator

ioanmo226 commented Nov 26, 2024

The OpenPGP library heavily relies on the @openpgp/web-stream-tools package for typing. When implementing the readToEndNative function, we need to use the types provided by @openpgp/web-stream-tools.

@ioanmo226
Copy link
Collaborator

@sosnovsky What do you think?

@sosnovsky
Copy link
Collaborator Author

Then let's stick with @openpgp/web-stream-tools for now, as it seems to be more complicated than I've expected. Thanks for checking!

@sosnovsky sosnovsky modified the milestones: 8.5.8, Second priority Nov 26, 2024
@ioanmo226
Copy link
Collaborator

Got it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants