Need help with reactjs and the toolchain in general...

Maximilian

Lifer
Feb 8, 2004
12,604
15
81
So I have an existing site (not an SPA) and I want to do some templating and some data binding, that is all I need. Its already using handlebars.js but I need the data binding as well. React can do this right? I get the feeling I should learn react or angular anyways.

Ive had reactjs running before by adding browser.js but there will be functions in the jsx files that are called before its done compiling the jsx to js. I gather its not whats done in a production app anyways.

Problem is I cant get the tools setup to make it work :oops: Any good guides or tutorials for this kind of thing? Ive looked at the facebook one and it looks okay for learning react but they glaze over a bunch of seemingly important stuff like how do I get my IDE to convert jsx to js?? Babel apparently, cool, how does that work though? What is webpack and why do I need that? Im feeling massively overwhelmed here :eek: Im using Intellij if it matters. Eclipse and Netbeans gave me too much BS with this kind of thing before.
 

Cogman

Lifer
Sep 19, 2000
10,284
138
106
React is one way data binding while angular is two way. So you should be aware of that.

Generally, I would say you should set up a build chain. Modern javascript, no matter the form, needs a build chain and react.js in particular REALLY needs it to be effective (the jsx transform you were talking about).

You don't have to dump all of your files/data. But I would suggest migrating them to work with a build system.

In particular, webpack is probably the most popular build system right now.

Here is a pretty basic setup you can follow and tweak to your needs.

https://www.codementor.io/reactjs/t...setup-reactjs-environment-npm-babel-6-webpack
 

Maximilian

Lifer
Feb 8, 2004
12,604
15
81
React is one way data binding while angular is two way. So you should be aware of that.

Generally, I would say you should set up a build chain. Modern javascript, no matter the form, needs a build chain and react.js in particular REALLY needs it to be effective (the jsx transform you were talking about).

You don't have to dump all of your files/data. But I would suggest migrating them to work with a build system.

In particular, webpack is probably the most popular build system right now.

Here is a pretty basic setup you can follow and tweak to your needs.

https://www.codementor.io/reactjs/t...setup-reactjs-environment-npm-babel-6-webpack

Cheers, ill look into this :thumbsup: