question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transform JSX in the browser

See original GitHub issue

Now, Babel removed browser.js from babel-core. https://github.com/babel/babel/commit/c0afdfd1a83aab0c25a1fc23cee0b09d560f4d35

React Getting Started documentation is using browser.js of babel-core 5.8.23. http://facebook.github.io/react/docs/getting-started.html

Do you have any plan for supporting JSX transformer for the browser? Will it be deprecated?

Thanks.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:38 (20 by maintainers)

github_iconTop GitHub Comments

34reactions
jimfbcommented, Nov 18, 2015

@sebmck Am I missing something obvious here? The in-browser transformation is fairly critical to new users getting started. It is used in sample code to give people a first taste of JSX, is used in fiddles for debugging/testing/demoing, is used in a lot of places. It is even used on the reactjs homepage. browser.js seems like a fairly critical feature to me.

5reactions
Sophia-Goldcommented, Jun 4, 2016

Thanks! I actually decided to just not use JSX and you know what? It’s much easier for me to write straight JavaScript. Maybe it’s because I haven’t yet developed a large site with React, but I’m really not sure what JSX adds beyond making it easier for designers who are more familiar with html.

And the downsides are huge. Babel became a mess with version six and Webpack is kind of an odd choice for a package manger if you ask me. I give it only a year or two until that becomes almost unusable as well and then tons of people’s React projects will require major overhauls. Unless fb is going to pay its developers to work on those open source projects I see the dependencies as major liabilities.

Anyway, I’m pretty set for now 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introducing the New JSX Transform – React Blog
Browsers don't understand JSX out of the box, so most React users rely on a compiler like Babel or TypeScript to transform JSX...
Read more >
How transform JSX code in browser - reactjs - Stack Overflow
JSX is a syntax sugar over JavaScript. When you use jsx in browser, JSX transformer needs some time to transform jsx to javascript....
Read more >
JSX Transformation Explained - JavaScript in Plain English
JSX transformation through Babel · 1. Initialize package.json file with npm init command. · 2. Then let's install @babel/cli , and @babel/core , ......
Read more >
Running JSX in your browser without Babel
Just for fun, I wondering if I could run React + JSX code directly in a modern browser without transpilation and packaging.
Read more >
babel/plugin-transform-react-jsx
Automatic runtime is a feature added in v7.9.0 . With this runtime enabled, the functions that JSX compiles to will be imported automatically....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found