vitral 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -19
- package/dist/vue.d.ts +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
<p align="center"
|
|
2
|
-
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/joaogabriel15/vitral/main/docs/public/marca/banner-escuro.png">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/joaogabriel15/vitral/main/docs/public/marca/banner.png" width="640" alt="vitral. Feito de partes. Visto como um todo.">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
6
7
|
|
|
7
8
|
<p align="center">
|
|
8
9
|
<a href="https://github.com/joaogabriel15/vitral/actions/workflows/ci.yml"><img src="https://github.com/joaogabriel15/vitral/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
@@ -11,15 +12,48 @@
|
|
|
11
12
|
<a href="https://github.com/joaogabriel15/vitral/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/vitral" alt="licença MIT"></a>
|
|
12
13
|
</p>
|
|
13
14
|
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="https://joaogabriel15.github.io/vitral/">Documentação</a> ·
|
|
17
|
+
<a href="https://joaogabriel15.github.io/vitral/aprender/configurar">Começar</a> ·
|
|
18
|
+
<a href="https://joaogabriel15.github.io/vitral/por-que">Por que o vitral</a> ·
|
|
19
|
+
<a href="https://joaogabriel15.github.io/vitral/aprender/benchmark">Benchmark</a> ·
|
|
20
|
+
<a href="./README.en.md">English</a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
14
23
|
Junte micro-frontends de qualquer framework numa página só, sem configuração de build no host.
|
|
15
24
|
|
|
25
|
+
Cada equipe publica o próprio pedaço da página (um remote) com `vite build`. O host recebe a URL de cada remote e monta tudo no navegador. Não há plugin no host, não há versão de React para combinar entre equipes e um remote fora do ar não derruba a página.
|
|
26
|
+
|
|
16
27
|
```bash
|
|
17
28
|
npm install vitral
|
|
18
29
|
```
|
|
19
30
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
31
|
+
<p align="center">
|
|
32
|
+
<picture>
|
|
33
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/joaogabriel15/vitral/main/docs/public/marca/como-funciona-escuro.png">
|
|
34
|
+
<img src="https://raw.githubusercontent.com/joaogabriel15/vitral/main/docs/public/marca/como-funciona.png" width="900" alt="Três equipes (React, Vue, Angular) publicam um vitral.json cada uma num CDN. O host lê as URLs com configure e monta os três remotes na mesma página.">
|
|
35
|
+
</picture>
|
|
36
|
+
</p>
|
|
37
|
+
|
|
38
|
+
## Por que o vitral
|
|
39
|
+
|
|
40
|
+
| | Module Federation / single-spa | vitral |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| Build do host | Config combinada com cada remote | Nenhuma. Só `configure()` |
|
|
43
|
+
| Versões de React/Vue | `shared` e singletons, conflitos de versão | Cada remote leva a sua. Compartilhar é opcional |
|
|
44
|
+
| Remote fora do ar | Pode derrubar a página | Só aquele remote mostra erro |
|
|
45
|
+
| CSS | Vaza entre apps | Escopo automático ou Shadow DOM |
|
|
46
|
+
| Deploy novo | `ChunkLoadError` com cache velho | Arquivos com hash; só o `vitral.json` revalida |
|
|
47
|
+
| Conceitos | Containers, exposes, lifecycles, root config | `mount(el, props, ctx)` → `{ update, unmount }` |
|
|
48
|
+
|
|
49
|
+
Medido no [benchmark público](https://joaogabriel15.github.io/vitral/aprender/benchmark) (Chromium, rede Slow 4G, mediana de 7 visitas):
|
|
50
|
+
|
|
51
|
+
- **3,4 kB** de código de host mínimo, com brotli. O host do Module Federation tem 19,4 kB.
|
|
52
|
+
- **57% menos tempo** na primeira visita que o Module Federation com React compartilhado (1157 ms contra 2673 ms, 1 remote).
|
|
53
|
+
- **4,6 vezes mais rápido** para trocar de área que o Next.js Multi-Zones (184 ms contra 850 ms).
|
|
54
|
+
- **10 frameworks** cobertos por testes de ponta a ponta no CI, com host e remote de frameworks diferentes, em Chromium, Firefox, WebKit e mobile.
|
|
55
|
+
|
|
56
|
+
A página do benchmark também lista onde o vitral perde.
|
|
23
57
|
|
|
24
58
|
## Começo rápido
|
|
25
59
|
|
|
@@ -340,17 +374,6 @@ expect(carrinho.lastProps).toEqual({ itens: 2 })
|
|
|
340
374
|
failingRemote('recomendacoes') // testa a tela de erro
|
|
341
375
|
```
|
|
342
376
|
|
|
343
|
-
## Comparado com Module Federation e single-spa
|
|
344
|
-
|
|
345
|
-
| | Module Federation / single-spa | vitral |
|
|
346
|
-
|---|---|---|
|
|
347
|
-
| Build do host | Config combinada com cada remote | Nenhuma. Só `configure()` |
|
|
348
|
-
| Versões de React/Vue | `shared` e singletons, conflitos de versão | Cada remote leva a sua. Compartilhar é opcional |
|
|
349
|
-
| Remote fora do ar | Pode derrubar a página | Só aquele remote mostra erro |
|
|
350
|
-
| CSS | Vaza entre apps | Escopo automático ou Shadow DOM |
|
|
351
|
-
| Deploy novo | `ChunkLoadError` com cache velho | Arquivos com hash; só o `vitral.json` revalida |
|
|
352
|
-
| Conceitos | Containers, exposes, lifecycles, root config | `mount(el, props, ctx)` → `{ update, unmount }` |
|
|
353
|
-
|
|
354
377
|
## Links
|
|
355
378
|
|
|
356
379
|
- [Exemplos](https://github.com/joaogabriel15/vitral/tree/main/examples): o mesmo remote em 8 frameworks e 9 hosts.
|
package/dist/vue.d.ts
CHANGED
|
@@ -127,8 +127,8 @@ declare const VitralRemote: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
127
127
|
onError?: ((...args: any[]) => any) | undefined;
|
|
128
128
|
onReady?: ((...args: any[]) => any) | undefined;
|
|
129
129
|
}>, {
|
|
130
|
-
name: string;
|
|
131
130
|
isolate: Isolation;
|
|
131
|
+
name: string;
|
|
132
132
|
priority: RequestPriority;
|
|
133
133
|
loading: Loading;
|
|
134
134
|
src: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitral",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"description": "Micro-frontends
|
|
3
|
+
"version": "0.7.1",
|
|
4
|
+
"description": "Micro-frontends de qualquer framework numa página só, sem configuração de build no host. React, Next, Vue, Nuxt, Angular, Svelte, Solid, Preact, Lit e JS puro.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"micro-frontend",
|
|
7
7
|
"micro-frontends",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"web-components",
|
|
30
30
|
"typescript"
|
|
31
31
|
],
|
|
32
|
-
"homepage": "https://github.
|
|
32
|
+
"homepage": "https://joaogabriel15.github.io/vitral/",
|
|
33
33
|
"bugs": {
|
|
34
34
|
"url": "https://github.com/joaogabriel15/vitral/issues"
|
|
35
35
|
},
|