-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
397 lines (362 loc) · 11.9 KB
/
index.html
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<link rel="icon" type="image/png" href="examples/assets/favicon.png" />
<title>MicroFrontends using bit.dev</title>
<link rel="stylesheet" href="dist/reset.css" />
<link rel="stylesheet" href="dist/reveal.css" />
<link rel="stylesheet" href="dist/theme/moon.css" id="theme" />
<!-- Theme used for syntax highlighted code -->
<link
rel="stylesheet"
href="plugin/highlight/monokai.css"
id="highlight-theme"
/>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1>MicroFrontends using bit.dev</h1>
<div style="height: 5em"></div>
<h4>Matias Borghi - April 2021</h4>
</section>
<section>
<h2>Table of Contents</h2>
<ul>
<li>
<strong>Monolithic frontends</strong>
<ul style="list-style-type: circle">
<li>Status</li>
<li>Pros & Cons</li>
<li>Use Cases and the need for change</li>
</ul>
</li>
<li>
<strong>MicroFrontends</strong>
<ul style="list-style-type: circle">
<li>Thinking about components</li>
<li>Bit.dev usage</li>
<li>Teams structure @ bit.dev</li>
</ul>
</li>
<li><strong>Conclusion and current status</strong></li>
</ul>
</section>
<section>
<h2>How did we start?</h2>
<figure
class="r-stretch"
style="
border: 2px dashed transparent;
max-width: 300px;
margin: auto;
"
>
<img src="./examples/assets/new.svg" height="400px" />
<figcaption
style="color: rgb(194, 129, 9); font-size: 40px; font-weight: 700"
>
Monolith UI
</figcaption>
</figure>
</section>
<section>
<div class="container">
<div class="col">
<h2>Pros</h2>
<ul style="font-size: xx-large">
<li style="margin: 0 0 10px 0">
All the code in the same place
</li>
<li>Quick to start developing and testing</li>
</ul>
</div>
<div class="col">
<h2>Cons</h2>
<ul style="font-size: xx-large">
<li>
May lead to <strong>repetitive code</strong> usage which then
turns into slow development
</li>
</ul>
</div>
</div>
</section>
<section>
<h2>Use Cases</h2>
<ol>
<li style="margin: 0 0 50px 0">
Same-template blogs arose to repetitive (boring) code even for
minor changes and bugs
</li>
<li>
What happens if we want to implement multiple sites that use
similar UI (headers, buttons, footers)?
</li>
</ol>
<blockquote class="fragment" style="margin-top: 1em">
We don't want to <strong>repeate</strong> the code and
<strong>reinvent</strong> the wheel each time
</blockquote>
</section>
<section>
<h4>Example: Spotify</h4>
<img
height="500px"
src="https://static.bit.dev/lp-assets/reusable-component-illustration.svg"
/>
</section>
<section>
<h4>
Example: Finding a bug or wanting to do an improvement on a header
</h4>
<iframe
class="r-stretch"
data-src="https://gatsby-casper.netlify.app/"
></iframe>
</section>
<section>
<h4>
Example: Finding a bug or wanting to do an improvement on a header
</h4>
<img src="examples/assets/site.svg" />
</section>
<section>
<h3>Solution 💡</h3>
<blockquote>
<h3 style="color: orange">MicroFrontends using bit.dev</h3>
</blockquote>
<p class="fragment">
WebDev today allows us to think our app as a
<span style="font-weight: 900; font-size: larger"
>composition of reusable components</span
>.
</p>
<p class="fragment">
Break monolithic project into
<span style="font-size: 30px">smaller</span>, more manageable
pieces, which are
<strong>independently developed and owned</strong> by different
teams, with the power to build and ship simultaneously.
</p>
</section>
<section>
<h5>How does an example header could be decomposed?</h5>
<img src="https://miro.medium.com/max/589/0*XYA-r_yyeGlqkvQQ" />
</section>
<section>
<h5>...And a whole webpage?</h5>
<img
width="80%"
src="https://static.bit.dev/homepage-bit/assets/booking-breakdown.png"
/>
</section>
<section data-auto-animate>
<h4>So, how do we use it?</h4>
<blockquote>
Just
<span style="text-decoration: underline; color: orange"
>import</span
>
the components!
</blockquote>
<pre
style="height: 500px"
data-id="code-animation"
><code class="hljs" data-trim data-line-numbers="2-15|19"><script type="text/template">
import React, { useState } from 'react';
import { Button, Typography } from '@material-ui/core';
function Example() {
const [count, setCount] = useState(0);
return (
<div>
<p>You clicked {count} times</p>
<Button onClick={() => setCount(count + 1)}>
<Typography>Click me</Typography>
</Button>
</div>
);
}
function Main() {
return (
<Example />
)
}
</script></code></pre>
</section>
<section data-auto-animate>
<h4>So, how do we use it?</h4>
<blockquote>
Just
<span style="text-decoration: underline; color: orange"
>import</span
>
the components!
</blockquote>
<pre
data-id="code-animation"
><code class="hljs" data-trim data-line-numbers="2,6"><script type="text/template">
import React, { useState } from 'react';
import { Example } from '@bit/owner.namespace.example';
function Main() {
return (
<Example />
)
}
</script></code></pre>
</section>
<section data-auto-animate>
<h4>So, how do we use it?</h4>
<blockquote>
Just
<span style="text-decoration: underline; color: orange"
>import</span
>
the components!
</blockquote>
<div class="r-stack">
<p class="fragment fade-out">
Everyone works together, delivering independently.
</p>
<p class="fragment fade-in-then-out">
Speed up development and improve application quality
</p>
<div class="fragment">
<p>
~75% decrement in site building while keeping design consistent
</p>
<p>
Independently version, build, test, package and publish each of
their components
</p>
</div>
</div>
</section>
<section>
<h4>All the components in one place</h4>
<img
src="https://miro.medium.com/max/1250/1*M28IpX4-_1uhibsB45gQrQ.png"
/>
</section>
<section>
<h4>Example: Radio component</h4>
<img
src="https://miro.medium.com/max/1250/1*vXvrin8ETHpemo67kcc7-Q.png"
/>
</section>
<section
data-background-video-loop
data-background-size="cover"
data-background-video="examples/assets/second.bin"
></section>
<section
id="video"
data-background-video-loop
data-background-size="cover"
data-background-video="examples/assets/first.bin"
></section>
<section>
<h4>Development at bit.dev</h4>
<table style="font-size: 32px">
<thead>
<tr>
<th>Team</th>
<th>Objective</th>
<th>Composition</th>
</tr>
</thead>
<tbody>
<tr>
<td>Frontend infrastracture team</td>
<td>maintain bit.dev plataform's basic set of components</td>
<td>a designer, a PM and SH</td>
</tr>
<tr>
<td>Component Search team</td>
<td>responsible for complex search feature on bit.dev</td>
<td>a few devs, one NLP researcher and a PM</td>
</tr>
<tr>
<td>Component Discovery team</td>
<td>
build the components used to document, visualize and interact
with the components shared on the bit.dev platform
</td>
<td>a part-time designer, part-time PM and a few devs</td>
</tr>
</tbody>
</table>
</section>
<section>
<h4>Development at bit.dev</h4>
<img src="examples/assets/teams.jpeg" />
</section>
<section>
<h3>Conclusion</h3>
<p>
MicroFrontends is a better way to improve the way we work, build
better modular software and deliver faster and more often
</p>
<blockquote
style="width: fit-content"
cite="https://blog.bitsrc.io/how-we-build-micro-front-ends-d3eeeac0acfc"
>
“ For small teams, adopting a flexible and scalable
architecture will improve their ability to grow, rapidly add new
features, onboard new people, and focus on core technology and
innovation instead of on less important things.”
</blockquote>
</section>
<section>
<h3>Conclusion</h3>
<blockquote style="padding: 1em">
<p>Where are we now with all these?</p>
<h5>
<span
style="
text-decoration: underline;
color: orange;
margin-right: 10px;
"
>Partial Migration Process</span
><a href="#/video">🎥</a>
</h5>
<p>
Some components are already being imported from the UI library.
</p>
</blockquote>
</section>
</div>
</div>
<script src="dist/reveal.js"></script>
<script src="plugin/notes/notes.js"></script>
<script src="plugin/markdown/markdown.js"></script>
<script src="plugin/highlight/highlight.js"></script>
<script>
// More info about initialization & config:
// - https://revealjs.com/initialization/
// - https://revealjs.com/config/
Reveal.initialize({
hash: true,
// slideNumber: 'c/t',
// Learn about plugins: https://revealjs.com/plugins/
plugins: [RevealMarkdown, RevealHighlight, RevealNotes],
});
</script>
<style>
.container {
display: flex;
margin: 0 -50px;
}
.col {
flex: 1;
}
</style>
</body>
</html>