Slide 1

Slide 1 text

RainerHahnekamp Modern Angular Rainer Hahnekamp 21. May 2024

Slide 2

Slide 2 text

RainerHahnekamp About Me... Professional NgRx https://www.youtube.com/ @RainerHahnekamp https://www.ng-news.com https://github.com/softarc-consulting/sheriff ● Rainer Hahnekamp ANGULARarchitects.io ● Developer / Trainer / Speaker Modern Spring for Angular @RainerHahnekamp

Slide 3

Slide 3 text

RainerHahnekamp The Goal

Slide 4

Slide 4 text

RainerHahnekamp

Slide 5

Slide 5 text

RainerHahnekamp Agenda ● Standalone Components ● Standalone API ● Functional Interceptors and Guards ● Template Blocks ● SSR ● Signals ● New API

Slide 6

Slide 6 text

RainerHahnekamp Standalone Components ● Easier ● Good for Non-Mocking Tests ● Exclusive Features (@defer, Host Directives) ● No Impact on Bundle Size or Performance ● Future Version require {standalone: false}

Slide 7

Slide 7 text

RainerHahnekamp Standalone API ● Separation of Services and Components ● Better Tree-Shakability ● provideHttpClient ● provideRouter & lazy Routes

Slide 8

Slide 8 text

RainerHahnekamp inject ● Pros ○ DI in functions ○ Independent of Decorator Standardization ○ Type at Runtime available ○ Easier Inheritance ○ Type-Safe Injection Tokens ● Cons ○ Requires TestBed ○ Two Ways on how to things

Slide 9

Slide 9 text

RainerHahnekamp Functional HttpInterceptors & RouterGuards ● Functions ● Simpler ● Guard Class deprecated ● Only work with inject()

Slide 10

Slide 10 text

RainerHahnekamp Template Blocks (@if, @for, @switch) ● Replaces Structural Directives for Control Flow ● Better Options ○ if/else if/else ○ tracking ● Zoneless ● Execute during Compilation ● Better DX ● More to come… ○ @defer ○ @let (18.1)

Slide 11

Slide 11 text

RainerHahnekamp Signals ● Optimized for Frontend ● Reactive Alternative to RxJs ● Manages State ● Simple ○ signal: writable ○ computed: read-only & derived ○ effect: side effects ● Improved DX ● Local Change Detection (v17) ● Triggers Change Detection(v18)

Slide 12

Slide 12 text

RainerHahnekamp Signal-based API ● input() ● model() ● viewChild() & contentChild() ● output() (doesn't return a Signal)

Slide 13

Slide 13 text

RainerHahnekamp SSR & Hydration ● Cooperation with Wiz ● Important for Internet-facing apps ● Evolution ○ Destructive Hydration (Community-based) ○ Default Hydration ○ Partial Hydration (@defer-based) ● Challenges ○ User-based Context ○ Asynchronous Tasks ○ DOM Access