Let's remove outdated @babel/plugin-proposal-xxx
in modern
build?
#36794
Labels
core
Infrastructure work going on behind the scenes
dependencies
Update of dependencies
enhancement
This is not a bug, nor a new feature
Duplicates
Latest version
Summary 💡
In a word, some
@babel/plugin-proposal-xxx
inbabel.config.js
maybe outdated and should be removed.Docs said "the
modern
folder targets the latest released versions of evergreen browsers".However I found the rest property (like
const { a, ...others } = obj
) inmodern
build is also transpiled to use babel's polyfill (_objectWithoutProperties(xxx)
). See modern/Accordion in unpkg.This's because of:
material-ui/babel.config.js
Lines 65 to 70 in 9f5ae34
These code was written 3 years ago, at that time these syntaxes were still in the proposal stage.
In babel's docs of object-rest-spread plugin, "This plugin is included in
@babel/preset-env
, in ES2018" (and some others were included in ES2021 or 2022). So I try to remove these line of code. The output is satisfied, without polyfill. Certainly, thenode
andlegacy
build, was not changed.Examples 🌈
No response
Motivation 🔦
Smaller bundle size & better performance on modern platform.
The text was updated successfully, but these errors were encountered: