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 Babel to transform JS #138

Closed
zpao opened this issue Jun 10, 2015 · 7 comments
Closed

Use Babel to transform JS #138

zpao opened this issue Jun 10, 2015 · 7 comments
Milestone

Comments

@zpao
Copy link
Member

zpao commented Jun 10, 2015

We're likely going to stop supporting JSXTransformer soon. Babel has something similar so it should be relatively easy to swap in, with the upside that more ES* features are supported and they are implemented and fixed faster.

@Daniel15
Copy link
Member

I suppose this means I should close #131 and instead look at how difficult it'd be to support Babel.

@zpao
Copy link
Member Author

zpao commented Jun 10, 2015

Probably. You're welcome to use newer JSXTransformer (or even just browserify latest JSTransform, which includes JSX, directly), we just won't support it officially.

@don-smith
Copy link

+1 Babel integration would be excellent. It has good JSX support and heaps of ES6 features.

@Daniel15
Copy link
Member

@locksmithdon You can use Babel with ReactJS.NET today via Webpack (see the documentation at http://reactjs.net/guides/webpack.html). This update would just be for when you hit .jsx files in your browser directly without using any other third-party tools, or use a .NET minification library (like Cassette or Microsoft's one)

@jslatts
Copy link
Contributor

jslatts commented Jun 16, 2015

FWIW, we have been using Babel with ReactJS.NET and precompiling via Browserify + Babelify and gulp for quite awhile. We did it primarily for the ES6 transforms. Works great! I could write up a quick guide if there was interest.

@Daniel15
Copy link
Member

@jslatts - There's some docs on Webpack (http://reactjs.net/guides/webpack.html) which I'm going to update to use Babel rather than JSXTransformer, but I'd be happy to add some docs for Browserify too.

The docs are in the same repo, the source for the Webpack one is here: https://github.com/reactjs/React.NET/blob/master/site/jekyll/guides/webpack.md

A sample project would be great too. Something like the current React.Samples.Webpack but for Browserify.

Daniel15 added a commit that referenced this issue Oct 11, 2015
 - Remove JSXTransformer and instead use "browser" build of Babel
 - Remove useHarmony and stripTypes settings (no longer relevant)
 - Remove obsolete `LoadJsxFile` and `TransformJsx` from `IReactEnvironment` - These have been marked as obsolete for a long time now

#138
@Daniel15
Copy link
Member

Mostly done in dd75222. There's still a few things I'd like to do (eg. allow configuration of Babel options) but the basic stuff is there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants