-
Notifications
You must be signed in to change notification settings - Fork 36
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
Why is a transform-react-jsx
required
#5
Comments
I'm not affiliated with the project, but I think a decent answer is: The more features fuse-box supports "out of the box" means more technical debt that has to be taken on. The js community is -incredibly fast- paced, so taking on the endeavour of supporting jsx "in-house", as opposed to letting other people set the standards for it, and supplying a pluggable interface -into- fusebox, would mean having to play catchup all the time. |
@nchanged I've been playing with fuse-box for about 30 minutes... and I already have an electron + react + babel + css-modules + HMR build up and running. A thing I spent a full week trying to figure out (without relying on boilerplates and generators) last week. I'd say you're doing a fine job of making my life easier. 👍 |
@8-uh Glad to hear that! |
I don't quite follow. There should be no extra work required to support JSX since FuseBox already supports TypeScript. Meaning, all "extra work" to support JSX is already done by the TypeScript team. @nchanged Thanks for pointing me to this example. Just a personal note: I think examples using other task runner/bundlers (in this example The issue I had was completely on my side, because I didn't get the "can't find index.jsx" file error message that was thrown on run time. I thought if something is wrong with the build FuseBox will let me know on compile time, but I guess that will change in the future. This is what I ended up with as a configuration for using React with TypeScript. Freakin awesome!!!
Thanks @nchanged for all the hard work you put into this project ❤️ I will definitely tinker a bit more with it and maybe replace our webpack setup with it! Don't tell Mr. Larkin! |
@sebald thank you for your support! Regarding gulp, I agree, don't like it either. We should have our own task runner =) |
@nchanged Please don't! 😄 No need to reinvent the wheel. The current API + maybe a CLI is more than enough. |
@sebald could you share a repo with your settings? having a hard time with ReactDOM.render is not a function 😢 |
nevermind, made it work, but had to import react and react-dom as import * as React from 'react'
import * as ReactDOM from 'react-dom' |
@AngelMunoz I did use this repo. Just changed the |
@sebald yeah I meant tsconfig and other stuff, weird things were happening, but it seems the way I was importing import ReactDOM from 'react-dom';
import React from 'react';
// or import React, { Component } from 'react'; is not working at least for me |
Since TypeScript adheres to the ESModule specification you have to import like import * as React from 'react';
import * as ReactDOM from 'react-dom'; |
I was wondering why this example requires the
BabelPlugin
, since TypeScript can transpileJSX
by itself.Removing the plugin and using a custom
tsconfig.json
that sets"jsx"
property to"react"
works (at least it compiles), but the output seems to be broken. Opening the app in the browser is not possible ->http://localhost:4444/default/index.jsx
Is it not possible for FuseBox to compile JSX without any plugins?
The text was updated successfully, but these errors were encountered: