"Why to invent a framework and how to live with it?", Yaroslav Doroshchuk
fwdays
205 views
46 slides
Oct 19, 2024
Slide 1 of 46
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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.
Size: 7.01 MB
Language: en
Added: Oct 19, 2024
Slides: 46 pages
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? 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?