Skip to content

Conversation

@JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Sep 11, 2025

Docs PR for babel/babel#17078.

Closes #3044

Closes #3132

@netlify
Copy link

netlify bot commented Sep 11, 2025

Deploy Preview for babel-next ready!

Name Link
🔨 Latest commit 536b2c0
🔍 Latest deploy log https://app.netlify.com/projects/babel-next/deploys/68c2ef8333d064000861b7eb
😎 Deploy Preview https://deploy-preview-3129--babel-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Sep 11, 2025

Deploy Preview for babel ready!

Name Link
🔨 Latest commit 536b2c0
🔍 Latest deploy log https://app.netlify.com/projects/babel/deploys/68c2ef830d9f9f00085b67aa
😎 Deploy Preview https://deploy-preview-3129--babel.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

- `include` and `exclude` respect renamed package names ([#15576](https://github.com/babel/babel/pull/15576))

**Migration**: If `includes` or `excludes` contain any plugins mentioned in the [Packages Renames section](./v8-migration.md#renamed-packages), change it to the new name. For example,
**Migration**: If `include` or `exclude` contain any plugins mentioned in the [Packages Renames section](./v8-migration.md#renamed-packages), change it to the new name. For example,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously I made typos in the include and exclude options, they have also been fixed in this PR.

**Migration**: You will probably be fine with the new behaviour as Babel now tries to compile the broken syntax to the closest _non-broken modern syntax_ supported by your target browsers.

- Removed syntax plugins can not be used in `includes` and `excludes` ([#15810](https://github.com/babel/babel/pull/15810))
If anyhow you want to restore the Babel 7 behaviour for debug purpose, you can specify the [`exclude` option](./preset-env.md#exclude): `{ exclude: [/bugfix/] }` to explicitly exclude the bugfixes plugins. Note that doing so will bloat the output as Babel has to compile features to older targets.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will disabling the bugfix cause the output to become larger?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, for example, given the input

var a;
a?.b

with target chrome: 90,
the output with { bugfixes: true } is

var a;
a?.b;

whereas the output with { bugfixes: false } is

var a;
a === null || a === void 0 ? void 0 : a.b;

**Migration**: You will probably be fine with the new behaviour as Babel now tries to compile the broken syntax to the closest _non-broken modern syntax_ supported by your target browsers.

- Removed syntax plugins can not be used in `includes` and `excludes` ([#15810](https://github.com/babel/babel/pull/15810))
If anyhow you want to restore the Babel 7 behaviour for debug purpose, you can specify the [`exclude` option](./preset-env.md#exclude): `{ exclude: [/bugfix/] }` to explicitly exclude the bugfixes plugins. Note that doing so will bloat the output as Babel has to compile features to older targets.
Copy link
Contributor Author

@JLHwung JLHwung Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If anyhow you want to restore the Babel 7 behaviour for debug purpose, you can specify the [`exclude` option](./preset-env.md#exclude): `{ exclude: [/bugfix/] }` to explicitly exclude the bugfixes plugins. Note that doing so will bloat the output as Babel has to compile features to older targets.
If anyhow you want to restore the Babel 7 behaviour for debug purpose, you can specify the [`exclude` option](./preset-env.md#exclude): `{ exclude: [/bugfix/] }` to explicitly exclude the bugfixes plugins. Note that doing so will bloat the output as Babel has to compile general available language features even if they might not be affected by the browser quirk.

Does the revised wording clarify why the output might be bloated?

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.

Conflicting documentation about preset-env's bugfixes option in v8 migration Docs for "[babel 8] Remove bugfixes option"

2 participants