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 Bun support #43

Merged
merged 2 commits into from
Jan 4, 2024
Merged

Add Bun support #43

merged 2 commits into from
Jan 4, 2024

Conversation

Jarred-Sumner
Copy link
Contributor

This adds a "bun" package.json "exports" condition which loads the browser build in Bun.

Bun implements the Web API Worker natively, and Bun's node:worker_threads implementation internally wraps the Web API Worker.

web-worker currently loads the polyfills for Node in Bun (since we must recognize the "node" package.json "exports" condition for compatibility).

This has actually been pretty helpful for catching bugs in our node:worker_threads implementation, but it'd be better for our users to use the native implementation instead of wrapping the native implementation in another wrapper (node:worker_threads) in another wrapper (web-worker)

This adds a `"bun"` package.json `"exports"` condition which loads the browser build in Bun.

Bun implements the [Web API `Worker` natively](https://bun.sh/docs/api/workers), and Bun's `node:worker_threads` implementation internally wraps the Web API `Worker`.  

`web-worker` currently loads the polyfills for Node in Bun (since we must recognize the `"node"` package.json `"exports"` condition for compatibility). 

This has actually been pretty helpful for catching bugs in our `node:worker_threads` implementation, but it'd be better to use the native implementation instead of wrapping the native implementation in another wrapper (`node:worker_threads`) in another wrapper (`web-worker`)
@developit developit merged commit fe7acab into developit:main Jan 4, 2024
2 checks passed
@developit
Copy link
Owner

Thanks for the PR - I just released it as 1.3.0.

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