Skip to content

Remove @babel/plugin-transform-property-mutators#17882

Merged
nicolo-ribaudo merged 2 commits into
babel:mainfrom
liuxingbaoyu:remove-plugin-transform-property-mutators
Mar 19, 2026
Merged

Remove @babel/plugin-transform-property-mutators#17882
nicolo-ribaudo merged 2 commits into
babel:mainfrom
liuxingbaoyu:remove-plugin-transform-property-mutators

Conversation

@liuxingbaoyu
Copy link
Copy Markdown
Member

@liuxingbaoyu liuxingbaoyu commented Mar 18, 2026

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link babel/website#3189
Any Dependency Changes?
License MIT

It converts {get x(){}} to Object.defineProperties, but get was supported by browsers earlier.

@liuxingbaoyu liuxingbaoyu added PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release PR: Needs Docs labels Mar 18, 2026
@babel-bot
Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/61207

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 18, 2026

Open in StackBlitz

commit: 469bfda

Copy link
Copy Markdown
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

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

This plugin debuted in 6.0.0 as babel-plugin-transform-es5-property-mutators.

I guess the intention of this plugin is to transform the ES5 get/set to ES3, with the merely hope that Object.defineProperties, when polyfilled by core-js, can run on ES3 environments, such that get/set does not produce a syntax error. But unfortunately there is no magic to polyfill getter/setter on IE8, core-js just throws a better error when { get: function() {} } is passed.

Therefore this plugin is not really very helpful and maybe that's why it is not included in the preset-env, I agree that we should remove this plugin from Babel 8.

With that said, could you also open a PR to the babel-archive repo?

@nicolo-ribaudo
Copy link
Copy Markdown
Member

Merging, but please submit the docs PR and add it to the archive!

@nicolo-ribaudo nicolo-ribaudo merged commit c2d8878 into babel:main Mar 19, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release PR: Needs Docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants