vitral 0.13.1 → 0.14.0

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.
Files changed (78) hide show
  1. package/README.md +210 -195
  2. package/dist/angular.d.ts +2 -2
  3. package/dist/angular.js +11 -10
  4. package/dist/auto.js +16 -10
  5. package/dist/{capture-2I5IQ2C2.js → capture-5TUYE67Q.js} +3 -2
  6. package/dist/{channel-BHOVSU5X.js → channel-LW7J2VLA.js} +7 -4
  7. package/dist/{chunk-UCFOXMOR.js → chunk-24GEJNHQ.js} +6 -3
  8. package/dist/{chunk-LITYI5X7.js → chunk-3VYMK53Z.js} +4 -4
  9. package/dist/{chunk-YDO7SPF4.js → chunk-6EFYG6N7.js} +4 -4
  10. package/dist/{chunk-DSOK3BNO.js → chunk-7VQLAFIO.js} +45 -14
  11. package/dist/{chunk-6XXPGS5Q.js → chunk-GAVXPS5X.js} +33 -24
  12. package/dist/{chunk-GB3J6I2T.js → chunk-JRZ7FNAE.js} +10 -8
  13. package/dist/{chunk-B7LKO4HS.js → chunk-KA2SH4FH.js} +7 -4
  14. package/dist/chunk-M7AYWO4W.js +13 -0
  15. package/dist/{chunk-VDVVEGAO.js → chunk-NDB5GJMS.js} +9 -6
  16. package/dist/{chunk-54CBIZES.js → chunk-P2RSLXEB.js} +16 -4
  17. package/dist/{chunk-OKXLOMAG.js → chunk-PHVXXDWT.js} +1 -1
  18. package/dist/{chunk-5JNG3OG5.js → chunk-QIGE3XYA.js} +2 -2
  19. package/dist/{chunk-EQZOJU3B.js → chunk-RKYDVK2P.js} +1 -1
  20. package/dist/{chunk-BQGVAXFM.js → chunk-U4QBQQQJ.js} +7 -3
  21. package/dist/{chunk-F5USJIBT.js → chunk-UMSDTGTI.js} +16 -12
  22. package/dist/{chunk-GNPFWISJ.js → chunk-VKY4TKRT.js} +13 -2
  23. package/dist/{chunk-SQ46TAP4.js → chunk-YF7HTZMX.js} +8 -5
  24. package/dist/cli.js +5 -5
  25. package/dist/contract-YNLXHJL7.js +97 -0
  26. package/dist/devtools.js +2 -2
  27. package/dist/edge.d.ts +1 -1
  28. package/dist/element.d.ts +2 -2
  29. package/dist/element.js +11 -10
  30. package/dist/embed.js +2 -2
  31. package/dist/{events-XXC4si92.d.ts → events-C7OtGkNT.d.ts} +1 -1
  32. package/dist/expose-ZDAACD24.js +19 -0
  33. package/dist/federation.d.ts +1 -1
  34. package/dist/{hydrate-QPVDJHM7.js → hydrate-GRYEYDGZ.js} +13 -10
  35. package/dist/{i18n-TMQBOCPP.js → i18n-S5XJHITJ.js} +6 -5
  36. package/dist/i18n.d.ts +1 -10
  37. package/dist/i18n.js +6 -5
  38. package/dist/iframe.js +15 -12
  39. package/dist/index.d.ts +14 -6
  40. package/dist/index.js +11 -8
  41. package/dist/{loader-vj8m2GQU.d.ts → loader-BWTfd89w.d.ts} +1 -1
  42. package/dist/next-config.d.ts +1 -1
  43. package/dist/next-host.d.ts +3 -3
  44. package/dist/next-host.js +14 -13
  45. package/dist/next-server.d.ts +1 -1
  46. package/dist/next.d.ts +1 -1
  47. package/dist/next.js +2 -2
  48. package/dist/{overrides-5BGODLCO.js → overrides-VDR33GS7.js} +2 -2
  49. package/dist/preact.d.ts +4 -4
  50. package/dist/preact.js +12 -10
  51. package/dist/prefetch.js +8 -7
  52. package/dist/react-server.d.ts +1 -1
  53. package/dist/react.d.ts +4 -4
  54. package/dist/react.js +11 -10
  55. package/dist/{reframe-IV36WJRO.js → reframe-SQLGQC6U.js} +19 -16
  56. package/dist/routes.d.ts +2 -2
  57. package/dist/routes.js +10 -9
  58. package/dist/{shadow-ABRO7JNY.js → shadow-H3CCEKCL.js} +5 -4
  59. package/dist/single-spa.d.ts +1 -1
  60. package/dist/{slot-CxhuVuka.d.ts → slot-BNPG3hc0.d.ts} +1 -1
  61. package/dist/snapshot.js +1 -1
  62. package/dist/solid.d.ts +3 -3
  63. package/dist/solid.js +14 -11
  64. package/dist/sri-XXWEYDFN.js +18 -0
  65. package/dist/svelte.d.ts +4 -4
  66. package/dist/svelte.js +10 -9
  67. package/dist/sw.d.ts +1 -1
  68. package/dist/testing.d.ts +1 -1
  69. package/dist/testing.js +9 -8
  70. package/dist/{types-cSsvpvgE.d.ts → types-L-qRmgLw.d.ts} +29 -2
  71. package/dist/vitals.js +3 -2
  72. package/dist/vite.js +1 -0
  73. package/dist/vue.d.ts +6 -6
  74. package/dist/vue.js +12 -10
  75. package/package.json +22 -22
  76. package/dist/contract-3JY7SOGQ.js +0 -18
  77. package/dist/expose-4CIS6AKL.js +0 -18
  78. package/dist/sri-Z5U32IR2.js +0 -17
package/dist/vite.js CHANGED
@@ -1241,6 +1241,7 @@ function vitral(options = {}) {
1241
1241
  // Antes do vite:asset, que faria do .svg uma URL.
1242
1242
  order: "pre",
1243
1243
  // Todos os módulos virtuais do vitral: \0vitral... e \0virtual:vitral...
1244
+ // oxlint-disable-next-line no-control-regex -- \0 é o prefixo dos módulos virtuais
1244
1245
  filter: { id: [/^\x00(virtual:)?vitral/, ...next?.svgr !== false && next ? [/\.svg$/] : []] },
1245
1246
  async handler(id) {
1246
1247
  if (next && next.svgr !== false && id.endsWith(".svg") && !id.startsWith("\0")) {
package/dist/vue.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as vue from 'vue';
2
2
  import { PropType, App, ShallowRef, WritableComputedRef, ComputedRef, Component } from 'vue';
3
- import { P as Props, I as Isolation, R as RemoteContext, S as Shared, a as RemoteModule } from './types-cSsvpvgE.js';
4
- export { e as events } from './events-XXC4si92.js';
3
+ import { P as Props, I as Isolation, R as RemoteContext, S as Shared, a as RemoteModule } from './types-L-qRmgLw.js';
4
+ export { e as events } from './events-C7OtGkNT.js';
5
5
  import { L as Loading, P as Prefetch } from './host-slot-Cz6EiGsB.js';
6
6
  import './errors-kjBv6IH_.js';
7
7
 
@@ -79,7 +79,7 @@ declare const VitralRemote: vue.DefineComponent<vue.ExtractPropTypes<{
79
79
  };
80
80
  /** Ao sair da página, guarda o remote montado (LRU, padrão 5) e na volta só atualiza as props. */
81
81
  keepAlive: {
82
- type: (NumberConstructor | BooleanConstructor)[];
82
+ type: (BooleanConstructor | NumberConstructor)[];
83
83
  default: boolean;
84
84
  };
85
85
  }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
@@ -120,18 +120,18 @@ declare const VitralRemote: vue.DefineComponent<vue.ExtractPropTypes<{
120
120
  };
121
121
  /** Ao sair da página, guarda o remote montado (LRU, padrão 5) e na volta só atualiza as props. */
122
122
  keepAlive: {
123
- type: (NumberConstructor | BooleanConstructor)[];
123
+ type: (BooleanConstructor | NumberConstructor)[];
124
124
  default: boolean;
125
125
  };
126
126
  }>> & Readonly<{
127
127
  onError?: ((...args: any[]) => any) | undefined;
128
128
  onReady?: ((...args: any[]) => any) | undefined;
129
129
  }>, {
130
- name: string;
131
130
  isolate: Isolation;
131
+ src: string;
132
132
  priority: RequestPriority;
133
+ name: string;
133
134
  loading: Loading;
134
- src: string;
135
135
  props: Props;
136
136
  prefetch: Prefetch;
137
137
  keepAlive: number | boolean;
package/dist/vue.js CHANGED
@@ -1,27 +1,29 @@
1
1
  import {
2
2
  hostSlot,
3
3
  timings
4
- } from "./chunk-5JNG3OG5.js";
4
+ } from "./chunk-QIGE3XYA.js";
5
5
  import {
6
6
  defineRemote,
7
7
  memoSelect,
8
+ messages,
8
9
  same,
9
10
  shared
10
- } from "./chunk-DSOK3BNO.js";
11
- import "./chunk-6XXPGS5Q.js";
12
- import "./chunk-OKXLOMAG.js";
13
- import "./chunk-YDO7SPF4.js";
11
+ } from "./chunk-7VQLAFIO.js";
12
+ import "./chunk-GAVXPS5X.js";
13
+ import "./chunk-PHVXXDWT.js";
14
+ import "./chunk-6EFYG6N7.js";
14
15
  import {
15
16
  absolute
16
- } from "./chunk-VDVVEGAO.js";
17
- import "./chunk-BQGVAXFM.js";
17
+ } from "./chunk-NDB5GJMS.js";
18
+ import "./chunk-U4QBQQQJ.js";
19
+ import "./chunk-M7AYWO4W.js";
18
20
  import "./chunk-JWDDXX5O.js";
