vitral 0.3.0 → 0.5.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 (70) hide show
  1. package/dist/angular.d.ts +2 -2
  2. package/dist/angular.js +7 -7
  3. package/dist/auto.js +7 -7
  4. package/dist/{capture-JYFERAPL.js → capture-TT5WBLJ6.js} +1 -1
  5. package/dist/channel-2YPYGX3J.js +95 -0
  6. package/dist/{chunk-AKNNHQ2H.js → chunk-463H6B56.js} +5 -0
  7. package/dist/{chunk-IHTUM6LT.js → chunk-4Z77XNBR.js} +2 -2
  8. package/dist/chunk-54CBIZES.js +105 -0
  9. package/dist/{chunk-TD4S3IHA.js → chunk-5JNV45BB.js} +10 -8
  10. package/dist/{chunk-SDB5AZEI.js → chunk-C3QOBAUE.js} +2 -2
  11. package/dist/chunk-DAESKNQ6.js +207 -0
  12. package/dist/{chunk-3YXI3G34.js → chunk-K6EG7DMO.js} +16 -7
  13. package/dist/{chunk-ZAC6QQI6.js → chunk-KU6HF2EW.js} +4 -4
  14. package/dist/{chunk-I3VSKSAZ.js → chunk-KZBH5MPD.js} +29 -27
  15. package/dist/chunk-NZEQGRBL.js +93 -0
  16. package/dist/chunk-PY7P5BF4.js +404 -0
  17. package/dist/{chunk-GNHCZRQP.js → chunk-TW7KYJQ6.js} +1 -1
  18. package/dist/{chunk-AH7KNMBW.js → chunk-UYOPJ4XQ.js} +1 -1
  19. package/dist/cli.js +1522 -37
  20. package/dist/devtools.d.ts +32 -2
  21. package/dist/devtools.js +27 -12
  22. package/dist/dict.d.ts +69 -0
  23. package/dist/dict.js +8 -0
  24. package/dist/edge.d.ts +118 -0
  25. package/dist/edge.js +398 -0
  26. package/dist/element.d.ts +12 -3
  27. package/dist/element.js +7 -7
  28. package/dist/embed.js +2 -0
  29. package/dist/{events-D5gs7rff.d.ts → events-0rxFlWJJ.d.ts} +1 -1
  30. package/dist/expose-IAKYHJXF.js +15 -0
  31. package/dist/federation.d.ts +89 -0
  32. package/dist/federation.js +101 -0
  33. package/dist/hydrate-YVZDJ2V7.js +168 -0
  34. package/dist/iframe.js +7 -7
  35. package/dist/index.d.ts +4 -4
  36. package/dist/index.js +5 -5
  37. package/dist/otel.d.ts +29 -1
  38. package/dist/otel.js +13 -1
  39. package/dist/overrides-NP754HY7.js +27 -0
  40. package/dist/preact.d.ts +4 -4
  41. package/dist/preact.js +6 -6
  42. package/dist/prefetch.d.ts +25 -0
  43. package/dist/prefetch.js +178 -0
  44. package/dist/react.d.ts +3 -3
  45. package/dist/react.js +6 -6
  46. package/dist/reframe-LQL4DZYP.js +251 -0
  47. package/dist/routes.d.ts +2 -2
  48. package/dist/routes.js +5 -5
  49. package/dist/{shadow-6HELCHCJ.js → shadow-S4SKHTA7.js} +66 -5
  50. package/dist/single-spa.d.ts +40 -0
  51. package/dist/single-spa.js +52 -0
  52. package/dist/{slot-DqXTwGbs.d.ts → slot-D49L1rdU.d.ts} +1 -1
  53. package/dist/solid.d.ts +3 -3
  54. package/dist/solid.js +6 -6
  55. package/dist/{sri-JMX6JLQP.js → sri-576GTDIA.js} +41 -10
  56. package/dist/svelte.d.ts +4 -4
  57. package/dist/svelte.js +6 -6
  58. package/dist/testing.d.ts +171 -3
  59. package/dist/testing.js +193 -6
  60. package/dist/{types-Czvm-siZ.d.ts → types-DUtcF3HO.d.ts} +124 -5
  61. package/dist/vitals.d.ts +29 -0
  62. package/dist/vitals.js +152 -0
  63. package/dist/vite.d.ts +18 -0
  64. package/dist/vite.js +329 -417
  65. package/dist/vue.d.ts +3 -3
  66. package/dist/vue.js +6 -6
  67. package/package.json +170 -21
  68. package/dist/chunk-DXORSF4X.js +0 -42
  69. package/dist/expose-JUOUN5N5.js +0 -15
  70. package/dist/overrides-NZAIUGK5.js +0 -15
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-Czvm-siZ.js';
4
- export { e as events } from './events-D5gs7rff.js';
3
+ import { P as Props, I as Isolation, R as RemoteContext, S as Shared, a as RemoteModule } from './types-DUtcF3HO.js';
4
+ export { e as events } from './events-0rxFlWJJ.js';
5
5
  import { L as Loading, P as Prefetch } from './host-slot-Cz6EiGsB.js';
