Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Angular‘s Future with Ivy @ngPoland 2020
Search
Manfred Steyer
PRO
November 19, 2020
Programming
0
230
Angular‘s Future with Ivy @ngPoland 2020
Manfred Steyer
PRO
November 19, 2020
Tweet
Share
More Decks by Manfred Steyer
See All by Manfred Steyer
The New NGRX Signal Store for Angular: 3+n Flavors of the Signal Store
manfredsteyer
PRO
0
2
Micro Frontends with Modern Angular and Island Architectures @ijs London 2024
manfredsteyer
PRO
0
75
Modern State Management in Angular: 3+n Flavors of the Signal Store @ijs London 2024
manfredsteyer
PRO
0
75
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
240
Migrating to Signals: A Practical Workshop
manfredsteyer
PRO
0
410
Micro Frontends with Web Standards
manfredsteyer
PRO
1
290
The New NGRX Signal Store for Angular: 3+n Flavors
manfredsteyer
PRO
1
220
Leveraging the new NGRX Signal Store
manfredsteyer
PRO
0
170
Modern State Management in Angular: The 3+n Flavors of the NGRX Signal Store
manfredsteyer
PRO
0
110
Other Decks in Programming
See All in Programming
Goのエラースタックトレースの歴史と今後
sonatard
6
740
1BRC--Nerd Sniping the Java Community
gunnarmorling
0
340
⼤規模⾔語モデルの拡張(RAG)が 終わったかも知れない件について
nearme_tech
23
15k
チーム力を高めるスクラム実践法:カンバン公開と課題攻略について - ニフティのスクラムトーク Vol. 2 - NIFTY Tech Talk #18
niftycorp
PRO
1
110
VSCodeでのDatabricks開発もお勧めしたい/I would also recommend Databricks development with VSCode.
kazumain
0
250
VS Code をプロダクトにどう取り込むか
onomax
1
350
見た目から始める生産性向上
ikumatadokoro
7
780
Code Reviews
bkuhlmann
4
890
PHP8.3の機能を振り返る / Review of PHP 8.3 features
seike460
PRO
1
110
Ruby Function Composition
bkuhlmann
1
330
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
480
코틀린으로 멀티플랫폼 만들기
pangmoo
0
140
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
123
8.5k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
220
21k
Principles of Awesome APIs and How to Build Them.
keavy
120
16k
10 Git Anti Patterns You Should be Aware of
lemiorhan
647
58k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
BBQ
matthewcrist
80
8.8k
Optimising Largest Contentful Paint
csswizardry
7
2.3k
Web Components: a chance to create the future
zenorocha
305
41k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
124
32k
Bash Introduction
62gerente
604
210k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Transcript
@ManfredSteyer ManfredSteyer Manfred Steyer, ANGULARarchitects.io Angular‘s Future with Ivy: Outlooks
and Prophecies
@ManfredSteyer Ivy Compiler Leads to Smaller Bundles Up to 40%
less bundle size!
@ManfredSteyer
@ManfredSteyer DEMO
@ManfredSteyer
@ManfredSteyer Contents Lazy Components Dynamic Components Higher Order Components Standalone
Components Zone-less Angular
@ManfredSteyer Manfred Steyer
@ManfredSteyer
@ManfredSteyer Lazy Load an Ivy Component import('../dashboard-tile/dashboard-tile.component').then(m => { […]
}
@ManfredSteyer Lazy Load an Ivy Component import('../dashboard-tile/dashboard-tile.component').then(m => { const
comp = m.DashboardTileComponent; […] }
@ManfredSteyer Lazy Load an Ivy Component import('../dashboard-tile/dashboard-tile.component').then(m => { const
comp = m.DashboardTileComponent; const factory = this.cfr.resolveComponentFactory(comp); […] } ComponentFactoryResolver (Injected)
@ManfredSteyer Lazy Load an Ivy Component import('../dashboard-tile/dashboard-tile.component').then(m => { const
comp = m.DashboardTileComponent; const factory = this.cfr.resolveComponentFactory(comp); const compRef = this.viewContainer.createComponent( factory, null, this.injector); } Get via @ViewChild(…)
@ManfredSteyer DEMO
@ManfredSteyer
@ManfredSteyer Why Does This Work with Ivy? With Ivy, the
component is self-describing Remember: Component.ɵcmp Principle: Locality Before Ivy: Metadata within NgModules
@ManfredSteyer Potential Lazy Loading ;-) Partial Hydration
@ManfredSteyer Don't use them in production! No guarantees these features
will ever land in Angular!
@ManfredSteyer
@ManfredSteyer Dynamic Component export function create() { […] }
@ManfredSteyer Dynamic Component export function create() { class DynamicComponent implements
OnInit { […] } […] }
@ManfredSteyer Dynamic Component export function create() { class DynamicComponent implements
OnInit { […] } […] DynamicComponent.ɵcmp = […]; […] }
@ManfredSteyer Dynamic Component export function create() { class DynamicComponent implements
OnInit { […] } […] DynamicComponent.ɵcmp = […]; return DynamicComponent; }
@ManfredSteyer Higher-Order Component export function create(otherComponent: Type<any>) { class DynamicComponent
implements OnInit { […] } […] DynamicComponent.ɵcmp = […]; return DynamicComponent; }
@ManfredSteyer Higher-Order Component export function create(otherComponent: Type<any>) { class DynamicComponent
implements OnInit { […] } […] DynamicComponent.ɵcmp = […]; return DynamicComponent; } Call otherComponent in template function
@ManfredSteyer DEMO
@ManfredSteyer Potential More dynamic Framework extensions
@ManfredSteyer
@ManfredSteyer Composing Components DashboardTileComponent 3x BarComponent
@ManfredSteyer Defining a Component's "Neighborhood" DashboardTileComponent.ɵcmp
@ManfredSteyer Defining a Component's "Neighborhood" DashboardTileComponent.ɵcmp.directiveDefs = [ […] ];
@ManfredSteyer Defining a Component's "Neighborhood" DashboardTileComponent.ɵcmp.directiveDefs = [ BarComponent.ɵcmp ];
Type Assertions ("type casts") not shown here …
@ManfredSteyer Grouping Components import { BarComponent } from "./bar.component"; export
const BAR_COMPONENTS = [ BarComponent, […] ]; index.ts
@ManfredSteyer @Component({ […], deps: [ ...BAR_COMPONENTS ] }) export class
DashboardTileComponent { […] } Proposal
@ManfredSteyer DEMO
@ManfredSteyer
@ManfredSteyer Bootstrapping platformBrowserDynamic().bootstrapModule(AppModule);
@ManfredSteyer Bootstrapping ɵrenderComponent(MyAngularComponent);
@ManfredSteyer Potential Project Structure: Libs and/or Barrels (index.ts) Standalone Components
-> Web Components
@ManfredSteyer
@ManfredSteyer What is Zone.js? Key to automatic change detection Monkey-patches
all browser objects
@ManfredSteyer Downsides 100+ KB (uncompressed): Web Components? Money Patching: Magic
Cannot monkey patch native async/ await (ES 2017)
@ManfredSteyer Mark Components as Dirty import { ɵmarkDirty } from
'@angular/core'; […] ɵmarkDirty(this /* <-- Component */);
@ManfredSteyer DEMO
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer
@ManfredSteyer Conclusion Fine grained lazy loading --> Partial hydration Dynamic
and higher order components --> Framework extensions Standalone components --> Structure with barrels and libs Zone-less: Future-proof General: More lightweight
@ManfredSteyer "Your future hasn't been written yet!" Emmet Brown, PhD
@ManfredSteyer d Slides & Examples Public: Frankfurt, Munich, Vienna In-House:
everywhere