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

fix: remove platform-specific uuid code to prevent bundler errors #33

Merged
merged 2 commits into from
May 9, 2024
Merged

fix: remove platform-specific uuid code to prevent bundler errors #33

merged 2 commits into from
May 9, 2024

Conversation

EisenbergEffect
Copy link
Contributor

Description

The Web Crypto API is available in all browsers, Node.js, and Deno. This PR assumes that covers the majority of the environments where this polyfill will be used. A simple semi-random v4 formatted string is provided for all other cases. These changes reduce the code and complexity, and should resolve bundler errors stemming from the platform-specific imports and top-level awaits that have now been removed.

Issues

Notes

I had trouble getting things setup on my machine, so I haven't run the tests, though I was able to build at some point along the way. I am currently relying on CI to tell me if I broke anything.

Checklist

Next Steps

Once some version of this PR is fixed, I'll follow up with a second PR to address the JSON parse ocde also reference in #32.

The Web Crypto API is available in all browsers, Node.js, and Deno. This PR assumes that covers the majority of the environments where this polyfill will be used. A simple semi-random v4 formatted string is provided for all other cases. These changes reduce the code and complexity, and should resolve bundler errors stemming from the platform-specific imports and top-level awaits that have now been removed.
@EisenbergEffect
Copy link
Contributor Author

Thanks for the fix @fabiancook! I wasn't aware that the Node implementation of randomUUID was unbound.

@fabiancook fabiancook merged commit 50295d2 into virtualstate:main May 9, 2024
5 checks passed
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