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
110
0
Share
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
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
140
The NotImplementedError Problem in Ruby
koic
1
590
RTSPクライアントを自作してみた話
simotin13
0
480
TAKTでAI駆動開発の品質を設計する
j5ik2o
6
910
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
230
「エンジニアインターン、どうやって取った?」準備のリアルを語るLT会 Progate BAR
akiomatic
0
120
Technical Debt: Understanding it Rightly, Engaging it Rightly #LaravelLiveJP
shogogg
0
190
New "Type" system on PicoRuby
pocke
1
470
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
2.8k
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
340
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.1k
GitHub Copilot CLIのいいところ
htkym
2
1.3k
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
6k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
940
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
280
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
BBQ
matthewcrist
89
10k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
The browser strikes back
jonoalderson
0
1.1k
The SEO Collaboration Effect
kristinabergwall1
1
480
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
170
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
190
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