19
21
  import "./chunk-2Z4OH3BP.js";
20
22
  import "./chunk-4E33RZMM.js";
21
23
  import {
22
24
  events
23
- } from "./chunk-EQZOJU3B.js";
24
- import "./chunk-GNPFWISJ.js";
25
+ } from "./chunk-RKYDVK2P.js";
26
+ import "./chunk-VKY4TKRT.js";
25
27
  import "./chunk-MLKGABMK.js";
26
28
 
27
29
  // src/vue.ts
@@ -142,7 +144,7 @@ var VitralRemote = /* @__PURE__ */ defineComponent({
142
144
  const retry = () => slot?.retry();
143
145
  return () => h("div", { "data-vitral": p.name ?? p.src, "data-vitral-status": status.value }, [
144
146
  status.value === "loading" ? slots.fallback?.() : null,
145
- status.value === "error" ? slots.error ? slots.error({ error: error.value, retry }) : h("div", { role: "alert", "data-vitral-default": "error" }, ["N\xE3o foi poss\xEDvel carregar. ", h("button", { type: "button", onClick: retry }, "Tentar de novo")]) : null,
147
+ status.value === "error" ? slots.error ? slots.error({ error: error.value, retry }) : h("div", { role: "alert", "data-vitral-default": "error" }, [messages().error + " ", h("button", { type: "button", onClick: retry }, messages().retry)]) : null,
146
148
  // O Vue nunca coloca filhos neste div: ele pertence ao remote.
147
149
  h("div", { ref: target })
148
150
  ]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitral",
3
- "version": "0.13.1",
4
- "description": "Micro-frontends com qualquer framework, sem configurar build no host. React, Next.js, Vue, Nuxt, Angular, Svelte e outros na mesma página.",
3
+ "version": "0.14.0",
4
+ "description": "Micro-frontends for any framework with zero host build config. Mix React, Next.js, Vue, Nuxt, Angular, Svelte and more on one page.",
5
5
  "keywords": [
6
6
  "micro-frontend",
7
7
  "micro-frontends",
@@ -289,7 +289,7 @@
289
289
  "./hydrate-*",
290
290
  "./i18n-*"
291
291
  ],
292
- "limit": "5.35 kB"
292
+ "limit": "5.78 kB"
293
293
  },
294
294
  {
295
295
  "name": "núcleo",
@@ -309,12 +309,12 @@
309
309
  "./hydrate-*",
310
310
  "./i18n-*"
311
311
  ],
312
- "limit": "6.33 kB"
312
+ "limit": "6.77 kB"
313
313
  },
314
314
  {
315
315
  "name": "SRI e dedupe (sob demanda, com as dependências)",
316
316
  "path": "dist/sri-*.js",
317
- "limit": "3.37 kB"
317
+ "limit": "3.52 kB"
318
318
  },
319
319
  {
320
320
  "name": "dedupe (sob demanda, para hosts que oferecem dependências)",
@@ -324,7 +324,7 @@
324
324
  {
325
325
  "name": "overrides (sob demanda)",
326
326
  "path": "dist/overrides-*.js",
327
- "limit": "1.29 kB"
327
+ "limit": "1.55 kB"
328
328
  },
329
329
  {
330
330
  "name": "canal: canary e rollback (sob demanda)",
@@ -332,7 +332,7 @@
332
332
  "ignore": [
333
333
  "./chunk-*"
334
334
  ],
335
- "limit": "1.05 kB"
335
+ "limit": "1.08 kB"
336
336
  },
337
337
  {
338
338
  "name": "host mínimo + store",
@@ -352,7 +352,7 @@
352
352
  "./hydrate-*",
353
353
  "./i18n-*"
354
354
  ],
355
- "limit": "6.02 kB"
355
+ "limit": "6.48 kB"
356
356
  },
357
357
  {
358
358
  "name": "host mínimo + store + persist + syncTabs",
@@ -372,7 +372,7 @@
372
372
  "./hydrate-*",
373
373
  "./i18n-*"
374
374
  ],
375
- "limit": "6.24 kB"
375
+ "limit": "6.71 kB"
376
376
  },
