Skip to content

[Babel 8] Remove decimal from parser#16741

Merged
JLHwung merged 6 commits into
babel:mainfrom
liuxingbaoyu:remove-decimal
Sep 3, 2024
Merged

[Babel 8] Remove decimal from parser#16741
JLHwung merged 6 commits into
babel:mainfrom
liuxingbaoyu:remove-decimal

Conversation

@liuxingbaoyu

@liuxingbaoyu liuxingbaoyu commented Aug 12, 2024

Copy link
Copy Markdown
Member
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

babel-bot commented Aug 12, 2024

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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.

} No newline at end of file
"BABEL_8_BREAKING": true,
"throws": "Identifier directly after number. (1:2)"
}

Copy link
Copy Markdown
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.

Comment thread packages/babel-standalone/test/preset-stage-1.test.js Outdated
Comment thread packages/babel-standalone/test/preset-stage-1.test.js Outdated
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
Copy Markdown
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
@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