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
Lazy Loading en Just Angular : Aïe ?
Search
igor
June 27, 2017
Programming
0
110
Lazy Loading en Just Angular : Aïe ?
igor
June 27, 2017
Tweet
Share
More Decks by igor
See All by igor
Java REST client with Feign
ilaborie
0
53
3h pour développer un microservice avec SparkJava et Feign
ilaborie
1
480
Feign Live
ilaborie
0
160
Other Decks in Programming
See All in Programming
あのころの iPod を どうにか再生させたい
orumin
2
2.4k
Infer入門
riru
4
1.4k
プロダクトという一杯を作る - プロダクトチームが味の責任を持つまでの煮込み奮闘記
hiliteeternal
0
450
バイブコーディングの正体——AIエージェントはソフトウェア開発を変えるか?
stakaya
5
860
DynamoDBは怖くない!〜テーブル設計の勘所とテスト戦略〜
hyamazaki
0
200
令和最新版手のひらコンピュータ
koba789
13
7.4k
新しいモバイルアプリ勉強会(仮)について
uetyo
1
250
オホーツクでコミュニティを立ち上げた理由―地方出身プログラマの挑戦 / TechRAMEN 2025 Conference
lemonade_37
2
460
STUNMESH-go: Wireguard NAT穿隧工具的源起與介紹
tjjh89017
0
350
実践!App Intents対応
yuukiw00w
1
230
iOS開発スターターキットの作り方
akidon0000
0
240
Portapad紹介プレゼンテーション
gotoumakakeru
1
120
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
760
The Cost Of JavaScript in 2023
addyosmani
51
8.8k
Visualization
eitanlees
146
16k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Thoughts on Productivity
jonyablonski
69
4.8k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
110
19k
GitHub's CSS Performance
jonrohan
1031
460k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
Building Adaptive Systems
keathley
43
2.7k
Become a Pro
speakerdeck
PRO
29
5.5k
Transcript
Lazy Loading en Just Angular : Aïe ? 27 Juin
2017
$ whoami Igor Laborie Expert Java & Web @ @ilaborie
✉
[email protected]
Roadmap 1. Être Lazy en TypeScript 2. Activer le lazy-loading
3. Stratégies de chargement 4. Dépendances paresseuses Photo de Natalie Fox on Unsplash
Être lazy en TypeScript Paresseux à gorge brune (Bradypus variegatus)
Lac Gatun, République de Panama Attribution: Tauchgurke [Public domain], via Wikimedia Commons
Live Coding Photo de Claudiu Lupu de Unsplash
Bilan sur le Lazy-Loading • gagner du temps • gagner
de la mémoire • permet le traitement sur des flux ∞ • un peu moins lisible • le Supplier doit être sans effets de bord
Activer le lazy-loading Paresseux à 2 doigts (Choloepus didactylus) Zoo
de Buffalo, New York By Dave Pape (Own work) [Public domain], via Wikimedia Commons
Live Coding Photo de Claudiu Lupu de Unsplash
Mesures * aucun animal n'a été maltraité durant les builds
0 & 1: module B (material) 2: module C (d3js) 3: module A
Plutôt facile • lié aux modules et aux routes =>
maîtriser les modules, le routing => bien modéliser les dépendances du projet • ⚠ Ne pas oublier d'enlever les imports des modules lazy
Avant
Après
0/ Mesurez ! • On peut se baser sur la
taille des bundles et des chuncks • ou utiliser les outils de développement de votre navigateur, s'il peut simuler des connections plus lente (throttling)
1/ Supprimez les dépendances
2/ ajoutez les routes avec loadChildren
3/ mettez à jour les routes des modules
Stratégies de chargement Paresseux à gorge brune (Bradypus variegatus) Cahuita
National Park, Costa Rica By Christian Mehlführer, User:Chmehl (Own work) [CC BY 2.5], via Wikimedia Commons
Live Coding Photo de Claudiu Lupu de Unsplash
Trop facile • On peut facilement choisir comment on charge
les modules • ⚠ La classe PreloadingStrategy est marquée 'Experimental'
1/ Ajoutez un preloadingStrategy
2/ Custom preloader
Dépendances paresseuses Paresseux à 2 doigts (Choloepus didactylus) Zoo New
England, Boston By Eric Kilby from Somerville, MA, USA (Mom Sloth Carrying Big Baby) [CC BY-SA 2.0], via Wikimedia Commons
Live Coding Photo de Claudiu Lupu de Unsplash
Ouch ! • ⚠ Problème avec les singletons injectés =>
CoreModule => ou exposer de 2 façon le module (forRoot avec les providers pour les singletons) • Mais on arrive quand même à faire ce qu'on veut
forRoot
Conclusion • Réduction du 'Web App Gap': optimisation assets,
AOT, lazy-loading, server-side rendering, ... • Bien concevoir ses modules et routes ⚠ bien connaître son application
By Masteraah [CC BY-SA 2.0], via Wikimedia Commons Q /
A