generated from sfeir-open-source/sfeir-school-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4e3826
commit 3b82b72
Showing
16 changed files
with
278 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!-- .slide: class="exercice" --> | ||
|
||
<h1 id="stability" style="margin-bottom: 30px;">06.01 - Démo Automation</h1> | ||
|
||
<br/> <br/> | ||
|
||
**ℹ️ Running the demo**<br/> | ||
`npm run lhci -w 06.01` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# 03.01 - Optimisation des ressources | ||
|
||
## Running the lab | ||
|
||
``` | ||
npm run dev -w 03.01 | ||
``` | ||
|
||
## Instructions | ||
|
||
**1. Images** | ||
|
||
La fiche produit charge 26MB d'images 😱 | ||
|
||
- Charger des résolutions d'image adaptées | ||
- Charger uniquement les images nécessaires | ||
|
||
Au chargement initial, la page devrait pouvoir charger moins d'1MB | ||
|
||
**2. Ressouces** | ||
|
||
- Nettoyer le code inutile | ||
- Optimiser les ressources | ||
|
||
## Conseils / Informations | ||
|
||
La configuration du serveur accepte le redimentionnement d'images. | ||
|
||
Exemples : | ||
|
||
- Redimentionnement : http://localhost:3000/images/product/200/1.jpg?width=200 | ||
- Changement de la qualité d'image : http://localhost:3000/images/product/200/1.jpg?quality=10 | ||
- Redimentionnement + crop : http://localhost:3000/images/product/200/1.jpg?width=200&height=200 | ||
|
||
Si vous êtes curieux, vous pouvez jeter un oeil à `/steps/shared/imageTransformer.js` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# 03.02 - Le chemin critique | ||
|
||
## Running the lab | ||
|
||
``` | ||
npm run dev -w 03.02 | ||
``` | ||
|
||
## Instructions | ||
|
||
**1. Les ressources** | ||
|
||
Contrôler la priorisation des chargements. Pour cela, utiliser : | ||
|
||
- L'ordonnancement de déclaration | ||
- Defer / async | ||
- éventuellement fetchpriority | ||
|
||
**2. Les étapes bloquantes** | ||
|
||
- Améliorer le chargement de l'image principale | ||
- **Bonus** - Côté serveur, les avis client retardent le traitement : Trouver un moyen de reporter leur chargement | ||
|
||
## Conseils / Informations | ||
|
||
### Image Principale | ||
|
||
L'implémentation de l'image principale a été gérée en JavaScript, dans la fonction `initMainImage` (`/public/scripts/main.js`) | ||
|
||
Ne pas hésiter à visualiser le problème en utilisant les devtools | ||
|
||
### Avis client | ||
|
||
Pour le chargement des avis client, vous pouvez vous inspirer du chargement de la zone de conversion : `loadConversionContent` (`/public/scripts/main.js`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# 03.03 - Le chemin critique | ||
|
||
## Running the demo | ||
|
||
``` | ||
npm run dev -w 03.03 | ||
``` | ||
|
||
Consulter la page d'accueil (http://localhost:3000) : plusieurs types de directives sont présentés |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# 04.01 - Interactivité | ||
|
||
## Running the lab | ||
|
||
``` | ||
npm run dev -w 04.01 | ||
``` | ||
|
||
## Instructions | ||
|
||
**1. Au chargement** | ||
|
||
- Inspecter le chargement de la page via les devtools | ||
- Trouver un moyen d'éviter une tâche trop longue au chargement | ||
|
||
**2. Interactions** | ||
|
||
Essayez d'interragir avec la page : certaines interactions sont très lentes à répondre. | ||
|
||
- Voir ce qu'il se passe en utilisant les devtools | ||
- Trouver l'origine des problèmes d'interaction | ||
- Trouver un moyen d'améliorer la réactivité | ||
|
||
## Conseils / Informations | ||
|
||
Cela pourra vous être utile : | ||
|
||
Fonction debounce : | ||
|
||
```js | ||
const debounce = (callback, delay) => { | ||
let timer; | ||
return function (...args) { | ||
clearTimeout(timer); | ||
timer = setTimeout(() => { | ||
callback(...args); | ||
}, delay); | ||
}; | ||
}; | ||
``` | ||
|
||
Fonction yieldToMain : | ||
|
||
```js | ||
const yieldToMain = () => { | ||
return new Promise((resolve) => { | ||
setTimeout(resolve, 0); | ||
}); | ||
}; | ||
``` |
Oops, something went wrong.