Slide 1

Slide 1 text

ngular Renaissance

Slide 2

Slide 2 text

Tools & Resources Agenda DI Debugging vite + esbuild angular.dev Features Lazy Loaded Animations Built-In Control Flow Input Transforms View Transition API New Life Cycle Hooks Server-Side Rendering SignalsQ&A

Slide 3

Slide 3 text

@GregOnNet Gregor Woiwode, CTO Find me after the talk and say hi!

Slide 4

Slide 4 text

angular.dev Tutorials Playground BETA NEW NEW

Slide 5

Slide 5 text

Vite & esbuild https://blog.angular.io/introducing-angular-v17-4d7033312e4b

Slide 6

Slide 6 text

vite & esbuild https://angular.io/guide/esbuild#using-the-application-builder Configure application builder deployURL wont work, anymore

Slide 7

Slide 7 text

Vite & esbuild built-time decreases by 70%

Slide 8

Slide 8 text

DI Debugging New Feature in Angular DevTools Visualize your application’s hierarchy Only supported in Angular 17

Slide 9

Slide 9 text

DI Debugging TvView

Slide 10

Slide 10 text

Short Demo

Slide 11

Slide 11 text

Input Transforms Imagine, you want to offer the following Component-API.

Slide 12

Slide 12 text

Input Transforms … You would need to enhance the setter of the respective @Input.

Slide 13

Slide 13 text

Input Transforms Now you can configure a middleware

Slide 14

Slide 14 text

Input Transforms booleanAttribute & numberAttribute are provided by @angular/core You can write your own transformations, too. Custom transforms need to be statically analyzable by the compiler.

Slide 15

Slide 15 text

Short Demo

Slide 16

Slide 16 text

Built-In Control Flow Syntax

Slide 17

Slide 17 text

Built-In Control Flow Performance enhancements, especially @for. No fiddling with NgFor, NgIf, NgSwitch-Imports https://blog.angular.io/introducing-angular-v17-4d7033312e4b

Slide 18

Slide 18 text

Built-In Control Flow DEVELOPER PREVIEW Migrate to the new Control Flow Syntax using the Schematic.

Slide 19

Slide 19 text

Code Journey

Slide 20

Slide 20 text

Async AnimationsModule Loads Angular’s Animations lazily Reduces your initial bundle size by 60KB

Slide 21

Slide 21 text

Async AnimationsModule Main Bundle decreased More Chunks generated Initial Bundle Decreased by 55.16KB

Slide 22

Slide 22 text

View Transition API https://developer.chrome.com/docs/web-platform/view-transitions/ Web Standard to animate view transitions

Slide 23

Slide 23 text

View Transition API Declare groups that should be animated Image are taken behind the scenes, which are then animated

Slide 24

Slide 24 text

View Transition API Activate View Transitions

Slide 25

Slide 25 text

Short Demo

Slide 26

Slide 26 text

New LifeCycle hooks afterNextRender & afterRender Only executed on the Browser Executed after ChangeDetection Intended to read/write the DOM Fine grained control when these hooks are executed to optimize performance

Slide 27

Slide 27 text

New LifeCycle hooks afterNextRender afterRender Executed once For Initialization Executed after each detected change Sync Changes with DOM

Slide 28

Slide 28 text

New LifeCycle hooks What is the difference between afterNextRender & AfterViewInit? Only executed in the Browser Executed on the server, too.

Slide 29

Slide 29 text

New LifeCycle hooks https://dev.to/railsstudent/dom-reading-and-writing-with-new-lifecycle-hooks-in-angular-4n7e

Slide 30

Slide 30 text

New LifeCycle hooks AfterRenderPhase.EarlyRead AfterRenderPhase.Write AfterRenderPhase.MixedReadWrite AfterRenderPhase.Read https://angular.io/api/core/AfterRenderPhase can significantly degrade performance! Please Refactor! can degrade performance! Use built-in browser functionality

Slide 31

Slide 31 text

Quiz AfterRenderPhase.Write AfterRenderPhase.Write

Slide 32

Slide 32 text

Server Side Rendering Strategic change NEW @nguniversal/express-engineMAINTANANCE MODE @angular/ssr package

Slide 33

Slide 33 text

Short Demo

Slide 34

Slide 34 text

Gregor Woiwode, CTO Slides

Slide 35

Slide 35 text

Further Reading Lazy Loading with @defer https://angularexperts.io/blog/angular-defer-lazy-loading-total-guide Angular 17 View Transition API https://netbasal.com/angular-v17s-view-transitions-navigate-in-elegance-f2d48fd8ceda View Transition API https://developer.chrome.com/docs/web-platform/view-transitions/ afterNextRender & afterRender use case: chart.js https://dev.to/railsstudent/dom-reading-and-writing-with-new-lifecycle-hooks-in-angular-4n7e Lazy Loaded Animations https://riegler.fr/blog/2023-10-04-animations-async https://www.youtube.com/watch?v=8-KxBmiPbCk

Slide 36

Slide 36 text

Further Reading Rich Harris on framework, the web, on the edge https://youtube.com/watch?v=uXCipjbcQfM Making the Case for Signals in JavaScript https://dev.to/this-is-learning/making-the-case-for-signals-in-javascript-4c7i The evolution of Signals https://dev.to/this-is-learning/the-evolution-of-signals-in-javascript-8ob