Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd browserslist 4 support. #8509
Conversation
This comment has been minimized.
This comment has been minimized.
Yeap, I highly recommend to include this PR to 7.0. People complained about the current behavior (merging |
This comment has been minimized.
This comment has been minimized.
Did you add |
This comment has been minimized.
This comment has been minimized.
In case we don't merge this before Friday, would it be possible to remove (or workaround) the breaking change? |
This comment has been minimized.
This comment has been minimized.
@nicolo-ribaudo it is possible, but will be bad for users. Merging behavior is what is expected (and how other tools do it). |
This comment has been minimized.
This comment has been minimized.
I added Let’s remove Can release it just after you will approve the query. |
This comment has been minimized.
This comment has been minimized.
Sounds awesome @ai |
"targets": { | ||
"node": "4.0.0" | ||
}, | ||
"targets": "node 4.0.0", |
This comment has been minimized.
This comment has been minimized.
existentialism
Aug 22, 2018
Member
Instead of modifying existing tests, should we just add new ones to make sure both syntaxes work (for now)?
This comment has been minimized.
This comment has been minimized.
Browserlist 4.1 was released with |
This comment has been minimized.
This comment has been minimized.
Just my 2 cents: it will be breaking change for babel-preset-env, not Babel if we'll land it after Babel 7 |
This comment has been minimized.
This comment has been minimized.
@chicoxyzzy babel preset env version is synchronised with all packages. So it will be a breaking change for all stuff. |
This comment has been minimized.
This comment has been minimized.
Actually it’s no so important to keep preset version in sync with Babel. More then that, this causes some issues. Also for example babel-loader and some other packages are not in sync with Babel version |
This comment has been minimized.
This comment has been minimized.
All packages in babel monorepo has the same version. babel-loader is part of it. |
c33997f
to
0ebb6eb
This comment has been minimized.
This comment has been minimized.
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/8893/ |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Should we remove |
This comment has been minimized.
This comment has been minimized.
@ai good point, will remove |
Ok looks good, I think the breaking change makes sense (targets shouldn't be related to browserslist)? |
This comment has been minimized.
This comment has been minimized.
Do we need something else to merge it? Or just time for final decision |
Fixes Babel not reading from the package `browserslist` field due to a sneaky @babel/preset-env breaking change, see babel/babel#8509.
Fixes Babel not reading from the package `browserslist` field due to a sneaky @babel/preset-env breaking change, see babel/babel#8509.
Fixes Babel not reading from the package `browserslist` field due to a sneaky @babel/preset-env breaking change, see babel/babel#8509.
yavorsky commentedAug 22, 2018
After discussion with @ai and @existentialism and update browserslist to 4 we had an idea to possibly have
targets
as a query.For now, browserslist 4 supports
node
. So in most cases, we don't need to use a plain object to specify targets directly. It's mostly confusing to have 2 sources of truth and merge this targets. For many people, it works like magic under the hood and it's not everytime clear whychrome: 55, browsers: 'chrome 40'
will selectchrome 55
.With browserslist 4 we just can specify every target we need using the query:
targets: "node 8.1, last 2 chrome versions, maintained node versions"
.Most of the people are using targets as a plain object just to support
node
version. This PR containsnode current
andcurrent node
versions which are being replaced tonode ${currentNode}
query.So what was changed?
browserslist
to 4 and added node.js mappings.browserslistconfig
iftargets
field was specified. (Since browserslist support node) (breaking change).current node
andnode current
queries, which is replaced withnode ${CURRENT_VERSION}
.Would be good to merge it before babel 7, since it contains small breaking change (point 3).
cc @ai @existentialism