Angular Renaissance

Rate this content
Bookmark
The video covers a range of topics related to Angular and its advancements. It explains how Angular and React have similar reactivity models, emphasizing the importance of keeping state inside components in sync with the UI. The concept of Angular signals is introduced, which optimizes change detection by wrapping component state and notifying the framework of its usage. Deferrable views are discussed as a way to improve initial load times by lazily loading specific parts of the template. The video also highlights Angular's collaboration with WIS within Google, leading to performance improvements like better input latency on low-end smart TVs and smoother swiping on YouTube mobile web. Angular's updated build pipeline using Vite and ESbuild is mentioned, resulting in faster build speeds. The idea of partial hydration is explained, which allows only certain parts of the UI to be hydrated initially, speeding up the time to interactivity. Additionally, the video touches on the integration of signals with RxJS and the potential for making RxJS optional. The talk concludes with insights into Angular's future plans, including the release of a developer preview for partial iteration and the ongoing collaboration with other frameworks and teams.

From Author:

For the past 18 months Angular has been experiencing a lot of momentum that the community has been referring to as the "Angular Renaissance."

In this talk we'll see how this manifests in improvements in developer experience, performance, documentation, and a better look!

This talk has been presented at JSNation 2024, check out the latest edition of this JavaScript Conference.

FAQ

Minko is the product lead for Angular at Google, responsible for determining what features to build for Angular, why to build them, and how to share them with developers.

Despite differences in syntax, Angular and React have similar reactivity models. Both frameworks keep the state inside components in sync with the UI by traversing the component tree to detect and reflect state changes.

Zone.js in Angular is a library that helps to detect when something might have changed in the application so that Angular can schedule change detection accordingly.

Signals in Angular are used to wrap local component state, notifying the framework when and where the state is used, thus optimizing performance by limiting change detection to only the affected parts of the component tree.

Angular and WIS collaborate closely within Google, sharing code and features to meet the blended requirements of enterprise and consumer client applications. For instance, YouTube has adopted Angular signals through WIS for better performance.

Deferrable views in Angular allow developers to specify parts of the template that can be lazily loaded, improving initial load times by extracting these parts as separate bundles that are loaded only when required.

YouTube observed significant performance improvements with Angular signals, including 35% better input latency on low-end smart TVs and 60 frames per second swiping on YouTube mobile web compared to 25 frames per second with the legacy virtual DOM implementation.

Angular has updated its build pipeline to use Vite and ESbuild out of the box, resulting in faster build speeds. For example, Vanguard reported a threefold improvement in build speeds after switching to the new build pipeline.

Partial hydration in Angular is a feature that allows only certain parts of the UI to be hydrated initially, reducing the amount of JavaScript that needs to be loaded and executed, thus speeding up the time to interactivity.

Angular aims to make RxJS optional, providing better integration with signals. Developers can convert signals to observables and vice versa, allowing flexibility in using either approach based on their needs.

Minko Gechev
Minko Gechev
29 min
13 Jun, 2024

Comments

Sign in or register to post your comment.

Video Transcription

Available in Español: Renacimiento de Angular

1. Introduction to Angular and React

Short description:

I'm the product lead for Angular at Google. Angular and React were effectively the same framework. Over 50% of the responsibility of a front-end framework is to keep state inside components in sync with the UI.

My name is Minko, as you heard, I'm the product lead for Angular at Google, which means I'm accountable for what we build for Angular, why, and how we share it with developers.

So the community has been talking lately about this Angular renaissance. And you might be wondering what actually changed in Angular. What happened? Well, really, a lot happened, and I really can't wait to share with you. So last year, Angular and React were effectively the same framework.

Now, this may sound weird, because React has JSX and functions, Angular uses templates and classes for components, how possibly they could be even remotely connected? Well, when you're building your application, this is different, but at runtime, things are very much the same. I would say over 50 per cent of the responsibility of a front-end framework is to keep your state inside of your components in sync with the UI.

2. Reactivity in Angular and React

Short description:

When building an application, the framework turns components into a tree and reflects state changes in the UI. Angular and React have a similar model of reactivity, traversing the component tree to find changes and update the UI. A practical example demonstrates how this works, with the framework optimizing change detection. Performance benchmarks show Angular and React with similar patterns. Traversing larger component trees in real-world applications can be more complex.

So when you build your application, you use whatever format, altering format you have in your framework. From there, at runtime, the framework turns these components into a component tree. And when something happens, when the state changes, the framework is going to reflect the state's change in the UI, and in the front-end world, we refer to this as reactivity.

Surprisingly, Angular and React have been having a similar model over the past couple of years. Let's look at how reactivity works. First, we specify that something has changed. In React, we do that explicitly. In Angular, there is something called zone.js that tries to figure out when something might have changed so that it can schedule from here a change detection or reconciliation where we are traversing this entire component tree in order to figure out all the places where it might have changed, where it may have stayed updated, go to the UI, and updated on. That's pretty much it.

