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

Use helper-builder-react-jsx inside plugin-transform-react-inline-elements #6294

Conversation

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Sep 22, 2017

Q                       A
Fixed Issues Fixes #6276
Patch: Bug Fix? 👍
Major: Breaking Change?
Minor: New Feature?
Tests Added/Pass? 👍
Spec Compliancy?
License MIT
Doc PR
Any Dependency Changes?

This PR removes the duplicated implementation of the jsx transformer, so it makes it easier to avoid bugs.

…ments.

This avoids duplicating the logic for converting jsx elements to plain JavaScript.
@babel-bot

This comment has been minimized.

Copy link
Collaborator

babel-bot commented Sep 22, 2017

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

so it is a little bit easier to understand what all those .splice() calls do
@nicolo-ribaudo

This comment has been minimized.

Copy link
Member Author

nicolo-ribaudo commented Sep 22, 2017

Maybe we could also remove the spread element deoptimization, since babel-helper-builder-react-jsx handles it?

@hzoo hzoo merged commit 8aabbbc into babel:master Sep 26, 2017
@nicolo-ribaudo nicolo-ribaudo deleted the nicolo-ribaudo:issue-6276-jsx-inline-elements-multiline-string branch Sep 26, 2017
@@ -0,0 +1,3 @@
var test = <T default="
some string

This comment has been minimized.

Copy link
@Andarist

Andarist Sep 26, 2017

Member

@nicolo-ribaudo isnt this SyntaxError? raw multiline strings are allowed only in template literals

This comment has been minimized.

Copy link
@nicolo-ribaudo

nicolo-ribaudo Sep 26, 2017

Author Member

If I'm reading the JSX specification correctly, the only disallowed character is " (thus \n is allowed)
https://facebook.github.io/jsx/

This comment has been minimized.

Copy link
@Andarist

Andarist Sep 26, 2017

Member

Indeed, it seems its allowed. Always thought that jsx is only a sugar for createElement calls and the rest is just JS. Dont like it doesnt conform to JS in those regards

This comment has been minimized.

Copy link
@hzoo

hzoo Sep 27, 2017

Member

There is a lot of logic for strings in the transform at least

@lock lock bot added the outdated label Oct 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants
You can’t perform that action at this time.