6
6
  import './errors-kjBv6IH_.js';
7
7
 
@@ -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
- isolate: Isolation;
131
130
  name: string;
131
+ isolate: Isolation;
132
132
  priority: RequestPriority;
133
133
  loading: Loading;
134
134
  src: string;
package/dist/vue.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  hostSlot,
3
3
  timings
4
- } from "./chunk-IHTUM6LT.js";
4
+ } from "./chunk-4Z77XNBR.js";
5
5
  import {
6
6
  defineRemote,
7
7
  events,
8
8
  memoSelect,
9
9
  same,
10
10
  shared
11
- } from "./chunk-I3VSKSAZ.js";
12
- import "./chunk-TD4S3IHA.js";
13
- import "./chunk-ZAC6QQI6.js";
11
+ } from "./chunk-KZBH5MPD.js";
12
+ import "./chunk-5JNV45BB.js";
13
+ import "./chunk-KU6HF2EW.js";
14
14
  import {
15
15
  absolute
16
- } from "./chunk-GNHCZRQP.js";
17
- import "./chunk-AKNNHQ2H.js";
16
+ } from "./chunk-TW7KYJQ6.js";
17
+ import "./chunk-463H6B56.js";
18
18
  import "./chunk-GNPFWISJ.js";
19
19
 
20
20
  // src/vue.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitral",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Micro-frontends sem burocracia: um contrato mount/unmount, carregamento em runtime e adaptadores para React, Next, Vue, Nuxt, Angular, Svelte, Solid, Preact, Lit e JS/TS puro.",
5
5
  "keywords": [
6
6
  "micro-frontend",
@@ -119,6 +119,30 @@
119
119
  "./otel": {
120
120
  "types": "./dist/otel.d.ts",
121
121
  "import": "./dist/otel.js"
122
+ },
123
+ "./single-spa": {
124
+ "types": "./dist/single-spa.d.ts",
125
+ "import": "./dist/single-spa.js"
126
+ },
127
+ "./federation": {
128
+ "types": "./dist/federation.d.ts",
129
+ "import": "./dist/federation.js"
130
+ },
131
+ "./vitals": {
132
+ "types": "./dist/vitals.d.ts",
133
+ "import": "./dist/vitals.js"
134
+ },
135
+ "./dict": {
136
+ "types": "./dist/dict.d.ts",
137
+ "import": "./dist/dict.js"
138
+ },
139
+ "./prefetch": {
140
+ "types": "./dist/prefetch.d.ts",
141
+ "import": "./dist/prefetch.js"
142
+ },
143
+ "./edge": {
144
+ "types": "./dist/edge.d.ts",
145
+ "import": "./dist/edge.js"
122
146
  }
123
147
  },
124
148
  "publishConfig": {
@@ -131,6 +155,7 @@
131
155
  "peerDependencies": {
132
156
  "@angular/core": ">=17",
133
157
  "@angular/platform-browser": ">=17",
158
+ "happy-dom": ">=15",
134
159
  "preact": ">=10",
135
160
  "react": ">=18",
136
161
  "react-dom": ">=18",
@@ -170,6 +195,9 @@
170
195
  },
171
196
  "typescript": {
172
197
  "optional": true
198
+ },
199
+ "happy-dom": {
200
+ "optional": true
173
201
  }
174
202
  },
175
203
  "devDependencies": {
@@ -209,14 +237,17 @@
209
237
  "import": "{ configure, createSlot }",
210
238
  "ignore": [
211
239
  "./shadow-*",
240
+ "./reframe-*",
212
241
  "./overrides-*",
213
242
  "./sri-*",
214
243
  "./dedupe-*",
215
244
  "./contract-*",
216
245
  "./expose-*",
217
- "./capture-*"
246
+ "./capture-*",
247
+ "./channel-*",
248
+ "./hydrate-*"
218
249
  ],
219
- "limit": "4.6 kB"
250
+ "limit": "4.65 kB"
220
251
  },
221
252
  {
222
253
  "name": "núcleo",
@@ -224,38 +255,58 @@
224
255
  "import": "{ RemoteError, __reset, component, configure, createEventBus, createSlot, defineRemote, events, html, loadRemote, mountRemote, navigate, preload, register, render, unsafeHTML }",
225
256
  "ignore": [
226
257
  "./shadow-*",
258
+ "./reframe-*",
259
+ "./overrides-*",
227
260
  "./sri-*",
228
261
  "./dedupe-*",
229
262
  "./contract-*",
230
263
  "./expose-*",
231
- "./capture-*"
264
+ "./capture-*",
265
+ "./channel-*",
266
+ "./hydrate-*"
232
267
  ],
233
- "limit": "5.73 kB"
268
+ "limit": "5.78 kB"
234
269
  },
235
270
  {
236
271
  "name": "SRI e dedupe (sob demanda, com as dependências)",
237
272
  "path": "dist/sri-*.js",
238
- "limit": "2.4 kB"
273
+ "limit": "2.61 kB"
239
274
  },
240
275
  {
241
276
  "name": "dedupe (sob demanda, para hosts que oferecem dependências)",
242
277
  "path": "dist/dedupe-*.js",
243
278
  "limit": "0.67 kB"
244
279
  },
280
+ {
281
+ "name": "overrides (sob demanda)",
282
+ "path": "dist/overrides-*.js",
283
+ "limit": "1.29 kB"
284
+ },
285
+ {
286
+ "name": "canal: canary e rollback (sob demanda)",
287
+ "path": "dist/channel-*.js",
288
+ "ignore": [
289
+ "./chunk-*"
290
+ ],
291
+ "limit": "1.02 kB"
292
+ },
245
293
  {
246
294
  "name": "host mínimo + store",
247
295
  "path": "dist/index.js",
248
296
  "import": "{ configure, createSlot, provide, shared, batch }",
249
297
  "ignore": [
250
298
  "./shadow-*",
299
+ "./reframe-*",
251
300
  "./overrides-*",
252
301
  "./sri-*",
253
302
  "./dedupe-*",
254
303
  "./contract-*",
255
304
  "./expose-*",
256
- "./capture-*"
305
+ "./capture-*",
306
+ "./channel-*",
307
+ "./hydrate-*"
257
308
  ],
258
- "limit": "5.29 kB"
309
+ "limit": "5.35 kB"
259
310
  },
260
311
  {
261
312
  "name": "host mínimo + store + persist + syncTabs",
@@ -263,14 +314,26 @@
263
314
  "import": "{ configure, createSlot, provide, shared, batch, persist, syncTabs }",
264
315
  "ignore": [
265
316
  "./shadow-*",
317
+ "./reframe-*",
266
318
  "./overrides-*",
267
319
  "./sri-*",
268
320
  "./dedupe-*",
269
321
  "./contract-*",
270
322
  "./expose-*",
271
- "./capture-*"
323
+ "./capture-*",
324
+ "./channel-*",
325
+ "./hydrate-*"
272
326
  ],
273
- "limit": "5.51 kB"
327
+ "limit": "5.57 kB"
328
+ },
329
+ {
330
+ "name": "reframe: JS em iframe oculto, DOM no Shadow DOM (sob demanda, além do núcleo e do Shadow DOM)",
331
+ "path": "dist/reframe-*.js",
332
+ "ignore": [
333
+ "./chunk-*",
334
+ "./shadow-*"
335
+ ],
336
+ "limit": "2.8 kB"
274
337
  },
275
338
  {
276
339
  "name": "estilos do Shadow DOM (além do núcleo)",
@@ -278,7 +341,15 @@
278
341
  "ignore": [
279
342
  "./chunk-*"
280
343
  ],
281
- "limit": "1.22 kB"
344
+ "limit": "1.72 kB"
345
+ },
346
+ {
347
+ "name": "hidratação do SSR do gateway (sob demanda)",
348
+ "path": "dist/hydrate-*.js",
349
+ "ignore": [
350
+ "./chunk-*"
351
+ ],
352
+ "limit": "1.5 kB"
282
353
  },
