4 ms·
The Ultimate Guide to JavaScript Frameworks: Use pure HTML, CSS and JS.
by LeoNatan25 9y ago
The Ultimate Guide to JavaScript Frameworks: Use pure HTML, CSS and JS.
- debaserab2 9y agoWhat is pure HTML and when does it become impure?
- LeoNatan25 9y agoWhen you build a browser insider a browser (aka React), it’s impure.
- debaserab2 9y agoSo JavaScript dom manipulations are pure? but one specific technique of dom manipulations are not?
- LeoNatan25 9y agoIt's not specifically the DOM modification but the way those frameworks are designed. With React you have hundreds of dependencies, which have hundreds of dependencies. You lost me right there.
- debaserab2 9y agoReact has zero dependencies to use it, actually. https://github.com/facebook/react/blob/master/package.json https://github.com/facebook/react/blob/master/package.json
- RobertRoberts 9y agoCan you use react without Node or NPM or a compiler/transpiler or build tool?
- debaserab2 9y agoOf course - just pop it in a script tag and use the React object functions to render your DOM (which is exactly what transpiled code does)
- RobertRoberts 9y agoI've looked into Vue.js, and they seem to indicate that it's easier to get up an running than react (using what you describe here). Are you suggesting vue.js and react work exactly the same?
- debaserab2 9y agoI don't know because I don't use Vue. What you'd be missing if you dropped in the react library and did no compilation at all is the ability to use JSX. I'm guessing vue's argument is their attribute tags still work in their minimal deployment whereas with React you'd be manually wiring up things to the React object functions. So, with React, instead of: return <div>My component!</div> You use: return React.createElement('div', {}, 'My component!); Some people like the more implicit style anyways (although I don't and I don't know anybody who does at this point)
- jmulho 9y agoThis is pure html: <div id=“div01”></div> This is magic monkey html: <div id=“div01” monkey=“true”></div>
- rpearl 9y agoYeah I used to think that. If you have any amount of dynamic data with a non-trivial representation, and you don't want to have to go through awful ad-hoc things of "when I update this data structure, tell the stuff on the screen to change" and "when this on-screen value changes, update these parts of the data structure", you eventually end up with an MVC framework: this is not a new idea and JS didn't invent it. And once you have that, adding a bit of structure to make it nice to build up modular components results in something pretty close to Vue or React.