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

Only match stateless functional components where the first letter is a capital #40

Merged
merged 1 commit into from
Apr 16, 2016

Conversation

clayne11
Copy link
Contributor

This is the standard in React.

A lot of false positives will occur from accepting lower case
functions.

This closes #30.

standard in React.

A lot of false positives will occur from accepting lower case
functions.

This closes gadicc#30.
@gadicc gadicc merged commit eb83bb2 into gadicc:master Apr 16, 2016
@gadicc
Copy link
Owner

gadicc commented Apr 16, 2016

Awesome, thanks for this! Yes, we should have done this straight from the beginning. Thanks also for noticing the duplicated code. Initially the accelerator was part of the babel-compiler-hot package, which is why it's all in a single file and a bit weird. In theory moving forward we could probably export some things from there for use in the babel-compiler-hot. Some of the funcs are slightly different in each case though.

@clayne11 clayne11 deleted the issue_30_v3 branch April 16, 2016 18:55
@clayne11
Copy link
Contributor Author

I was somewhat lucky to find the duplicated code. It's definitely a bit confusing and error prone. I think factoring out at least the RegEx and source transformation would be a good idea.

@gadicc
Copy link
Owner

gadicc commented Apr 17, 2016

Yeah I'm going to try clean it up over the next week, now that it's possible (originally there was no way to share code between the files).

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.

=> Exited with code: 1 on releases > 1.3.1-fast.3
2 participants