bun
bun copied to clipboard
Breaking changes for Bun 1.2
This is a tracking issue for behaviour changes we want to introduce in Bun 1.2.
- https://github.com/oven-sh/bun/issues/12180
should we consider https://github.com/oven-sh/bun/issues/4464
there are some existing breaking changes behind compile time feature flags. these can be inspected by doing a code search for breaking_changes_1_2
- websocket server:
ws.subscribe()function will require a string argument - bundler:
--sourcemapwithout an argument is going to default tolinkedinstead ofinline - bundler: imports marked external with a second argument will no longer hide that second value (this is done for some backwards compatibility that i want to remove)
logging this here
- make
Bun.builda rejected promise on failure. people continue to run into this footgun that a failing build returns an object withsuccess: false, especially when examples do not check the success code.
Another change we should consider: bun -p shorthand for --print. Currently it is --port.
https://github.com/oven-sh/bun/issues/14223
- https://github.com/oven-sh/bun/issues/8125
"what this needs is --env-prefix so you can do the
--env-prefix=VITE_PUBLIC_"
Consider making custom inspect function exception's better
Context:
When a custom inspect function threw an exception, Bun would return
[native code]. This was confusing. We wish we could change this to throw an error, but that would be a breaking change. Instead, we've made it print[custom formatter threw an exception]instead, which is slightly better but not what we'd prefer. In a future version of Bun, we will change this to throw an error but we do not want your code to potentially randomly break in a minor version update. https://bun.sh/blog/bun-v1.1.7#fixed-custom-inspect-exception
Edit: this is already fixed in https://github.com/oven-sh/bun/pull/16009
- Bun.build will add the condition "development" when NODE_ENV is not development. This allows
esm-env(used by svelte) to use the correct variable. Bake already does this.
See what we changed in Bun 1.2.