"Why to invent a framework and how to live with it?", Yaroslav Doroshchuk

fwdays 205 views 46 slides Oct 19, 2024
Slide 1
Slide 1 of 46
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
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46

About This Presentation

Here you'll hear a story about how a framework can make your life easier in a huge project. Story about our pains, tears and joys at Wix Editor.


Slide Content

‹#›

‹#› Yaroslav Doroshchuk About me Started career in 2009 Have backend background Have 2 kids, 2 cats and a dog Love running 5 years managing Wix Editor R’n’D

‹#›

‹#› React-Redux application with: 10 000+ files 1 000 000+ lines of code 25+ devs working on the same codebase 1000+ integration test scenarios 1500+ E2E tests scenarios 12000 test cases in total (integration + E2E) Why to invent a framework?

‹#› Why to invent a framework?

What is next? Features. ‹#› Why to invent a framework?

‹#› Why to invent a framework?

It wasn’t easy ‹#› Why to invent a framework?

‹#› Shotgun Surgery Making any modifications requires that you make many small changes to many different classes/files/functions. Why to invent a framework?

Refactoring? ‹#› Why to invent a framework?

‹#› Why to invent a framework? EditorAPI God Object → Knows everything: How to move component When site is loaded How to install an app Change site language Send analytics BTC price

Types for EditorAPI? ‹#› Why to invent a framework?

‹#› Why to invent a framework? → Cover Editor API by types ? → Good luck!

‹#› Why to invent a framework? At this point we were a bit disappointed

‹#› Why to invent a framework? Message →

There is more than one editor! ‹#› Why to invent a framework?

‹#› Why to invent a framework? Editors →

‹#› Why to invent a framework? Shared functionality Shared functionality Shared functionality Shared functionality Shared functionality Shared functionality Shared functionality Shared functionality Shared functionality Shared functionality Shared functionality Shared functionality Shared functionality Shared functionality Shared functionality Shared functionality Shared functionality Shared functionality Editors →

‹#› Why to invent a framework? Manage menu dependencies Menu API Panels API Pages API Links API

‹#› Why to invent a framework? Manage menu dependencies Menu API Panels API Pages API Links API

‹#› “No problem can be solved from the same level of consciousness that created it.” By Albert Einstein Why to invent a framework?

What to dream about? ‹#› Why to invent a framework?

‹#› Top Bar Stage Tours Inspector Grid Lightbox This can be an editor This can be an editor This can be deployable Add Panel Component panels Why to invent a framework?

‹#› Module B Host Module A Modules don’t care about the host or other modules Why to invent a framework?

‹#› As long as a contract is implemented - a module can run no matter who’s implementing it (polymorphic) Host Implementation Consumer Give implementation Request implementation Implementation Implementations Can be replaced with different implementations Why to invent a framework?

‹#› Why to invent a framework?

‹#› Data Access API Business Logic API UI API Can use Can use Cannot use Data Access API Business Logic API UI API Can use Can use Module A Module B Why to invent a framework?

TLDR ‹#› Why to invent a framework?

‹#› Why to invent a framework? https://github.com/wix-incubator/repluggable

‹#› → InversifyJS: Too big Have features that we do not need No module definition (not extendable) → Angular: we would have to rewrite everything. Why to invent a framework?

‹#› Shareable code downsides → You have to write more Indirect code. → Learning curve → Less flexibility (on high level) Why to invent a framework?

‹#› Is it worth it? Why to invent a framework?

How to live with it? ‹#›

‹#› → Hot to change common dependency? Why to invent a framework?

‹#› Use feature flags globally! Why to invent a framework?

‹#› Editor 1 Editor 2 Common feature isNewFeature isNewFeature isNewFeature Why to invent a framework?

‹#› Sharable code have to test itself on consumers. Why to invent a framework?

‹#› Editor 1 Editor 2 Common feature → Own tests → Dependant tests Common feature test scenarios over Editor 2 → Own tests → Test scenarios over Editor 1 → Test scenarios over Editor 2 → Own tests → Dependant tests Common feature test scenarios over Editor 1 Why to invent a framework?

‹#› A/B test your feature toggles Why to invent a framework?

‹#› Feature Toggle Off On KPIs Main population (A) Test population (B) KPIs Why to invent a framework?

‹#› Feature Toggle Off On KPIs Main population (A) Test population (B) KPIs Why to invent a framework?

‹#› Feature Toggle Off On KPIs Main population (A) Test population (B) KPIs Why to invent a framework?

‹#› Make RFCs Why to invent a framework?

Thank You. Let’s Talk! [email protected] Yaroslav Doroshchuk P.S.: I’m hiring! October 2024