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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
igor
June 27, 2017
Programming
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Lazy Loading en Just Angular : Aïe ?
igor
June 27, 2017
More Decks by igor
See All by igor
Java REST client with Feign
ilaborie
0
57
3h pour développer un microservice avec SparkJava et Feign
ilaborie
1
510
Feign Live
ilaborie
0
170
Other Decks in Programming
See All in Programming
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
1
520
Oxcを導入して開発体験が向上した話
yug1224
4
340
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.3k
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.5k
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.8k
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
170
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
230
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
610
トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略
ochtum
0
220
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
560
The NotImplementedError Problem in Ruby
koic
1
970
ふつうのFeature Flag実践入門
irof
8
4.2k
Featured
See All Featured
Exploring anti-patterns in Rails
aemeredith
3
430
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
950
Leo the Paperboy
mayatellez
7
1.9k
A Soul's Torment
seathinner
6
3k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
570
Building the Perfect Custom Keyboard
takai
2
800
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Visualization
eitanlees
152
17k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
320
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