283
354
  {
284
355
  "name": "react",
@@ -288,11 +359,15 @@
288
359
  "react",
289
360
  "react-dom",
290
361
  "./shadow-*",
362
+ "./reframe-*",
363
+ "./overrides-*",
291
364
  "./sri-*",
292
365
  "./dedupe-*",
293
366
  "./contract-*",
294
367
  "./expose-*",
295
- "./capture-*"
368
+ "./capture-*",
369
+ "./channel-*",
370
+ "./hydrate-*"
296
371
  ],
297
372
  "limit": "6.2 kB"
298
373
  },
@@ -303,13 +378,17 @@
303
378
  "ignore": [
304
379
  "vue",
305
380
  "./shadow-*",
381
+ "./reframe-*",
382
+ "./overrides-*",
306
383
  "./sri-*",
307
384
  "./dedupe-*",
308
385
  "./contract-*",
309
386
  "./expose-*",
310
- "./capture-*"
387
+ "./capture-*",
388
+ "./channel-*",
389
+ "./hydrate-*"
311
390
  ],
312
- "limit": "6.08 kB"
391
+ "limit": "6.12 kB"
313
392
  },
314
393
  {
315
394
  "name": "element",
@@ -317,45 +396,115 @@
317
396
  "import": "{ defineVitralElement }",
318
397
  "ignore": [
319
398
  "./shadow-*",
399
+ "./reframe-*",
400
+ "./overrides-*",
320
401
  "./sri-*",
321
402
  "./dedupe-*",
322
403
  "./contract-*",
323
404
  "./expose-*",
324
- "./capture-*"
405
+ "./capture-*",
406
+ "./channel-*",
407
+ "./hydrate-*"
325
408
  ],
326
- "limit": "6.32 kB"
409
+ "limit": "6.33 kB"
327
410
  },
328
411
  {
329
412
  "name": "devtools",
330
413
  "path": "dist/devtools.js",
331
414
  "import": "{ devtools }",
332
- "limit": "2 kB"
415
+ "limit": "2.05 kB"
333
416
  },
334
417
  {
335
418
  "name": "auto",
336
419
  "path": "dist/auto.js",
337
- "limit": "6.07 kB",
420
+ "limit": "6.2 kB",
338
421
  "ignore": [
339
422
  "./shadow-*",
423
+ "./reframe-*",
340
424
  "./overrides-*",
341
425
  "./sri-*",
342
426
  "./dedupe-*",
343
427
  "./contract-*",
344
428
  "./expose-*",
345
- "./capture-*"
429
+ "./capture-*",
430
+ "./channel-*",
431
+ "./hydrate-*"
346
432
  ]
347
433
  },
348
434
  {
349
435
  "name": "routes",
350
436
  "path": "dist/routes.js",
351
437
  "import": "{ routes }",
352
- "limit": "8.67 kB"
438
+ "limit": "9.15 kB",
439
+ "ignore": [
440
+ "./overrides-*",
441
+ "./channel-*",
442
+ "./reframe-*",
443
+ "./hydrate-*"
444
+ ]
445
+ },
446
+ {
447
+ "name": "single-spa",
448
+ "path": "dist/single-spa.js",
449
+ "import": "{ singleSpaRemote }",
450
+ "limit": "0.5 kB"
451
+ },
452
+ {
453
+ "name": "federation",
454
+ "path": "dist/federation.js",
455
+ "import": "{ federationRemote }",
456
+ "limit": "1.25 kB"
457
+ },
458
+ {
459
+ "name": "prefetch",
460
+ "path": "dist/prefetch.js",
461
+ "import": "{ prefetch }",
462
+ "limit": "3.25 kB",
463
+ "ignore": [
464
+ "./shadow-*",
465
+ "./overrides-*",
466
+ "./sri-*",
467
+ "./dedupe-*",
468
+ "./contract-*",
469
+ "./expose-*",
470
+ "./capture-*",
471
+ "./channel-*"
472
+ ]
353
473
  },
354
474
  {
355
475
  "name": "iframe",
356
476
  "path": "dist/iframe.js",
357
477
  "import": "{ enableIframe }",
358
- "limit": "6 kB"
478
+ "limit": "6 kB",
479
+ "ignore": [
480
+ "./overrides-*",
481
+ "./channel-*",
482
+ "./reframe-*",
483
+ "./hydrate-*"
484
+ ]
485
+ },
486
+ {
487
+ "name": "embed (loader de sites de terceiros, arquivo único com Shadow DOM, SRI e canal)",
488
+ "path": "dist/embed.js",
489
+ "limit": "12.01 kB"
490
+ },
491
+ {
492
+ "name": "vitals (Web Vitals por remote)",
493
+ "path": "dist/vitals.js",
494
+ "import": "{ vitals }",
495
+ "limit": "1.4 kB"
496
+ },
497
+ {
498
+ "name": "dict (middleware de servidor)",
499
+ "path": "dist/dict.js",
500
+ "import": "{ createDict }",
501
+ "limit": "1 kB"
502
+ },
503
+ {
504
+ "name": "edge (gateway, no servidor)",
505
+ "path": "dist/edge.js",
506
+ "import": "{ gateway, toNodeListener }",
507
+ "limit": "5 kB"
359
508
  }
360
509
  ],
361
510
  "scripts": {
@@ -1,42 +0,0 @@
1
- import {
2
- protocol
3
- } from "./chunk-GNPFWISJ.js";
4
-
5
- // src/core/overrides.ts
6
- var OVERRIDES_KEY = "vitral:overrides";
7
- function overridesEnabled() {
8
- return !!protocol().settings().devOverrides || typeof location !== "undefined" && /^(localhost|127\.0\.0\.1|\[::1\])$/.test(location.hostname);
9
- }
10
- var manifestUrl = (url) => /\.(json|m?js)(\?|$)/.test(url) ? url : url.replace(/\/?$/, "/vitral.json");
11
- function storedOverrides() {
12
- try {
13
- return JSON.parse(localStorage.getItem(OVERRIDES_KEY) ?? "{}") ?? {};
14
- } catch {
15
- return {};
16
- }
17
- }
18
- var warned = /* @__PURE__ */ new Set();
19
- function overrideFor(name) {
20
- if (!overridesEnabled()) return;
21
- const all = storedOverrides();
22
- for (const pair of new URLSearchParams(location.search).getAll("vitral").join(",").split(",")) {
23
- const at = pair.indexOf("@");
24
- if (at > 0) all[pair.slice(0, at)] = pair.slice(at + 1);
25
- }
26
- if (!all[name]) return;
27
- const url = new URL(manifestUrl(all[name]), location.href).href;
28
- const p = protocol();
29
- const trusted = p.settings().trusted ?? [];
30
- const origin = new URL(url).origin;
31
- if (!trusted.includes(origin)) p.configure({ trusted: [...trusted, origin] });
32
- if (!warned.has(name)) console.warn(`[vitral] override ativo: ${name} \u2192 ${url}`), warned.add(name);
33
- return { url };
34
- }
35
-
36
- export {
37
- OVERRIDES_KEY,
38
- overridesEnabled,
39
- manifestUrl,
40
- storedOverrides,
41
- overrideFor
42
- };
@@ -1,15 +0,0 @@
1
- import {
2
- resolveModule,
3
- resolveTarget,
4
- splitName
5
- } from "./chunk-SDB5AZEI.js";
6
- import "./chunk-TD4S3IHA.js";
7
- import "./chunk-ZAC6QQI6.js";
8
- import "./chunk-GNHCZRQP.js";
9
- import "./chunk-AKNNHQ2H.js";
10
- import "./chunk-GNPFWISJ.js";
11
- export {
12
- resolveModule,
13
- resolveTarget,
14
- splitName
15
- };
@@ -1,15 +0,0 @@
1
- import {
2
- OVERRIDES_KEY,
3
- manifestUrl,
4
- overrideFor,
5
- overridesEnabled,
6
- storedOverrides
7
- } from "./chunk-DXORSF4X.js";
8
- import "./chunk-GNPFWISJ.js";
9
- export {
10
- OVERRIDES_KEY,
11
- manifestUrl,
12
- overrideFor,
13
- overridesEnabled,
14
- storedOverrides
15
- };