377
377
  {
378
378
  "name": "reframe: JS em iframe oculto, DOM no Shadow DOM (sob demanda, além do núcleo e do Shadow DOM)",
@@ -381,7 +381,7 @@
381
381
  "./chunk-*",
382
382
  "./shadow-*"
383
383
  ],
384
- "limit": "2.83 kB"
384
+ "limit": "2.97 kB"
385
385
  },
386
386
  {
387
387
  "name": "estilos do Shadow DOM (além do núcleo)",
@@ -389,7 +389,7 @@
389
389
  "ignore": [
390
390
  "./chunk-*"
391
391
  ],
392
- "limit": "1.74 kB"
392
+ "limit": "1.77 kB"
393
393
  },
394
394
  {
395
395
  "name": "hidratação do SSR do gateway (sob demanda)",
@@ -397,7 +397,7 @@
397
397
  "ignore": [
398
398
  "./chunk-*"
399
399
  ],
400
- "limit": "1.52 kB"
400
+ "limit": "1.54 kB"
401
401
  },
402
402
  {
403
403
  "name": "react",
@@ -419,7 +419,7 @@
419
419
  "./hydrate-*",
420
420
  "./i18n-*"
421
421
  ],
422
- "limit": "7.42 kB"
422
+ "limit": "7.88 kB"
423
423
  },
424
424
  {
425
425
  "name": "vue",
@@ -440,7 +440,7 @@
440
440
  "./hydrate-*",
441
441
  "./i18n-*"
442
442
  ],
443
- "limit": "6.79 kB"
443
+ "limit": "7.24 kB"
444
444
  },
445
445
  {
446
446
  "name": "element",
@@ -460,18 +460,18 @@
460
460
  "./hydrate-*",
461
461
  "./i18n-*"
462
462
  ],
463
- "limit": "7.16 kB"
463
+ "limit": "7.66 kB"
464
464
  },
465
465
  {
466
466
  "name": "devtools",
467
467
  "path": "dist/devtools.js",
468
468
  "import": "{ devtools }",
469
- "limit": "2.05 kB"
469
+ "limit": "2.27 kB"
470
470
  },
