zaach / jsxgettext

Extract gettext calls from JavaScript, EJS, and other template formats.
Mozilla Public License 2.0
105 stars 56 forks source link

JSX support #102

Closed ruscoder closed 8 years ago

ruscoder commented 8 years ago

I've implemented support for JSX using acorn-jsx. Tests are included.

BYK commented 8 years ago

Hey, this looks awesome, thanks!

I'll check acorn-jsx and merge the PR if everything looks okay. Any reason not using Espree which supports all accepted ES6 features + JSX and is built on top of Acorn itself?

jeresig commented 8 years ago

I just confirmed, by running this in one of my projects, that this appears to work exactly as advertised! Thank you @ruscoder!

BYK commented 8 years ago

@ruscoder - can you respond to my Espree question which is a single parser interface compared to the acorn + acorn-jsx solution in this patch?

Also you did some unrelated stylistic changes to the file. Can you revert them? Not that I like the existing style but I'd rather not change them to keep the diff as clean as possible. I plan to tidy up the styles by introducing ESLint at some point.

ruscoder commented 8 years ago

@BYK I haven't seen Espree before. Would you like to use Espree instead of acorn + acorn-jsx?

OK, I'll revert stylistic changes and notify you.

BYK commented 8 years ago

@ruscoder - if you didn't know about Espree it is okay to keep this as is. I mostly wanted to learn your reasoning behind choosing acorn-jsx over that assuming you knew about it :)

Since this works along with tests I can always switch it to Espree in the future safely. So just revert the stylistic changes and I'll merge this away.

Thanks!

ruscoder commented 8 years ago

@BYK I've updated pull request.

BYK commented 8 years ago

Released 0.9.0

jeresig commented 8 years ago

Fantastic - thank you both! I've upgraded my app to v0.9.0 and it works great.