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
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
58
3h pour développer un microservice avec SparkJava et Feign
ilaborie
1
520
Feign Live
ilaborie
0
170
Other Decks in Programming
See All in Programming
5分で問診!Composer セキュリティ健康診断
codmoninc
0
1k
そこに3びきプロダクトがいるじゃろう——生成AI時代における“価値が届かない理由”の構造
kosuket
0
510
How I Won Prize Money at a Hackathon Using Codex and Symphony Alpha
yasei_no_otoko
0
110
これって Effect でできたのでは? / TSKaigi Mashup Kansai #2
susisu
0
250
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
1k
Foundation Models frameworkで画像分析
ryodeveloper
1
620
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
310
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
200
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
1.1k
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
240
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
5
1.9k
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
280
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.7k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
230
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
390
The SEO identity crisis: Don't let AI make you average
varn
0
530
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.9k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
620
Why Our Code Smells
bkeepers
PRO
340
58k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.4k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
410
A Tale of Four Properties
chriscoyier
163
24k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
570
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