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

jsx-to-htm: leading underscore = reference tag #92

Merged
merged 4 commits into from
Jul 3, 2019

Conversation

developit
Copy link
Owner

In JSX, a leading underscore in tag names denotes a reference tag (Component):

var x = <_Foo />
// should output:
var x = html`<${_Foo} />`

developit added 2 commits June 4, 2019 12:20
In JSX, a leading underscore in tag names denotes a reference tag (Component):

```js
var x = <_Foo />
// should output:
var x = html`<${_Foo} />`
```
@developit
Copy link
Owner Author

developit commented Jun 15, 2019

Updated to allow both $ and _ leading characters to indicate referential tag names, as well as the existence of . anywhere in a tag name:

Tag Name Type
div string
div_ string
div$ string
d_v string
d$v string
F reference
Fragment reference
React.Fragment reference
react.fragment reference
$div reference
_div reference

(Babel seems to parse tag names matching /(^[A-Z_$]|[A-z_$]\..)/ into references. repl example)

@developit developit requested a review from jviide June 15, 2019 21:17
Copy link
Collaborator

@jviide jviide left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@jviide jviide force-pushed the jsx-leading-underscore branch 2 times, most recently from e3f1494 to e269304 Compare July 3, 2019 16:41
@jviide jviide self-requested a review July 3, 2019 16:46
@jviide jviide merged commit 29a7fb8 into master Jul 3, 2019
@jviide jviide deleted the jsx-leading-underscore branch July 25, 2019 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants