New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Babel 8 Release Plan #10746
Comments
will this allow to generate .d.ts files? |
@TrejGun It is totally unrelated I think. I'd be happy to hear more about it on our Slack! |
Will 8.x be faster than 7.x when building my own project? |
No. Version 8.0 will only contain breaking changes, so if there are any performance improvements that we can make they will also be included in 7.x. |
I would like to propose a breaking change. I believe that +"use strict";
+exports.__esModule = true;
+exports.default = _toPropertyKey;
-var _typeof = require("../helpers/typeof");
+var _typeof = require("../helpers/typeof").default;
-var toPrimitive = require("./toPrimitive");
+var toPrimitive = require("./toPrimitive").default;
function _toPropertyKey(arg) {
var key = toPrimitive(arg, "string");
return _typeof(key) === "symbol" ? key : String(key);
}
-module.exports = _toPropertyKey; With such ESM-compatible output we could try to explore removing helpers/toPropertyKey/package.json
helpers/toPropertyKey/toPropertyKey.js
helpers/toPropertyKey/toPropertyKey.mjs with {
"name": "@babel/runtime/helpers/toPropertyKey",
"private": true,
"type": "module",
"main": "./toPropertyKey.cjs.js",
"module": "./toPropertyKey.js",
"exports": {
".": {
"require": "./toPropertyKey.cjs.js",
"default": "./toPropertyKey.js"
}
}
} |
@babel/preset-env using core-js@2 by default. Can @bable/preset-env@8 using core-js@3 only? |
Yeah, this is a good idea! |
Yes, |
Why it should be dropped - copy-paste from the draft of one post:
|
As planned in babel/babel#10746, in babel 8 the old `loadPartialConfig` can't be used synchronously.
…abel 8 (#5133) * refactor: use babel.loadPartialConfigSync (added in babel 7.8) As planned in babel/babel#10746, in babel 8 the old `loadPartialConfig` can't be used synchronously. * refactor: remove dependence on internal babel files, preparing for babel 8 See babel/babel#10746 babel/babel#10899
We should upgrade core-js@2 to core-js@3 because the (1) the next major release of Babel will do so, and (2) there are many V8 de-optimizations in core-js@2 that have been fixed in core-js@3. See: babel/babel#10746 (comment) See: babel/babel#10746 (comment) See: https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md We also bumped Babel to 7.8.4 because it was only after 7.4 that core-js@3 was supported. See: https://babeljs.io/blog/2019/03/19/7.4.0#core-js-3-7646-https-githubcom-babel-babel-pull-7646
Hey. I would love to contribute to Babel 8. What are some easy features I can work on? I think I can work on :-
Are there any other issues I can contribute to and help? |
Another good one could be #9546, which would give you the chance to dig into If you want to work on the |
Shoud I just delete the given functions? Or am I misunderstanding the requirements? |
Currently they behave asynchronously if you pass them a callback, otherwise they behave synchronously. Only the callback-based version should be allowed. |
…abel 8 (vuejs#5133) * refactor: use babel.loadPartialConfigSync (added in babel 7.8) As planned in babel/babel#10746, in babel 8 the old `loadPartialConfig` can't be used synchronously. * refactor: remove dependence on internal babel files, preparing for babel 8 See babel/babel#10746 babel/babel#10899
This comment has been minimized.
This comment has been minimized.
Would be nice to know when we can expect Babel 8. The OP says that it'll come out in 2020, but the year is soon coming to a close and there's no news yet. |
Who else is pumped for the |
@fabis94 Sorry for the lack of communication about a precise schedule. My hope is to release Babel 8 alongside with 7.13 (so in about 2 months), since there isn't much left to do. However, please don't take this as an hard deadline since anything could happen 🙏 @WillBeebe Starting from Babel 7.12.0, it will use |
Any updates regarding this? |
Yes! |
One more thing that's always bugged me: we should rename |
No need to wait for Babel 8, we can add an alias now. |
Would you mind updating the current progress of the task list? Some of them seem to have already been solved. |
So in order to play around with where things are at, will a @next or ^7.15 bring me the closest? |
7.15 has been published but it will not contain Babel 8 breaking changes, as required by semver. We don't have Babel 8 nightly build, but we have Babel 8 e2e test on popular libraries: Line 131 in 614b486
|
Thanks! Long time since I last build Babel myself. Let's see the dev contributor experience nowadays :) |
Should it be updated to |
Yes thanks, we are a few years late with this release! 🙃 (If it takes another year we can also drop Node.js 14 👀) |
I hate to be that guy, and I know that ultimately a release is ready when it's ready, but given the timeframe here can we get an update on where things stand? The Babel Roadmap page hasn't been updated since 2021 (at which point there was a note about how long it had already been taking and how the release was "closer than ever"). |
Friendly bump on the question above. |
Hate to state the obvious, but the best thing you can do to help issues like this is getting your employer - or yourself - to sponsor and otherwise contribute to open source. Many crucial open source projects - such as Babel - are developed by volunteers in their spare time, while large corporations and startups alike incorporate them into their commercial products without ever giving anything back. I am actively working in my organisation to get that changed, and I hope others will too. |
I guess Node 14 support can be dropped... |
Now that 8 would be released in 2023, could dropping Flow, IE, and pre-ES2015 support be done?
|
Before this is out the gate, Node 16 will be well passed it's EOL as well https://nodejs.org/en/blog/announcements/nodejs16-eol |
Thanks for the reminder :) |
We plan to release a new major version in 2024 (milestone).
This release won't have all the migration pain which there was while migrating from Babel 5 to Babel 6 and then from Babel 6 to Babel 7. We plan to only make a few breaking changes, and provide an easy migration strategy for each of them. Because of this, you won't see ~80 prereleases like we did in for Babel 7.0.0, but we plan to only release a few of them.
Babel 8.0.0 will only contain breaking changes: we will release a minor version the same day, containing all the bug fixes and new features that would otherwise be released in 8.0.0.
This document is still a work in progress, but you can already start by applying the suggested migration strategies to your own codebase.
Note for maintainers: release workflow
main
branchmake new-babel-8-version
, which will:package.json#version_babel8
package.json#version_babel8
, and commit it tomain
release/${version}
branchyarn release-tool version ${version} --all
in that branch, to update the version of every package to the new pre-releasemain
,release/${version}
and the newv${release}
tag tobabel/babel
Then, the
release
GH workflow will start running on the new tag and publish it to npm.Compilation breaking changes
Don't remove uninitialized class fields when using Flow/TS (pr for flow: #10120, pr for TS: #11114)
Area: Flow and TypeScript transforms
Impact: High (only for flow and TypeScript users)
Migration:
You can use the new
declare
syntax, introduced in TypeScript 3.7 (Babel 7.7) and in Flow 0.120 (Babel 7.9), if you don't want fields to be initialized toundefined
:Note that while this syntax is enabled by default in
@babel/parser
when using thetypescript
orflow
plugins, if you are using Babel to remove type annotations you must enable theallowDeclareFields
option:Disallow sequence expressions inside JSX attributes (pr: #8787)
@babel/parser
Disallow
}
and>
in JSX text (pr: feat(babel-parser): throw syntax error for}
and>
in JSX text #11046)@babel/parser
with JSX{'}'}
and{'>'}
instead.Transforms JSX spread properties using object spread (pr: #11141, docs: website#2289)
useSpread
option in Babel 7.7.0. If your code needs to run in an environment which doesn't support object spread, you can either use@babel/preset-env
(recommended) or@babel/plugin-proposal-object-rest-spread
. If you want to transpileObject.assign
down to Babel's_extends
helper (which is the current default behavior) you also need to enable@babel/plugin-transform-object-assign
.Use the new JSX implementation by default (pr: #11436, docs: website#2289)
runtime: "classic"
option to@babel/preset-react
or@babel/plugin-transform-react-jsx
to be explicit about your usage ofcreateElement
(or the equivalent function in other libraries).If you are using a modern enough version of React or Preact, you can already use the new
runtime: "automatic"
implementation.Parse JSX elements when both the JSX and TS plugins are enabled, and throw an error when both Flow and TS are enabled (pr: #11316)
<Foo>
to be parsed as a JSX element, but as a TypeScript typecast, you can disable the JSX plugin.isTSX
option of the TypeScript plugin. We are also removing this option. We think that having the JSX plugin control JSX parsing is less confusing for our users.Remove
moduleAttributes
support (pr: #13308)@babel/plugin-syntax-module-attributes
by@babel/plugin-syntax-import-assertions
: you can already start doing this in Babel 7. After you replace the plugin, you should search the following patterns in your codebaseand replace them by
If you are not using
@babel/plugin-syntax-module-attributes
, you don't need to do anything.Remove support for the 2018-09 decorators proposal (pr: #12712)
@babel/plugin-proposal-decorators
"version": "2021-12"
option of@babel/plugin-proposal-decorators
.Configuration breaking changes
@babel/plugin-proposal-dynamic-import
when transformingimport()
to SystemJS (#12700)@babel/plugin-transform-modules-systemjs
@babel/plugin-proposal-dynamic-import
to your config: you can already do it in Babel 7. If you are using@babel/preset-env
, you don't need to do anything.transform-modules-commonjs
andtransform-modules-amd
) require the separate plugin since it was introduced. We couldn't change it fortransform-modules-systemjs
because that package did already support dynamic import.defaults, not ie 11
as default targets@babel/preset-env
targets
or have a.browserslist
config file, this change won't affect you. Otherwise, you'll probably be fine with the new behavior (which supports these modern browsers). Note that the default targets does not include IE. If you still need to support IE, please specifyIE 11
intargets
. If you need to enable every possible plugin for even older browsers, you can already enable theforceAllTransforms
option.uglify
target (pr: #10895, docs: website#2290)@babel/preset-env
uglifyjs
target had been deprecated since 7.0.0-beta.0, if you still need this, you can enable theforceAllTransforms
option.@babel/core
#12724)@babel/core
,@babel/cli
,@babel/plugin-transform-modules-amd
,@babel/plugin-transform-modules-umd
,@babel/plugin-transform-modules-systemjs
If you are passing these options using the cli, you'll need to create a configuration file.
core-js
2 (pr: #11751)@babel/preset-env
,@babel/plugin-transform-runtime
,@babel/compat-data
core-js@3
. Don't forget tonpm install
it!useBuiltIns
is enabled, the defaultcore-js
version is now3.6
instead of2
core-js@2
support, you can usebabel-plugin-polyfill-core-js2
.version
option to thedecorators
plugins, and merge the two plugins in@babel/parser
.@babel/preset-typescript
,@babel/preset-flow
,@babel/plugin-transform-typescript
,@babel/plugin-transform-flow-strip-types
overrides
option (this is not necessary if you are using the presets, and not directly the plugins)isTSX
option from@babel/preset-typescript
and instead enable the relevant JSX preset/plugin.API breaking changes
babel.transform
,babel.transformFile
,babel.transformFromAst
,babel.parse
,babel.loadOptions
andbabel.loadPartialConfig
synchronously (pr: #11110, #12695)@babel/core
babel.transformSync
,babel.transformFromAstSync
andbabel.transformFileSync
, supported since version 7.0.0.babel.parseSync
,babel.loadOptionsSync
andbabel.loadPartialConfigSync
will be introduced in v7.8.0.TSParenthesizedType
unlesscreateParenthesizedExpression
is enabled (pr: #11200)@babel/parser
createParenthesizedExpression
parser option (supported since Babel 7.4.0)t.jSX*
andt.tS*
builder aliases (pr: #6993)@babel/types
t.jsx*
andt.ts*
instead, which have been supported since Babel 7.0.0t.identifier
builder (#10917)@babel/types
metro
bundler as of Nov 2019 (#10645)jsonCompatibleStrings
generator option (pr: #9958)@babel/generator
@babel/generator
allows to specify options for jsesc, the library used to escape printed values.If you are using the
jsonCompatibleStrings
option, you can replace it withjsescOption: { json: true }
.useBuiltIns: 0
when transforming JSX (pr: #12460, #12741, #12751)@babel/plugin-transform-react-jsx
,@babel/preset-env
useBuiltIns: false
instead.AST breaking changes
Use an identifier for
TSTypeParameter.name
(#12829)@babel/parser
TSTypeParameter
, e.g. theT
infunction f<T>() {}
node
,node.name
is a string in Babel 7 while in Babel 8 it is anIdentifier
name
of a type parameternode
, usenode.name.name
in Babel 8.Rename
parameters
toparams
,typeAnnotation
toreturnType
forTSCallSignatureDeclaration
,TSConstructSignatureDeclaration
,TSFunctionType
,TSConstructorType
andTSMethodSignature
(#9231) (pr: #13709)
@babel/parser
node.parameters
in Babel 7, usenode.params
in Babel 8node.typeAnnotation
in Babel 7, usenode.returnType
in Babel 8Misc breaking changes
@babel/core
to^8.0.0
@babel/*
packageESM runtime helper files should have the .mjs extension
(EDIT: we now use"type": "module"
)@babel/runtime
,@babel/runtime-corejs2
,@babel/runtime-corejs3
.js
modules don't work with nativeimport
unless ourpackage.json
specifiestype: "module"
(which will break cjs helpers).@babel/runtime
@babel/runtime
,@babel/runtime-corejs2
,@babel/runtime-corejs3
@babel/runtime
7.x with@babel/plugin-transform-runtime
8.x (or the other way around), which woudln't be supported anyway.vue-cli
(cc @sodatea) andember-cli-babel
[2] (cc @rwjblue). We will providetargets-parser
as a separate helper in v7.8.0.@babel/generator
babel.transform
API and your server is not serving js files in theutf8
encoding.@babel/cli
, WebPack, Rollup, create-react-app or other Node.js powered bundlers, the transformed code is always encoded withutf-8
. That said, this issue probably won't affect your app.utf8
encoding. If you can not control the server output, use<script charset="utf-8" src="your-app.js"></script>
in the html files. You may also restore to the Babel 7 behaviour by@babel/parser
error.code
isOptionalBindingPattern
.error.code
forOptionalBindingPattern
is renamed asPatternIsOptional
.Other possibly breaking changes
@babel/plugin-transform-typescript
NodePath
s to be requeued (pr: #13291)@babel/traverse
@babel/plugin-transform-block-scoping
Related: #10752
Note for contributors
~~We implement Babel 8 breaking changes under the
BABEL_8_BREAKING
env flag. To test the breaking changes, please duplicate the affected tests with the-babel-7
suffix and addBABEL_8_BREAKING: false
to test options. The breaking changes will be merged to themain
branch but stripped before publishing. ~~The text was updated successfully, but these errors were encountered: