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

feat(babel-parser): throw syntax error for } and > in JSX text #11046

Merged
merged 6 commits into from
Feb 4, 2020
Merged

feat(babel-parser): throw syntax error for } and > in JSX text #11046

merged 6 commits into from
Feb 4, 2020

Conversation

bradzacher
Copy link
Contributor

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

See the full context in #11042.
The JSX spec lists } and > as invalid JSX text characters.
Flow recently updated their parser so that it errors in this case.
This PR just does the same for Babel.

Looking for feedback, as I've never contributed to babel before.
Do we need explicit documentation for this change, or are the error messages "good enough"?

@existentialism existentialism added area: jsx PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release labels Jan 23, 2020
@jridgewell jridgewell added this to the Babel 8.x milestone Jan 23, 2020
@nicolo-ribaudo
Copy link
Member

Thanks! It will take a bit to merge this PR since we need to wait for Babel 8.

bradzacher and others added 2 commits January 26, 2020 21:41
@nicolo-ribaudo nicolo-ribaudo added PR: Ready to be Merged A pull request with already two approvals, but waiting for the next minor release and removed ⚠️ Do not merge labels Feb 4, 2020
@nicolo-ribaudo nicolo-ribaudo changed the base branch from master to next-8-dev February 4, 2020 00:35
@nicolo-ribaudo
Copy link
Member

I'm merging this to the next-8-dev branch. It will take some time before it's released!

@nicolo-ribaudo nicolo-ribaudo merged commit 904e429 into babel:next-8-dev Feb 4, 2020
nicolo-ribaudo pushed a commit that referenced this pull request Feb 4, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
@nicolo-ribaudo nicolo-ribaudo mentioned this pull request Feb 4, 2020
34 tasks
@bradzacher bradzacher deleted the 11042-jsx-invalid-characters branch February 5, 2020 01:17
nicolo-ribaudo pushed a commit that referenced this pull request Feb 6, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
nicolo-ribaudo pushed a commit that referenced this pull request Feb 6, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
nicolo-ribaudo pushed a commit that referenced this pull request Feb 9, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
nicolo-ribaudo pushed a commit that referenced this pull request Feb 13, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
nicolo-ribaudo pushed a commit that referenced this pull request Feb 20, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
nicolo-ribaudo pushed a commit that referenced this pull request Feb 23, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
JLHwung pushed a commit to JLHwung/babel that referenced this pull request Feb 27, 2020
…#11046)

* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
nicolo-ribaudo pushed a commit that referenced this pull request Feb 27, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
nicolo-ribaudo pushed a commit that referenced this pull request Mar 3, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
nicolo-ribaudo pushed a commit that referenced this pull request Mar 10, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
nicolo-ribaudo pushed a commit that referenced this pull request Mar 11, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
nicolo-ribaudo pushed a commit that referenced this pull request Mar 13, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
nicolo-ribaudo pushed a commit that referenced this pull request Mar 22, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
nicolo-ribaudo pushed a commit that referenced this pull request Apr 11, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
nicolo-ribaudo pushed a commit that referenced this pull request Apr 20, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
arku pushed a commit to arku/babel that referenced this pull request Apr 20, 2020
…#11046)

* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
nicolo-ribaudo pushed a commit that referenced this pull request Apr 21, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
nicolo-ribaudo pushed a commit that referenced this pull request Apr 21, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
nicolo-ribaudo pushed a commit that referenced this pull request Apr 22, 2020
* feat(babel-parser): throw syntax error for `}` and `>` in JSX text

* feat: move validation earlier in parse

* test: update flow test whitelist

* feat: update message to include html entities

* Update packages/babel-parser/src/plugins/jsx/index.js

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>

* fix: update snaps

Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
@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 May 6, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2020
@JLHwung JLHwung removed this from the v8.0.0 milestone Aug 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: jsx outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release PR: Ready to be Merged A pull request with already two approvals, but waiting for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: throw syntax error for } and > in JSX text.
6 participants