"Scalable microfrontends & how to optimize hydration", Oleksandr Lavrenchuk

fwdays 207 views 39 slides Oct 19, 2024
Slide 1
Slide 1 of 39
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39

About This Presentation

In this talk, we will explore the micro frontend architecture based on the real example of the big product, uncovering how dozens of teams coexist, work, and deploy features independently every day. Moreover, I will talk about the bottlenecks of React hydration, how it affects users, and how to appl...


Slide Content

What if I told you…

What if I told you… dozens of teams can independently work on the same application

What if I told you… dozens of teams can independently work on the same application developers can release changes to prod multiple times per day

What if I told you… dozens of teams can independently work on the same application developers can release changes to prod multiple times per day you can optimize the performance by delaying the React hydration

What if I told you… dozens of teams can independently work on the same application developers can release changes to prod multiple times per day you can optimize the performance by delaying the React hydration microfrontend is not just a buzzword

And it’s all real 🤯

Front-end Developer & Front-end Guild Lead at Fiverr . Oleksandr Lavrenchuk

160+ Countries ©2022 Fiverr Int. Ltd. All Rights Reserved. Proprietary & Confidential. 3.9 M Active Buyers 33 Dev Teams

Independent work for dozens of teams Prod releases every day without a friction Consistency The needs & motivation:

Microfrontends to the rescue

How to cook microfrontends?

How to cook microfrontends? Do you even need them?

How to cook microfrontends? Do you even need them? Clear boundaries

How to cook microfrontends? Do you even need them? Clear boundaries (SSR) framework

How to cook microfrontends? Do you even need them? Clear boundaries (SSR) framework UI composer 💫

©2022 Fiverr Int. Ltd. All Rights Reserved. Proprietary & Confidential. Typical page example:

©2022 Fiverr Int. Ltd. All Rights Reserved. Proprietary & Confidential.

©2022 Fiverr Int. Ltd. All Rights Reserved. Proprietary & Confidential.

©2022 Fiverr Int. Ltd. All Rights Reserved. Proprietary & Confidential. Compose it!

Hydration?

©2022 Fiverr Int. Ltd. All Rights Reserved. Proprietary & Confidential.

©2022 Fiverr Int. Ltd. All Rights Reserved. Proprietary & Confidential. Source: web.dev

So what?

Source: patterns.dev

©2022 Fiverr Int. Ltd. All Rights Reserved. Proprietary & Confidential.

©2022 Fiverr Int. Ltd. All Rights Reserved. Proprietary & Confidential.

What if…

What if… We won’t hydrate everything at once?

From: Source: patterns.dev

To: patterns.dev Source: patterns.dev

©2022 Fiverr Int. Ltd. All Rights Reserved. Proprietary & Confidential. -30% INP Logged out homepage m obile -30% INP Vertical page mobile -7% INP Logged in homepage mobile

©2022 Fiverr Int. Ltd. All Rights Reserved. Proprietary & Confidential. + 1% Buyer Conversion

What about CSR & simple lazy loading? With progressive hydration we leverage the server that we have. Hydration is faster than pure CSR - our html is already rendered, we just need to add the event handlers.