Angular v8.0
github.com
github.com
Out of the box, you get: routing with lazy loading, full TypeScript support and a TypeScript-first ecosystem, a great CLI that completely abstracts Webpack and the build process, easy and mostly automatic updates with the CLI, reactivity with RxJS baked-in and supported widely in the community, a great forms library, and, of course, a component-based approach to UI development. The uniformity is a big benefit. It's easy to ramp up on a new Angular project, and there are fewer decisions to make when starting a new one. The built-in parts of the framework are all high quality and an easy bet. There's no need to evaluate different routers, form libraries, HTTP clients, get back up to speed on configuring Webpack only to forget how until next time, etc.
It's also interesting to see the React community move towards some of the things that Angular has been doing for years: embracing TypeScript, extracting business logic to services (or you can call them Hooks), creating injectable shared state (or you can call it Context).
> There's no need to evaluate different routers, form libraries
These two things have been the bane of my React development experience ever since the days of "flux". Every new React project I start I end up using a different set of libraries, and it's not just me either -- a very experienced React dev I work with just switched our React e-commerce SPA's form library out.
Coming back to Angular after a long time (I used to work with AngularJS) has been like a breath of fresh air. The project I'm using it on is clean, simple, consistent. The code is readable, every form and component works the same way.
If I was building something with less consistent / regular UX then I would still definitely use React, but Angular has really pleasantly surprised me.
I routinely have to hop between all the apps and I don't have to think about which libraries someone has used for each part, if Angular has a version of something we need we just that. One of our bigger apps hasn't made the switch to ngrx, but that's about the only difference between the feel of them all.
It's quite useful when there are multiple smallish projects, for example your typical web agency.
Also useful when you have one or two experienced programmers and a few less experienced ones: makes it easier to review the code.
That said for a highly custom application, especially one you're betting the company on, and need full control, a lower level approach can be beneficial.
Not limited to Angular vs Vue.js, the same applies to Django and Flask for example.
TLDR - Choose React.
React is also much less abstraction away from vanilla JS. Learning Angular is learning a new language with a whole bunch of restrictions. Learning React is like learning JS++.
(This is my personal experience based on three Angular projects and ten+ React projects.)
although, code separation is native in React now and if you think http clients is still a thing you're too far into the Angular ecosystem to be helped.
In the end, we were able to partially migrate to angular 4 at the time using ngUpgrade while still using parts of the application in angularjs 1.6. luckily we started looking into typescript beforehand, making it even easier.
It took us 3 months to completely migrate with only a tiny fraction of legacy bundle of code now still running on angularjs until it's being converted
Since then I have done every major upgrade without fears. I wholeheartedly recommend it for medium-large applications (we have around 50k cloc typescript now).
Angular + Typescript keeps us and our frontend saner than before.
One thing I sorely miss is the performance of my manual webpack / angularjs build, with 15seconds initial build and 1-2 seconds incrementals... It's now at least double with the angular cli, but at least fully managed.
Is this common? Thank goodness i'm not the only one! I keep telling myself next time i'm going to remember to bookmark the billion tabs I open on StackOverflow trying to figure out Webpack configuration, but nope I forget and start from scratch every time.
EDIT: Also I've coded a project in Angular 2 and Angular 4 respectively; I have nothing bad to say about Angular but I still prefer Vue for it's ease of use and friendlier syntax.
> Also I've coded a project in Angular 2 and Angular 4 respectively; I have nothing bad to say about Angular but I still prefer Vue
I have used Angular 1 professionaly for more than 3 years with some big projects and when Angular 2 was released I ditched the idea of using it in a newer project. I was using Angular 2 since the alpha days and saw how some things got over complicated. And then I too chose Vue and fell in love with it.
Huh? Hooks are just a way to use component lifecycle in absence of classes (note how React is pushing towards having components as functions as opposed to Angular's components as classes/objects). The new context api is basically just a replacement/improvement of the old context api, which has been in React for ages (React Router was built upon the old context api from get go), but has always been badly documented and considered a private interface, something you were not supposed to touch. As for embracing Typescript, the React community has extensively used static typing with Flow (since this is something that the React team itself uses) for a couple of years, which is very similar to Typescript.
Having CLI generators (such as create-react-app) is definitely something that React borrowed from other communities, but I am not sure whether Ember or Angular was the main influence.
For Context, like you said, it existed before, but everyone was told not to use it. After the new API came out, people started suggesting ditching Redux for Context, and I know a lot of people did that. Using Context in that way is very similar to creating a stateful service in Angular and injecting it into your components.
For all people who resent SPAs, continue using all jquery and other libs for small or existing projects but do consider a framework like angular if you want to build a stable web application (or a suite of web applications), you will appreciate it after your initial dive. I also recommend a youtube channel with clear non ADD turorials: search for ‘kudvenkat angular’ on youtube.
The thing we love about Angular is compartmentalizing everything.
This is actually something that bothers me a lot about Angular. Yes, you can extract components, but the process of doing so is a lot more... heavyweight than in React.
In React, I can trivially extract any piece of UI into a stateless functional component in the same file (and later on I can move it to another file for wider reuse if needed). It's just like extracting a method in non-web programming, it's something you do without even thinking about it.
In Angular, that component needs to live in a separate file with a bunch of boilerplate and it needs to be registered in the module. This is OK for big components, but it's enough work that it's not practical to create tiny helper components frequently.
I can agree with you there if by heavyweight you're referring to it's explicit definitions.
However, have you tried a "SharedModule"? You can throw any number of tiny components into however many shared modules (one shared module for your small-medium sized application vs n-number of lazily loaded shared modules for your large+ applications.)
I myself enjoy wrapping even helper components in modules because I then know exactly what a component needs and it's scope of dependencies.
I tend to find that most libraries/frameworks have a few central notions about what the challenge of developing an application in their technical domain is. As far as I was able to tell from working on two projects, Angular's was that JavaScript applications were not written enough like Java applications, or put another way, there were not enough idioms from a static manifestly typed kingdom-of-nouns class-oriented language being used in a dynamically typed first-class-functions-from-the-start prototypes-too language.
TypeScript has its points, there's things to like about it, but its emphasis does the opposite of persuade me that central philosophy has changed. And while I get that complex applications are complex, and most need some organizing principles and Angular is one (or more) of several attempts to figure this out, this one struck me as... not one I wanted to live inside of, to keep things polite.
If I'm wrong about Angular's central philosophy at this point, I'd be interested to hear how.
I’m working on two huge projects using AngularJS, but would just as soon do the next with Vue. Hopefully Typescript doesn’t infect that project badly.
Google as an organization seems to have decided that C++ / Java is the one true paradigm for all work.
Could have called it "Rectangular". Opportunity, missed.
Yeah, just like that, all over again.
I share this impression and feeling. Telling me that most of the stuff I learned for 1 was now useless (or worse, misleading) because 2 was doing everything differently was the first thing that soured me. The _promise_ of regular breaking changes soured me further, and the steep learning curve and high start-up cost sealed the deal.
With Vue, I can have a small proof of concept running without even a compiler in a few minutes. With Angular, I have to comprehend and set up the entire (new) project structure and sit down for hours learning concepts to be able to do anything - all that while remembering that the last time I learned their proprietary concepts, it all changed shortly after, and that the developers _promise_ that it will continue to change under me.
It _probably_ still makes sense for big projects, but damn, they're doing everything to keep people from trying.
That's a great thing about Vue, too. vue-router and vuex are well-designed and well-supported / integrated. Makes a huge difference.
My biggest gripe, and this might just be my inexperience, is fighting the change detector to try and ensure reasonable performance when displaying a large number of elements. There are certainly mechanisms to do this but it does seem to take some work.
In React if I have performance issues, then it's pretty easy to work out what's causing them.
This is part of Angular really. At least it's not optional to use it. Change detection issues are not fun to debug!
Zone.js is optional, although it is on by default. It's considered best practice to remove it when building standalone components with Angular Elements.
I built my business' web application (and android app) using Angular. It works so well both in the native browser, and in an Android wrapper.
My ONLY complaint about Angular is the initial load time.
There's been a huge React/TypeScript community since day one, even before Angular2 was released with TypeScript. The only difference is it's optional with React.
> creating injectable shared state (or you can call it Context)
Or Flux/Redux?
You get stuck on one project or in one startup for 2 years and Angular has moved 6.5 whole number versions
all while the rest of the job market is confused but kind of tolerating why you jump around jobs so much
if I'm using Angular, my "side project" isn't going to be using a higher version of Angular every 6 months. Its going to be using React or something to see what I'm REALLY missing.
If you're on one project or startup using Angular and you haven't kept up with the versioning that's a problem with the developers. There is no reason to be using a version lower then 1 back.
Features marked for deprecation will at minimum take 2 version to be removed, so 1 year after deprecation was marked. This isn't like Angular 1 -> 2 and I hope anyone who pays attention at all to front end will realize this. Complaining about angular versioning at this point would be like complaining that react bumped a patch version.
I'm seeing that
Organizations are still supporting a transition from 1, "1.5" and 2
You don't really have to upgrade every time a new version is out btw.
I mostly do Kotlin in my day job so Angular aligns fairly nicely with the way applications are structured. I don't get the militant need for terseness that's seen in approaches like React Hooks. I also don't need the choice between multiple backwards-incompatible (or competing) routers, nor do I have a need for functionally pure reducers.
So, it may not be sexy, but It Works and that's good enough for me :)
Still, angular always struck me as going slightly too far into Java-land -- my Struts/J2EE/DI battle scars are larger than even my ExtJS mutilations.
And in between you've got VueJS/Vuex, which seems to move a bit too close to react at times, and EmberJs, which seems to move too slowly and/or without many people watching it.
I really want to go back to late-90s desktop UI development sometimes…
While it's not a JS framework, can I interest you in an explicitly VB/Delphi-inspired app development tool for the web?
It's got drag'n'drop design, you code entirely in Python (including the front end - it transpiles to JS), and it even has a built-in database: https://anvil.works/
The whole interaction model is just a lot more tedious than desktop UI development. One of the few approaches that I actually liked (not just tolerated) was Seaside, but that went away when the blood-dimmed tide of JS was let loose.
Can’t wait. Imagining all the possibilities...
It's a different story when your application is huge and mostly made of batteries. ;- )
Now, this clearly needs SOME boundaries, but let's not start a whole "Electron" thread again :)
Also it's easier (at least from developer's perspective) to deal with a big image than to deal with big JS codebase. You can't just replace it with something smaller, you often need to spend a significant amount to shrink it.
This does not mean the frontend community should continually be bending over backwards reinventing wheels just so the claim can be made that a certain package is now "only 1.6k GZipped!", imho.
``` polyfill1 = "function(...)" polyfill2 = "function(...)" vendor1 = "function(...)" vendor2 = "function(...)" route1 = "function(...)"
if(firefox) eval(polyfill1) if(route === '/locations') { eval(vendor1) eval(vendor2) eval(route1) } ```
Most websites on the internet load several megabytes of Javascript.
For a full-size SPA, I think Angular is a great choice, but for incremental use cases like adding some interactivity to a mostly static page, it's still not the main use case, although that will change with Angular Elements.
For a full on SPA, Angular is lovely to work with.
The nice thing is that the automation tools are being made progressively easier to customize. That means that it is easier to define your own standard and support it with standard tooling.
These are pretty typical Java libraries, but lightweight. Nothing particularly Kotlin about them but that's why I like Kotlin because you can leverage the entire Java ecosystem easily.
I find Kotlin on the backend to be a pleasure.
The main feature among many is differential loading, that will load different versions of the application depending on the capabilities of the browser.
This will avoid installing polyfills without the need for them and reduce the bundle size. There are reports of 40kb reduction in bundle size, which is a lot.
More than that, this release does a lot of preparation work for Ivy in version 9, which will bring a completely new rendering layer.
Also, there is a lot of preparatory work for the introduction of Bazel in the build pipeline, which will bring us fully incremental builds (recompiling only the part of the code that changed and nothing more).
It would be for libraries like react or vue that are already small. Angular is still big enough that even after being 40kb slimmer it's still fairly huge (I think the typical build is like ~550+kb).
This means that this is now mostly transparent to developers, and taken care for us by the build pipeline without having, for example, to configure webpack and Typescript manually ourselves.
How many different builds do you emit?
Do you run into any frustrations with your user error logging tools having different stack traces?
- We want to re-write the whole thing from scratch. In TypeScript.
- And let's use Google's Closure Compiler for JavaScript. Even though it doesn't support TypeScript, modules, or anything, really from non-Google Javascript world (at the time)
- Oh. Then... Let's create a TypeScript to Closure Translator even though TypeScript doesn't let you extend the compiler and TypeScript and Closure are in general not entirely compatible
- Oh, and we use a weird combination of annotations and templates to work, so... we need to compile our templates into TypeScript (which we need to translate to Closure-compatible JavaScript which will then be compiled further down)
- Only the whole process is abysmally slow. Let's implement incremental compilation.
- It's probably still slow, complicated, and error-prone. We know! Let's use Google's Bazel! You know, the tool to build huge codebases in parallel on clusters. Yeah, why not use that to build JS code?
- Only bazel has no support for either Closure, or Javascript, or TypeScript, so we have to build tools and integrations to work with bazel!
And the quests just keep popping up.
Writing non existing tooling around some tools is almost positive as they can pave the journey to other and better tooling.
Also, I doubt you are paying a cent to those developers to justify your complaints about it.
Not trying to achieve anything. It’s my own personal opinion on how I view Angular’s development. The devs dig deeper and deeper holes to bravely climb out of them.
> Writing non existing tooling around some tools is almost positive
Since there’s no cost-benefit analysis, “almost positive” is entirely speculation.
> I doubt you are paying a cent to those developers to justify your complaints about it.
“Only paying customers are allowed to voice criticism. Please purchase a criticism package or a yearly subscription today. Volume discounts are available, contact your nearest sales representative”
With some exceptions, there is really no benefit in making a SPA but there are many drawbacks.
I don't say this lightly. I used AngularJS in 2015 and since then I've been making SPAs in React, Vue, and Inferno + Mobx.
You start out with a simple content screen. Then the client wants comments. Then they want richer comments. Then they want live comments. Etc.
Over time, most of my web applications tend to require richer and richer interactivity on each screen. As a result, it's nice to have started out with a client-side framework, rather than hitting some threshold where you suddenly need to switch things over.
Even something that seems simple like a search form can be surprisingly interactive.
You mean like Angular or Ember?
Because you can perfectly use Vue, React, Inferno, Svelte, Imba, etc, on a multiple-page application.
> With some exceptions, there is really no benefit
This is just a contradictory sentence of hyperbole. Who cares if there are plenty of use-cases to not write a SPA. There are also plenty of use-cases for it, and many benefits.
Angular is a popular library and therefore this is newsworthy and we should respect it as such instead of devolving into a played-out asymptotic argument.
I obviously disagree, but please elaborate.
What constitutes a SPA? Essentially it is a JS application that handles all route changes and in consequence also has to handle application logic, state, etc.
To be able to achieve that kind of functionality development becomes much more complex. Not only you now get all the architectural nuances of making an app, which your typical JS dev doesn't understand, but the dev workflow becomes convoluted for a number of reasons:
1. Not all browsers support the same language features and APIs which introduces the need of using transpilers like Babel or Traceur.
2. JavaScript is objectively a poor language for complex projects hence the success of alternatives like TypeScript.
3. The JavaScript standard library does not live up to the necessities of the modern front end developer which introduces the need of using and managing more dependencies. For example, after all these years there is still no native reactivity.
For these reasons we now have to use bundlers like Webpack, NPM dependencies, and a very long etcetera. Plus a continuously changing dev landscape (see React hooks for example).
It is still challenging to make an accessible SPA. Common functionalities likes control+click on a link have to be re-implemented.
Of course sending all this functionality to the client can have a serious cost in size and CPU. It's not as big in leaner frameworks/libs like Svelte but it's always there.
The initial bytes can be mitigated by using something like Webpack chunks, but again this introduces more dev complexity.
Finally, in the vast majority of cases (if not all) SPAs also render the content. This requires developing an API (GraphQL, REST, etc) which introduces another layer of complexity vs doing the rendering in the server. In some cases this is necessary as there can be various clients, but not always.
IMO all these drawbacks make sense when the SPA model is justified and there is a need for sophisticated functionalities. Gmail is the perfect example. Soundcloud is another good candidate since audio needs to keep playing at all times.
So usually the arguments in favor of an SPA are that the UX is better or that after a number of clicks the user receives less bytes compared to receiving markup.
I think that the UX benefits of a SPA are exaggerated for common use cases (e-commerce, CRUD admins, enterprise apps, marketing websites, etc). Amazon, Ebay, Wikipedia, are not SPAs and they are still getting millions of visits every day and probably growing.
As for getting the data in JSON or WebSockets vs getting HTML, yes, after a number of clicks there are some bytes savings but after having paid a high cost in initial bytes and CPU cycles. This argument could make sense in very particular use cases, but I don't think it can be applied as a general argument on all websites. It makes sense for gmail, since there is a lot of clicking around and changing views, but that's not a concern for the vast majority of websites.
I should probably write an article about this since I've left out some points and haven't gone with much depth into others... but I hope this comment conveys my position.
First I must say that this phrase: "Not only you now get all the architectural nuances of making an app, which your typical JS dev doesn't understand" is ridiculous and needlessly derogatory. There are a LOT of JS devs in the world, and the "typical" ones obviously understand this, or you wouldn't be on the internet right now. Furthermore:
1. That's why JS projects use Babel. Or Typescript.
2. This point is objectively false, given the fact that most websites you use are complex JavaScript projects. Also, yeah, there's TypeScript.
3. That's why JS projects use libraries and "more" dependencies. It's very rarely an issue.
- "we now have to use bundlers like Webpack, NPM dependencies..." Have you heard of Makefiles, unix package management tools, "and a very long etcetera"? None of this is new by any means.
- "Plus a continuously changing dev landscape" - welcome to programming. Change is a constant.
- "It is still challenging to make an accessible SPA..." Of course! it is still challenging to build products, and make good UX. Welcome to programming for users. Good luck figuring out what they want and need. There are jobs for that too.
- "sending all this functionality to the client can have a serious cost in size and CPU." Sometimes. Sometimes not. Sometimes it doesn't matter, like in most of the cases of most of the customers using SPAs. When it matters, people figure out how to solve this.
- "Finally, in the vast majority of cases (if not all) SPAs also render the content" - definitely not all, maybe JUST the majority. And... "developing an API" vs "doing the rendering in the server" is rarely an issue or conversation and basically not a valid argument.
- "Amazon, Ebay, Wikipedia, are not SPAs and they are still getting millions of visits every day and probably growing." This is a fundamental misunderstanding of what a SPA is. Of course not literally every single page on the top largest websites in the universe are consistently in one single application with only client routing. But each of them have many pieces that are. Most popular web apps are hybrids like this.
- "It makes sense for gmail, since there is a lot of clicking around and changing views, but that's not a concern for the vast majority of websites." This leads to a philosophical discussion of the difference between a website and a web application, where one is mostly reading and displaying data, and the other is "a lot of clicking around and changing views" (which, it turns out, is what many, many companies and products fundamentally are), which isn't really germane to this. It's probably safe to assume most of us are talking about the latter. We can also agree that blogs don't usually need app behavior.
Obviously, that's precisely my point.
> ...is ridiculous and needlessly derogatory. There are a LOT of JS devs in the world, and the "typical" ones obviously understand this, or you wouldn't be on the internet right now.
I admit I speak from my anecdotal experience, but probably so are you. Also because something works doesn't mean it's properly coded.
> That's why JS projects use Babel. Or Typescript.
Yes, that's what I said. My point is that needing to use Babel is not a good thing.
> This point is objectively false, given the fact that most websites you use are complex JavaScript projects. Also, yeah, there's TypeScript.
First, you don't really know which websites I use. Second, I seriously doubt HN is a complex JS project nor classic desktop Reddit or StackOverflow. Third, TypeScript precisely validates my point.
> That's why JS projects use libraries and "more" dependencies. It's very rarely an issue.
> None of this is new by any means.
> welcome to programming. Change is a constant.
No offense but that is the typical JS developer Stockholm syndrome.
Yes, obviously, there will always be change in all aspects of life. In any other language things are much more stable.
> Of course! it is still challenging to build products, and make good UX.
You are missing the point which is: SPAs are solving problems that are already solved at the browser level.
> This is a fundamental misunderstanding of what a SPA is.
Not really, you are fundamentally cherry picking. The core experience in those sites are not SPAs, it is irrelevant if they have some SPA mini site somewhere.
> This leads to a philosophical discussion of the difference between a website and a web application
Exactly, and that's my whole point.
There is an abuse of the SPA architecture for websites that are not applications. Even when the development complexity is a lot higher with not many benefits for regular websites.
It's an unusual situation perhaps, but having done similar apps with other frameworks and paradigms over the past ~10 years, Angular 2+ just feels like a good tool for the job.
Right, but you could still do server side rendering by consuming a third party API instead of a DB directly.
Maybe bloating is not an issue in some use cases, but client side rendering can have a major impact on the CPU.
I don't disagree with the bloating issue, but in this case, these are all decently capable desktops, and it hasn't been even close to a problem.
I think SPA's can be suitable (sometimes) for internal line-of-business applications, where you have a degree of control over the environment the end user will be using your application on (ie the device/browser (+version)/etc) and bandwidth isn't a big issue.
In this sort of environment, Angular can work pretty well.
For public facing applications, where you can't say with confidence that your end user will be on a modern computer, using a modern browser with a good internet connection, etc, you are better using a server-side rendering framework and progressively enhancing using something like Vue.js.
That's my 2 cents anyways.
Also Angular has helped me a lot with bowser compatiblity in the past (IE 9).
I don’t have experience with Angular Universal, I do with Nuxt (Vue SSR) and it was great, but frustrating to work with as things got more complex.
Angular as a framework doesn't prevent you from doing anything on the backend. It's all about the re-usable components imo.
At least that's why I opted to push for a SPA.
First, because the largest ecommerce websites are not SPAs and are generating a shit ton of revenue. Not only Amazon and Ebay but also stuff like Magento and Shopify.
Second, while it can be argued that after a number of clicks the total kbs will be lower by using JSON and rendering on the client, the vast majority of users really care about the initial load. Much like monthly payments, it's generally better to have a consistent 500ms lag than a 3000ms lag on the initial load and then 200ms on every click. Of course I made these numbers to explain my point.
This does not apply to all use cases obviously. In some cases such as an application like Gmail an SPA is completely justified and my arguments do not hold, but in the case of e-commerce I think there are no valid arguments for an SPA.
Outside the public sector React is a bit more popular, but it’s still mainly used outside of enterprise and Vue rarely sees any use.
The job-market doesn’t seem to follow the tech hype cycles much, at least not when you live in a country like mine.
If you know your application will have to be enterprise grade, will be large, will be developed by enterprise devs and has to be supported for years to come, Angular is still the definitive choice (IMHO). Mainly because it gives your team a clear structure to operate in combined with known concepts.
This fact about Angular doesn't surprise me. It uses TypeScript which is a Microsoft joint, and the architecture feels rather similar to the MS standard MVVM. Two way data binding in the UI, a "code-behind" in the component. And TypeScript lends a sort-of C# flavor to the framework. It takes some "enterprise" and puts it in the front-end, which can help make the transition from ASP.NET MVC or whatever to Angular a bit easier (especially as compared to something like React).
If you're already doing .NET stuff, and you need enterprise-grade front ends, Angular seems like the natural choice still. One thing about Microsoft shops (of which my employer is one) is they tend to use Microsoft for everything, and despite Angular not actually being Microsoft, TypeScript makes it close enough. I'll be curious to see if the eventual production-ready release of client-side Blazor changes the dynamic at all.
However, you can see just how popular React is by number of npm packages that depend on it: https://github.com/facebook/react
Both have a relatively high entry barrier compared to their alternatives (though lower than a few years ago).
If we are using just a couple of WebComponents with traditional server side rendering, then Vue.
The advantages of not using someone's framework, language or module system is that we have a direct and stable surface (the DOM) against which to tie things together. Complex web interactions we attempted to do (and failed to do) using Angular directives/components/etc became trivial using our vanilla+riot approach. It almost feels like cheating by comparison, and then you don't care because your incredibly-complex web interaction that involves 5+ vendor libraries and 8 nested API calls just works and is easy to inspect directly.
Obviously, you need some discipline to manage something with less structure around it, but all it takes is a handful of code review sessions to get other developers synced up on how things work in this more 'open' world. There honestly aren't a lot of new things to learn either (there are definitely more things to unlearn coming from Angular). Productivity is also a huge plus. I don't have to spend an hour reviewing the semantics around some Angular construct before I do my work. After a few weeks away from some web project, I can jump directly into the HTML/JS/CSS, crank out a new .html riot tag file and be done with it in less time than it would have taken to re-sync my brain into Angular semantics land.
If you haven't tried riot yet, you should definitely take a look. Once we got our first application working on it and we understood the basics, it felt like we had escaped from frontend jail and could do anything we wanted to. For everyone who views front-end as a mosh pit of chaos and uncertainty, I strongly suggest trying this approach out on a throwaway project when you get some free time.
I wanted to try Riot but then I saw they were working on v4 with the Simulacra guy and decided to wait until the new version.
While none of the extra complexity is crucial to making a dynamic website, it earns its keep when you try to build a big online application. Why not just learn that stuff.
I think all the bundled pre-built functionality, like reactive forms, is the hardest part of Angular. That can be tedious to learn. But then again, so is 3rd party library X, so it's a wash.
Factories are no longer in Angular 2
JSX, components, props, context, error boundaries, forwarding refs, fragments, higher-order components, container.
Once you add in concepts from the other libraries commonly used with React like mobx or redux I think the comparison isn't as clearcut.
In any case - angular has no one author and it is moving to the Svelte direction of rendering with Ivy which is to be released in next major version.
That said, Angular doesn't utilize its compiler the same way Svelte does (yet) so time will tell.
To me, Angular is what HTML and the DOM would look like if they had been designed from the beginning for application development:
- Custom elements backed by controller classes. - Data-binding and event-binding syntax baked into HTML - Component style encapsulation, on by default.
React seems far more like a project created by people who dislike front-end development: As I recall the genesis of the project was to replace traditional DOM mutation with a more PHP-esque approach of updating state and re-rendering everything, just as you would do on the back-end.
I used to love angular, then I got a job which was a “| async” dumpster fire and spent a year watching a team of smart c# developers wallow in a mire of disaster so bad it became a two week regression to change a text field on a form. So full of amazing functional statement no one, even the original authors, could touch it without breaking something in the process.
so.
Your milage may vary. I no longer particularly like angular, personally, because I find it a chore to herd inexperienced FactoryInjectorConstructorFactoryPattern angular developers into not screwing things up.
...but talented team can do well with it too, and I’ve seen people screw up react projects too.
It really is more about good practice and experience than framework, your personal preference is probably, like mine, basically irrelevant.
Decorators aren't inheritable or composable. Because templates are strings, you need the hacky DI and superfluous module system to avoid tag name clashes.
As for React, it is nothing like PHP. JSX is a macro for function calls that return objects; as such they are first-class data structures with all of the benefits you would expect. Yes, it is just a view layer and you need to bring more stuff in if you have a big project planned.
If angular floats your boat that's great. The last time I used it was in a team of mostly C#, Java and Python enthusiasts. Once they figured out what was es2015, what was typescript, and what was Angual, the dev experience was generally reviled. (especially once they saw some react code). I generally don't say that I won't work with a technology, but after a year with it (and having years for AngularJS/1.x, React, Ember, Vue and Backbone under my toolbelt) I am content with saying that Angular sits with Backbone at the bottom of the pile of what I would choose to use again.
This is a really poor characterization. I started using React because I love front-end and it was exactly what I wanted front-end development to be. It solved every one of the pain-points I was experiencing with a jQuery/Backbone/Handlebars stack.
It feels like the people who meme about EnterpriseFactoryFactory at times just haven't hit the right use case for it.
Being familiar to a large base of existing developers is a huge feature.
My main gripe with Angular (vs. React) has been the lack of first class support for patterns (higher order components) that have been a boon for React. It does look like Angular will have more 1st class support with Ivy[1], however, higher order components are so simple with React (and even better with TS/React).
[1]: https://blog.nrwl.io/metaprogramming-higher-order-components...
And this
> (although the trend is to move away from them for performance and simplicity reasons)
Make me very frustrated because things like react became very popular for their simplicity. I read the reasoning the react team gave for hooks and I am not sure it justifies having such vastly different way of building components.
I do not think that react classes will go away anytime soon. you can't represent state without them.
edit: Lol apparently two React devs ears were burning at the same time.
also btw: https://reactjs.org/docs/hooks-faq.html#do-i-need-to-rewrite...
and I still have no idea how I only do stuff on the client in a SSR environment (stuff that i did in componentDidMount)
The 'useEffect' hook - it won't be executed if you use e.g. ReactDOMServer.renderToString() for SSR
useEffect(() => {
console.log('Client side only');
}, []);
Codesandbox: https://codesandbox.io/s/peaceful-dew-nvw83A better example (from the video "React Today and Tomorrow and 90% Cleaner React With Hooks" from October[1]) is something along the lines of updating document.title = `${some} Page` or possibly calling an API.
I think it's clear from the parent I was responding to that they have better use-cases in mind :)
https://github.com/sveltejs/realworld/blob/master/src/routes...
Personally I’ve found debugging and dealing with anything non-standard in React to quickly turn into a huge mess (but given all the praise heaped on it by other developers I know, I’m willing to concede that I might be doing it wrong).
Then "C++ with inline assembler" is also a single language? What about English with quotes in Japanese?
A less flippant analogy might be macro support in Rust. It's clearly part of Rust, but the syntax is completely different and it requires IDEs to have completely separate processing just to handle it. I wouldn't consider that to be mere syntactic sugar either.
[1] Yes, yes, wasm
JS and TS aren't isomorphic (there's no inverse morphism once you go TS->JS that can bring the resulting JS back to the original TS) hence why TS is a different language (even if a superset of and compiled to JS).
They are not
Or, if they are, they are in the same way of a custom XML templating language that can be translated to a specific javascript library implementation and then back to XML
In the same way, is Mustache isomorphic?
"{{title}} spends {{calc}}"
can be translated to `${title} spends ${calc}`
and back to "{{title}} spends {{calc}}"You may argue that JSX is a single language, but that is irrelevant since you still need to understand HTML and CSS.