Skip to content
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] Remove decimal from parser #16741

Merged
merged 6 commits into from
Sep 3, 2024
Merged

Conversation

liuxingbaoyu
Copy link
Member

@liuxingbaoyu liuxingbaoyu commented Aug 12, 2024

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

I will open a follow up PR to remove AST.

@liuxingbaoyu liuxingbaoyu added PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release pkg: parser Spec: Decimal labels Aug 12, 2024
@babel-bot
Copy link
Collaborator

babel-bot commented Aug 12, 2024

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

@liuxingbaoyu liuxingbaoyu marked this pull request as draft August 12, 2024 21:13
@liuxingbaoyu liuxingbaoyu marked this pull request as ready for review August 12, 2024 21:28
@nicolo-ribaudo
Copy link
Member

Could we throw a more helpful error? Either in https://github.com/babel/babel/blob/main/packages/babel-parser/src/plugin-utils.ts when the plugin is enabled, or in the tokenizer when we see m after a number.

"BABEL_8_BREAKING": true,
"throws": "Identifier directly after number. (1:2)"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Since Babel 8 no longer supports parsing 0.1m and it is not expected to throw missing plugin error, we can just remove this case.

@@ -26,6 +26,8 @@ if [ "$BABEL_8_BREAKING" = true ] ; then
sed -i 's/const getChalk = () => chalk/default (code) => code/' scripts/build/shims/babel-highlight.js
sed -i 's/const generate = babelGenerator.default/const generate = babelGenerator/' scripts/build/transform/index.js
rm tests/unit/__snapshots__/visitor-keys.js.snap
sed -i 's/"decimal",//' src/language-js/parse/babel.js
rm tests/format/js/babel-plugins/decimal.js
Copy link
Contributor

Choose a reason for hiding this comment

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

cc @fisker

@JLHwung JLHwung merged commit 04485b5 into babel:main Sep 3, 2024
52 checks passed
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Dec 4, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release Spec: Decimal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants