bun icon indicating copy to clipboard operation
bun copied to clipboard

Breaking changes for Bun 1.2

Open Electroid opened this issue 1 year ago • 2 comments

This is a tracking issue for behaviour changes we want to introduce in Bun 1.2.

  • https://github.com/oven-sh/bun/issues/12180

Electroid avatar Jun 26 '24 16:06 Electroid

should we consider https://github.com/oven-sh/bun/issues/4464

paperclover avatar Jun 27 '24 10:06 paperclover

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: --sourcemap without an argument is going to default to linked instead of inline
  • 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)

paperclover avatar Jul 17 '24 03:07 paperclover

logging this here

  • make Bun.build a rejected promise on failure. people continue to run into this footgun that a failing build returns an object with success: false, especially when examples do not check the success code.

paperclover avatar Oct 10 '24 01:10 paperclover

Another change we should consider: bun -p shorthand for --print. Currently it is --port. https://github.com/oven-sh/bun/issues/14223

dylan-conway avatar Oct 10 '24 01:10 dylan-conway

  • https://github.com/oven-sh/bun/issues/8125 "what this needs is --env-prefix so you can do the --env-prefix=VITE_PUBLIC_"

RiskyMH avatar Oct 12 '24 02:10 RiskyMH

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

RiskyMH avatar Nov 11 '24 12:11 RiskyMH

  • 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.

paperclover avatar Nov 27 '24 23:11 paperclover

See what we changed in Bun 1.2.

Electroid avatar Jan 22 '25 16:01 Electroid