React is the new Dojo
medium.com
medium.com
Apparently, I've been living in a completely different corner of the web than this guy.
I don't understand why so many people sweat over libraries, frameworks, and which one is going to "win". Once you learn to program properly, choosing a framework becomes a non-issue.
The bigger problem right now is the tooling ecosystem (webpack, babel etc). It's too difficult to set up and customize, especially for beginners. The packages change too often and you run into bugs all the time. Sometimes I wish we had a dumb-ass GUI to set up all this stuff. Customizability comes with complexity I guess.
To this day we are still having some minor issues with our tooling/builds and some odd configuration that we don't know if it's our fault or just something everyone deals with. The framework itself works as intended and is a joy to work with.
Well that and don't get me started on Selenium testing...
From an individual developer standpoint, you should be able to transition between frameworks, libraries, and so on. You don't have to pick a single "winning" tech stack, although there are obviously transactional costs to becoming productive in a new tech stack.
From the point of view of a product or business, it is very expensive to switch between tech stacks. Most businesses can't afford to re-implement their product because there is a new 'hot framework'. I think there was an article on HN just within the last week about why Fortran is still a thing in some development circles.
So while I don't think it is necessary for there to be a single "winner", discerning which tech stacks have some long term stability and when the benefits of a transition outweigh the transactional costs of switching can be important.
I totally agree with you. I was talking about the developers perspective.
When it comes to companies, not only is it difficult to transition from an unpopular tech stack, but it's also difficult to hire great developers because none of them want to work on such stack.
This is what worries me about WebAssembly. If most web code goes binary, then it is no longer possible for the next generation of developers to View Source to see how things are built. Over the decades of doing web development, I've learned so much from looking at the source of other people's web sites. Even now with minimization and obfuscation it is pretty easy to run the code through some tools to get it back to a readable state.
This will be even more true as browser JS performance increases
A beginner already can't "see how things are built" in an application compiled with closure or whatever unless the developer ships sourcemaps to production, and then… nothing precludes having sourcemaps for webassembly.
At the very least webassembly gets ypu drbug symbols, so maybe there's a chance you can go through it
React's target is complex apps. It's designed to scale both with application complexity and team size. jQuery never was designed to scale. And anyone who started with jQuery and built a rich single page app will generally tell you of all the imperative pitfalls you'll find.
The thing is, the web has evolved. The simple tools that attracted us to the web when web was mostly a presentation layer just don't cut it.
The "old" web is still there for beginners. If you want to learn to build basic websites without having to learn package management, numerous libraries and frameworks... jQuery is still a great option.
I'm always skeptical of loose analogies. 2017 isn't 2010. React is not Dojo. I'm not even saying React is the end all be all...but it works really well and it will continue to hold its position unless something better comes along that enough people are excited about to beat React's ecosystem.
For beginners there are tools like Next.js and Gatsby which allow you to create server rendered React apps with minimal config, setup, etc.
React also has React Native going for it, which is still young and booming.
Uhhh... Obviously Facebook would be using it. That was useless filler insight. What other large implementations of React is out there?
It's easier to ask what large company isn't using React. The PATENTS talk was odd because those same companies had and continue to use it with or without the new licensing.
An example using that combination: https://github.com/pdfernhout/Twirlip7
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.
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.
The new tutorial explicitly requires a build phase -- no more CDN and ad-hoc running.
1 - https://web.archive.org/web/20150202210539/http://facebook.g...
1 - https://cdnjs.com/libraries/react 2 - https://twitter.com/dan_abramov/status/893099358484353024?la...
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.
Even jsx can be compiled on the browser, seamlessly.
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?
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.
But even then, now you want people to learn a new tool to use React "simply"?
Did Dojo expect the community to use the "optional complexity"?
Actually now that browsers have fetch, async and await, you can do a lot with just those and document.createElement. No need for frameworks.
The point is not that scaled down is possible, it's that it's the way. It's not for the sake of learning, like the React with script tags tutorial. It's how people actually build things with jQuery; they just start hacking.
<div id="root"></div>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
<script type="text/babel">
ReactDOM.render(
<h1>Hello, world!</h1>,
document.getElementById('root')
);
</script>ng generate component my-component
Well, yeah, it's developed by and for Facebook...that was a weird line.
If that's what you want, then it's not a function of a new framework to enable the vision you articulated. I think evolutions in the HTTP protocol is needed to allow unbuilt/unbundled code to be effectively delivered over the wire.
There is a clear distinction between how developers need to abstract and organize code vs how code is more efficiently processed by programs. The framework that the developer uses will always be designed to cater to what the user needs. If there is the need for a build/bundling step, then so be it. Framework designer should never sacrifice the former for an easier build/bundling step
Something like webpack-dev-server, but usable both in production and development.
To deploy, drop your typescript/html/css files under /srv/www/ and your web server will take care of everything.
But compiling isn't what a web server does, and it seems like having the server automatically do what a developer is going to do anyway when they push to production, and likely not very often, isn't a significant gain in efficiency. The point of having a separate build chain for these types is that you're emitting what are meant to be static resources anyway.
> please no more need for cli, node.js, a "toolchain", etc.
I'm okay as long as it is wrapped, and I do not have to fiddle with it for 95% of the use cases. Tools will always be part of the job, but the current JS situation is way too messy.
I don't see React "winning" on a major scale at corporations here in Europe.
Tbh I am quite shocked whenever I read about advances in React that Angular has had for quite a while.