Moving forward with v7, we've decided it's best to stop publishing the Stage presets in Babel (e.g. @babel/preset-stage-0
).
We didn't make this decision lightly and wanted to show the context behind the interplay between TC39, Babel, and the community.
Some History
A Babel preset is a sharable list of plugins.
The official Babel Stage presets tracked the TC39 Staging process for new syntax proposals in JavaScript.
Each preset (ex. stage-3
, stage-2
, etc.) included all the plugins for that particular stage and the ones above it. For example, stage-2
included stage-3
, and so on.
This allowed users who wanted to use experimental syntax to simply add the preset, instead of needing to configure/install each individual plugin.
We actually added the Stage presets shortly after Babel's v6 release (it was previously a config flag in v5). Shown below is an older example from Babel v6.
It was common to see this in a config:
{
"presets": ["es2015", "react", "stage-0"]
}
The original source of babel-preset-stage-0:
module.exports = {
presets: [
require("babel-preset-stage-1")
],
plugins: [
require("babel-plugin-transform-do-expressions"),
require("babel-plugin-transform-function-bind")
]
};