Let's look at a more practical example to see how this works in practice. We have an app component here that uses two components, the user profile and the shopping card components. The user profile is pretty simple, just displays the user name, and the shopping cart goes through the list of items in the shopping cart, and for which one of them it displays the quantity. In turn, the framework is going to turn this into a tree. We have the app component at the top. On the left, we have the user profile component, and on the right, we have the shopping cart.

Now, if something changes, let's say we update the quantity for the first item in the shopping cart, both Angular and React are going to start traversing this tree, trying to find what changed. First, they're going to go to the app component even though it didn't change. After that, they're going to perform that first traversal, so they're going to go to the user profile component even though nothing changed there as well, and finally, they're then going to go to the shopping cart component and reflect the update. Now, both in Angular and React, we have a way to manually optimise this. In Angular, we have own push change detection strategy. In React, we can use memorisation. This allows us to prune parts of this component tree, so we're going to perform change detection or reconciliation only in the app component, and in the shopping cart component. If you don't trust me yet that Angular and React are very much the same in how they perform reactivity, let us look at some performance benchmarks. You can see that Angular and React have a very similar performance pattern right here. Both of them are not doing great on swapping rows, and they're doing all right for partial updates. Now, these are benchmarks with the legacy Angular control flow, so we optimise things since then, but that's how things worked last year. With this example, traversing this component tree with three elements, it doesn't seem like a big deal, right? We just traverse three elements and we check for state updates. But real-world applications are not really that simple. We have way larger component trees. Here we have over 100 components, and I know this because I put this tree by hand while flying to the conference.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Building Better Websites with Remix
React Summit Remote Edition 2021React Summit Remote Edition 2021
33 min
Building Better Websites with Remix
Top Content
Remix is a web framework built on React Router that focuses on web fundamentals, accessibility, performance, and flexibility. It delivers real HTML and SEO benefits, and allows for automatic updating of meta tags and styles. It provides features like login functionality, session management, and error handling. Remix is a server-rendered framework that can enhance sites with JavaScript but doesn't require it for basic functionality. It aims to create quality HTML-driven documents and is flexible for use with different web technologies and stacks.
Speeding Up Your React App With Less JavaScript
React Summit 2023React Summit 2023
32 min
Speeding Up Your React App With Less JavaScript
Top Content
Watch video: Speeding Up Your React App With Less JavaScript
Mishko, the creator of Angular and AngularJS, discusses the challenges of website performance and JavaScript hydration. He explains the differences between client-side and server-side rendering and introduces Quik as a solution for efficient component hydration. Mishko demonstrates examples of state management and intercommunication using Quik. He highlights the performance benefits of using Quik with React and emphasizes the importance of reducing JavaScript size for better performance. Finally, he mentions the use of QUIC in both MPA and SPA applications for improved startup performance.
Full Stack Documentation
JSNation 2022JSNation 2022
28 min
Full Stack Documentation
Top Content
The Talk discusses the shift to full-stack frameworks and the challenges of full-stack documentation. It highlights the power of interactive tutorials and the importance of user testing in software development. The Talk also introduces learn.svelte.dev, a platform for learning full-stack tools, and discusses the roadmap for SvelteKit and its documentation.
SolidJS: Why All the Suspense?
JSNation 2023JSNation 2023
28 min
SolidJS: Why All the Suspense?
Top Content
Suspense is a mechanism for orchestrating asynchronous state changes in JavaScript frameworks. It ensures async consistency in UIs and helps avoid trust erosion and inconsistencies. Suspense boundaries are used to hoist data fetching and create consistency zones based on the user interface. They can handle loading states of multiple resources and control state loading in applications. Suspense can be used for transitions, providing a smoother user experience and allowing prioritization of important content.
From GraphQL Zero to GraphQL Hero with RedwoodJS
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
From GraphQL Zero to GraphQL Hero with RedwoodJS
Top Content
Tom Pressenwurter introduces Redwood.js, a full stack app framework for building GraphQL APIs easily and maintainably. He demonstrates a Redwood.js application with a React-based front end and a Node.js API. Redwood.js offers a simplified folder structure and schema for organizing the application. It provides easy data manipulation and CRUD operations through GraphQL functions. Redwood.js allows for easy implementation of new queries and directives, including authentication and limiting access to data. It is a stable and production-ready framework that integrates well with other front-end technologies.
RedwoodJS: The Full-Stack React App Framework of Your Dreams
React Summit Remote Edition 2021React Summit Remote Edition 2021
43 min
RedwoodJS: The Full-Stack React App Framework of Your Dreams
Top Content
Redwood JS is a full stack React app framework that simplifies development and testing. It uses a directory structure to organize code and provides easy data fetching with cells. Redwood eliminates boilerplate and integrates Jest and Storybook. It supports pre-rendering and provides solutions for authentication and deployment. Redwood is a cross-client framework that allows for building web and mobile applications without duplicating work.

