News for hackers. Stuff that matters.
Re:Things every React.js beginner should know by Kiro on Monday January 25, 2016 @08:35AM (#10967051)
Putting HTML and JS in different files doesn't make them separated. They are still bound by logic. It's an imaginary separation with obscure dependencies. I very much prefer the React way of bundling things that in reality belong together.
Re:Things every React.js beginner should know by robmcm on Monday January 25, 2016 @10:06AM (#10967524)
It is quite possible to develop semantic, content focused HTML and then at a later point style and re-style with CSS.

It is only through laziness and lack of understanding that people couple them together.

Re:Things every React.js beginner should know by jjnoakes on Monday January 25, 2016 @12:07PM (#10968335)
Except this isn't about style. It's about logic. Logic isn't as optional as style, and if you separate the logic into one JS file and the DOM into another HTML file, they are still tied together by the JS binding some action to some named DOM element (by selector, etc).

The separation that scales is the one that pairs a small piece of DOM (like a piece of text on the page that updates with the current stock price) to the JS that goes with it, and put that into a single file. Now, build your web page out of components instead.

Re:Things every React.js beginner should know by robmcm on Tuesday January 26, 2016 @04:19AM (#10972548)
So this is where you enter a slippery slope from web page to application.

Developing a webpage and adding progressive enhancements to HTML elements is a strongly advised best practice with numerous advantages.

Developing an dynamic application at the complexity of say Photoshop it would be absurd to have a static HTML file with behavior decorated by JavaScript, or try and offer a fallback. Whilst you could in theory perform you photo editing with form submissions and round trips to the server I am not sure it would be worthwhile (I did actually create one circa 2004).

Re:Things every React.js beginner should know by jjnoakes on Wednesday January 27, 2016 @08:04AM (#10979777)
You can serve static html and progressive JavaScript and still couple the html and JavaScript into components.

The structure of your code does not have to dictate the result that is served to the user.