471
471
  {
472
472
  "name": "auto",
473
473
  "path": "dist/auto.js",
474
- "limit": "7.33 kB",
474
+ "limit": "7.92 kB",
475
475
  "ignore": [
476
476
  "./shadow-*",
477
477
  "./reframe-*",
@@ -491,7 +491,7 @@
491
491
  "name": "routes",
492
492
  "path": "dist/routes.js",
493
493
  "import": "{ routes }",
494
- "limit": "10.56 kB",
494
+ "limit": "11.73 kB",
495
495
  "ignore": [
496
496
  "./overrides-*",
497
497
  "./stale-*",
@@ -517,7 +517,7 @@
517
517
  "name": "prefetch",
518
518
  "path": "dist/prefetch.js",
519
519
  "import": "{ prefetch }",
520
- "limit": "4.24 kB",
520
+ "limit": "4.52 kB",
521
521
  "ignore": [
522
522
  "./shadow-*",
523
523
  "./overrides-*",
@@ -535,7 +535,7 @@
535
535
  "name": "iframe",
536
536
  "path": "dist/iframe.js",
537
537
  "import": "{ enableIframe }",
538
- "limit": "6.2 kB",
538
+ "limit": "7.18 kB",
539
539
  "ignore": [
540
540
  "./overrides-*",
541
541
  "./stale-*",
@@ -548,13 +548,13 @@
548
548
  {
549
549
  "name": "embed (loader de sites de terceiros, arquivo único com Shadow DOM, SRI e canal)",
550
550
  "path": "dist/embed.js",
551
- "limit": "13.55 kB"
551
+ "limit": "15.13 kB"
552
552
  },
553
553
  {
554
554
  "name": "snapshot (última tela na visita de volta)",
555
555
  "path": "dist/snapshot.js",
556
556
  "import": "{ snapshots }",
557
- "limit": "1.26 kB"
557
+ "limit": "1.34 kB"
558
558
  },
559
559
  {
560
560
  "name": "vitals (Web Vitals por remote)",
@@ -1,18 +0,0 @@
1
- import {
2
- protocol
3
- } from "./chunk-GNPFWISJ.js";
4
- import "./chunk-MLKGABMK.js";
5
-
6
- // src/core/contract.ts
7
- async function checkContract(c, range = protocol().settings().contract) {
8
- const { satisfies } = await import("./dedupe-M63VMCWA.js");
9
- if (c.version && !satisfies(c.version, range)) return `o host aceita contrato ${range}, o remote publica ${c.version}`;
10
- const offered = protocol().settings().offered ?? {};
11
- for (const dep in c.peers) {
12
- const have = offered[dep];
13
- if (have && !satisfies(have, c.peers[dep])) return `o remote espera ${dep} ${c.peers[dep]}, o host oferece ${have}`;
14
- }
15
- }
16
- export {
17
- checkContract
18
- };
@@ -1,18 +0,0 @@
1
- import {
2
- resolveModule,
3
- resolveTarget,
4
- splitName
5
- } from "./chunk-SQ46TAP4.js";
6
- import "./chunk-6XXPGS5Q.js";
7
- import "./chunk-OKXLOMAG.js";
8
- import "./chunk-YDO7SPF4.js";
9
- import "./chunk-VDVVEGAO.js";
10
- import "./chunk-BQGVAXFM.js";
11
- import "./chunk-JWDDXX5O.js";
12
- import "./chunk-GNPFWISJ.js";
13
- import "./chunk-MLKGABMK.js";
14
- export {
15
- resolveModule,
16
- resolveTarget,
17
- splitName
18
- };
@@ -1,17 +0,0 @@
1
- import {
2
- importVerified,
3
- signature,
4
- verified
5
- } from "./chunk-LITYI5X7.js";
6
- import "./chunk-UCFOXMOR.js";
7
- import "./chunk-OKXLOMAG.js";
8
- import "./chunk-VDVVEGAO.js";
9
- import "./chunk-BQGVAXFM.js";
10
- import "./chunk-JWDDXX5O.js";
11
- import "./chunk-GNPFWISJ.js";
12
- import "./chunk-MLKGABMK.js";
13
- export {
14
- importVerified,
15
- signature,
16
- verified
17
- };