3 ms·
You're too much in-the-know. You skipped the build chain required to make this work. And if you make one mistake or do something not by the book you could easil
by Touche 9y ago
You're too much in-the-know. You skipped the build chain required to make this work. And if you make one mistake or do something not by the book you could easily wind up shipping the development version of React to your users (which is slower).
I think the analogy is so apt because Dojo users made the same arguments back in the day; that it really was easy if you ignore all of the parts that were not easy. They weren't wrong! But that didn't make it ideal as a scaled down solution.
- hungerstrike 9y ago> You skipped the build chain required to make this work. Same thing when you just include jQuery and plugins from a CDN. > And if you make one mistake or do something not by the book you could easily wind up shipping the development version of React to your users (which is slower). Same thing with using jQuery from a CDN. React itself is also tiny compared to Dojo. And Dojo never did anything truly new. This is all old stuff re-packaged for the web. Web programming is still catching up with PC desktop programming from the 90's.
- ctvo 9y agoReact used to work this way[1]. They removed support for the JSX parsing without a build step[2]. The new tutorial explicitly requires a build phase -- no more CDN and ad-hoc running. 1 - https://web.archive.org/web/20150202210539/http://facebook.github.io:80/react/docs/getting-started.html https://web.archive.org/web/20150202210539/http://facebook.g... 2 - https://reactjs.org/tutorial/tutorial.html https://reactjs.org/tutorial/tutorial.html
- hungerstrike 9y agoActually, in fact, you can still use React 16 from a CDN. [1], [2] 1 - https://cdnjs.com/libraries/react https://cdnjs.com/libraries/react 2 - https://twitter.com/dan_abramov/status/893099358484353024?lang=en https://twitter.com/dan_abramov/status/893099358484353024?la...
- ctvo 9y agoThis is in response to how accessible React is to beginners (amateurism). The original tutorial allowed beginners to get started quickly (via CDN), even allowing them to write JSX via script tags in their HTML. They can take that HTML and host it anywhere. The new tutorial requires the usage of create-react-app or running the code on CodePen. A tweet by a React core developer with instructions on how to get CDN support working better reinforces the point about not being open to amateurism, by the way.
- masklinn 9y agoYou can still get React from a CDN and don't need to use JSX, though if you really want JSX, as smarx demonstrates you can use standalone babel to compile JSX in the client: https://news.ycombinator.com/item?id=15522420 https://news.ycombinator.com/item?id=15522420
- pknopf 9y agoNo pre-deploy build chain is required. Even jsx can be compiled on the browser, seamlessly.
- masklinn 9y agoNo build chain is required, you don't even need JSX.
- pknopf 9y agoCorrect, but it is more verbose and ugly to not use JSX. I guess the argument is you shouldn't be compiling things on the clients browser.
- masklinn 9y ago> Correct, but it is more verbose and ugly to not use JSX I don't agree with that. I tend to prefer hyperscript to JSX (for personal projects) and I think it looks perfectly fine. > I guess the argument is you shouldn't be compiling things on the clients browser. How's that an argument at all?
- pknopf 9y agoYou are saying this... var rootElement = React.createElement('div', {}, React.createElement('h1', {}, "Contacts"), React.createElement('ul', {}, React.createElement('li', {}, React.createElement('h2', {}, "James Nelson"), React.createElement('a', {href: 'mailto:james@jamesknelson.com'}, 'james@jamesknelson.com') ), React.createElement('li', {}, React.createElement('h2', {}, "Joe Citizen"), React.createElement('a', {href: 'mailto:joe@example.com'}, 'joe@example.com') ) ) ) ...is just as readable as this? var rootElement = <Div> <H2>Contacts</H2> <Ul> <Li> <H2>James Nelson</H2> <A href="mailto:james@james.com"> james@james.com </A> </Li> </Ul> </Di> The whole point of JSX is to make working with React more like html, because it is easier and more readable. > How's that an argument at all? Huh? You mean, the argument that you shouldn't be sending un-compiled content to the client? I don't know why I'd have to argue for this, but render speed is one of the big reasons. Also download size. If you don't recompile, you have to include babel as well, on the client.