Workshops on related topic

Building WebApps That Light Up the Internet with QwikCity
JSNation 2023JSNation 2023
170 min
Building WebApps That Light Up the Internet with QwikCity
Featured WorkshopFree
Miško Hevery
Miško Hevery
Building instant-on web applications at scale have been elusive. Real-world sites need tracking, analytics, and complex user interfaces and interactions. We always start with the best intentions but end up with a less-than-ideal site.
QwikCity is a new meta-framework that allows you to build large-scale applications with constant startup-up performance. We will look at how to build a QwikCity application and what makes it unique. The workshop will show you how to set up a QwikCitp project. How routing works with layout. The demo application will fetch data and present it to the user in an editable form. And finally, how one can use authentication. All of the basic parts for any large-scale applications.
Along the way, we will also look at what makes Qwik unique, and how resumability enables constant startup performance no matter the application complexity.
Back to the Roots With Remix
React Summit 2023React Summit 2023
106 min
Back to the Roots With Remix
Featured Workshop
Alex Korzhikov
Pavlik Kiselev
2 authors
The modern web would be different without rich client-side applications supported by powerful frameworks: React, Angular, Vue, Lit, and many others. These frameworks rely on client-side JavaScript, which is their core. However, there are other approaches to rendering. One of them (quite old, by the way) is server-side rendering entirely without JavaScript. Let's find out if this is a good idea and how Remix can help us with it?
Prerequisites- Good understanding of JavaScript or TypeScript- It would help to have experience with React, Redux, Node.js and writing FrontEnd and BackEnd applications- Preinstall Node.js, npm- We prefer to use VSCode, but also cloud IDEs such as codesandbox (other IDEs are also ok)
Monitoring 101 for React Developers
React Summit US 2023React Summit US 2023
107 min
Monitoring 101 for React Developers
Top Content
WorkshopFree
Lazar Nikolov
Sarah Guthals
2 authors
If finding errors in your frontend project is like searching for a needle in a code haystack, then Sentry error monitoring can be your metal detector. Learn the basics of error monitoring with Sentry. Whether you are running a React, Angular, Vue, or just “vanilla” JavaScript, see how Sentry can help you find the who, what, when and where behind errors in your frontend project. 
Workshop level: Intermediate
Get started with AG Grid Angular Data Grid
JSNation 2022JSNation 2022
116 min
Get started with AG Grid Angular Data Grid
WorkshopFree
Stephen Cooper
Stephen Cooper
Get started with AG Grid Angular Data Grid with a hands-on tutorial from the core team that will take you through the steps of creating your first grid, including how to configure the grid with simple properties and custom components. AG Grid community edition is completely free to use in commercial applications, so you’ll learn a powerful tool that you can immediately add to your projects. You’ll also discover how to load data into the grid and different ways to add custom rendering to the grid. By the end of the workshop, you will have created and customized an AG Grid Angular Data Grid.
Contents:- getting started and installing AG Grid- configuring sorting, filtering, pagination- loading data into the grid- the grid API- add your own components to the Grid for rendering and editing- capabilities of the free community edition of AG Grid
Micro-Frontends with Module Federation and Angular
JSNation Live 2021JSNation Live 2021
113 min
Micro-Frontends with Module Federation and Angular
Workshop
Manfred Steyer
Manfred Steyer
Ever more companies are choosing Micro-Frontends. However, they are anything but easy to implement. Fortunately, Module Federation introduced with webpack 5 has initiated a crucial change of direction.
In this interactive workshop, you will learn from Manfred Steyer -- Angular GDE and Trusted Collaborator in the Angular team -- how to plan and implement Micro-Frontend architectures with Angular and the brand new webpack Module Federation. We talk about sharing libraries and advanced concepts like dealing with version mismatches, dynamic Module Federation, and integration into monorepos.
After the individual exercises, you will have a case study you can use as a template for your projects. This workshop helps you evaluate the individual options for your projects.
Prerequisites:You should have some experience with Angular.
Let AI Be Your Docs
JSNation 2024JSNation 2024
69 min
Let AI Be Your Docs
Workshop
Jesse Hall
Jesse Hall
Join our dynamic workshop to craft an AI-powered documentation portal. Learn to integrate OpenAI's ChatGPT with Next.js 14, Tailwind CSS, and cutting-edge tech to deliver instant code solutions and summaries. This hands-on session will equip you with the knowledge to revolutionize how users interact with documentation, turning tedious searches into efficient, intelligent discovery.
Key Takeaways:
- Practical experience in creating an AI-driven documentation site.- Understanding the integration of AI into user experiences.- Hands-on skills with the latest web development technologies.- Strategies for deploying and maintaining intelligent documentation resources.
Table of contents:- Introduction to AI in Documentation- Setting Up the Environment- Building the Documentation Structure- Integrating ChatGPT for Interactive Docs