@cabloy/vue-runtime-core 3.5.7 → 3.5.9

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.
@@ -2313,17 +2313,19 @@ function defineAsyncComponent(source) {
2313
2313
  suspensible = true,
2314
2314
  onError: userOnError
2315
2315
  } = source;
2316
+ let instanceAttrs = void 0;
2316
2317
  let pendingRequest = null;
2317
2318
  let resolvedComp;
2318
2319
  let retries = 0;
2319
2320
  const retry = () => {
2320
2321
  retries++;
2321
2322
  pendingRequest = null;
2322
- return load();
2323
+ return load(instanceAttrs);
2323
2324
  };
2324
- const load = () => {
2325
+ const load = (attrs) => {
2326
+ instanceAttrs = attrs;
2325
2327
  let thisRequest;
2326
- return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
2328
+ return pendingRequest || (thisRequest = pendingRequest = loader(attrs).catch((err) => {
2327
2329
  err = err instanceof Error ? err : new Error(String(err));
2328
2330
  if (userOnError) {
2329
2331
  return new Promise((resolve, reject) => {
@@ -2369,7 +2371,7 @@ function defineAsyncComponent(source) {
2369
2371
  if (resolvedComp) {
2370
2372
  doHydrate();
2371
2373
  } else {
2372
- load().then(() => !instance.isUnmounted && doHydrate());
2374
+ load(instance.attrs).then(() => !instance.isUnmounted && doHydrate());
2373
2375
  }
2374
2376
  },
2375
2377
  get __asyncResolved() {
@@ -2391,7 +2393,7 @@ function defineAsyncComponent(source) {
2391
2393
  );
2392
2394
  };
2393
2395
  if (suspensible && instance.suspense || isInSSRComponentSetup) {
2394
- return load().then((comp) => {
2396
+ return load(instance.attrs).then((comp) => {
2395
2397
  return () => createInnerComp(comp, instance);
2396
2398
  }).catch((err) => {
2397
2399
  onError(err);
@@ -2419,7 +2421,7 @@ function defineAsyncComponent(source) {
2419
2421
  }
2420
2422
  }, timeout);
2421
2423
  }
2422
- load().then(() => {
2424
+ load(instance.attrs).then(() => {
2423
2425
  loaded.value = true;
2424
2426
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
2425
2427
  instance.parent.update();
@@ -1693,17 +1693,19 @@ function defineAsyncComponent(source) {
1693
1693
  suspensible = true,
1694
1694
  onError: userOnError
1695
1695
  } = source;
1696
+ let instanceAttrs = void 0;
1696
1697
  let pendingRequest = null;
1697
1698
  let resolvedComp;
1698
1699
  let retries = 0;
1699
1700
  const retry = () => {
1700
1701
  retries++;
1701
1702
  pendingRequest = null;
1702
- return load();
1703
+ return load(instanceAttrs);
1703
1704
  };
1704
- const load = () => {
1705
+ const load = (attrs) => {
1706
+ instanceAttrs = attrs;
1705
1707
  let thisRequest;
1706
- return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
1708
+ return pendingRequest || (thisRequest = pendingRequest = loader(attrs).catch((err) => {
1707
1709
  err = err instanceof Error ? err : new Error(String(err));
1708
1710
  if (userOnError) {
1709
1711
  return new Promise((resolve, reject) => {
@@ -1741,7 +1743,7 @@ function defineAsyncComponent(source) {
1741
1743
  if (resolvedComp) {
1742
1744
  doHydrate();
1743
1745
  } else {
1744
- load().then(() => !instance.isUnmounted && doHydrate());
1746
+ load(instance.attrs).then(() => !instance.isUnmounted && doHydrate());
1745
1747
  }
1746
1748
  },
1747
1749
  get __asyncResolved() {
@@ -1763,7 +1765,7 @@ function defineAsyncComponent(source) {
1763
1765
  );
1764
1766
  };
1765
1767
  if (suspensible && instance.suspense || isInSSRComponentSetup) {
1766
- return load().then((comp) => {
1768
+ return load(instance.attrs).then((comp) => {
1767
1769
  return () => createInnerComp(comp, instance);
1768
1770
  }).catch((err) => {
1769
1771
  onError(err);
@@ -1791,7 +1793,7 @@ function defineAsyncComponent(source) {
1791
1793
  }
1792
1794
  }, timeout);
1793
1795
  }
1794
- load().then(() => {
1796
+ load(instance.attrs).then(() => {
1795
1797
  loaded.value = true;
1796
1798
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
1797
1799
  instance.parent.update();
@@ -1507,7 +1507,7 @@ export declare const hydrateOnInteraction: HydrationStrategyFactory<keyof HTMLEl
1507
1507
  type AsyncComponentResolveResult<T = Component> = T | {
1508
1508
  default: T;
1509
1509
  };
1510
- export type AsyncComponentLoader<T = any> = () => Promise<AsyncComponentResolveResult<T>>;
1510
+ export type AsyncComponentLoader<T = any> = (attrs?: Record<string, unknown>) => Promise<AsyncComponentResolveResult<T>>;
1511
1511
  export interface AsyncComponentOptions<T = any> {
1512
1512
  loader: AsyncComponentLoader<T>;
1513
1513
  loadingComponent?: Component;
@@ -2328,17 +2328,19 @@ function defineAsyncComponent(source) {
2328
2328
  suspensible = true,
2329
2329
  onError: userOnError
2330
2330
  } = source;
2331
+ let instanceAttrs = void 0;
2331
2332
  let pendingRequest = null;
2332
2333
  let resolvedComp;
2333
2334
  let retries = 0;
2334
2335
  const retry = () => {
2335
2336
  retries++;
2336
2337
  pendingRequest = null;
2337
- return load();
2338
+ return load(instanceAttrs);
2338
2339
  };
2339
- const load = () => {
2340
+ const load = (attrs) => {
2341
+ instanceAttrs = attrs;
2340
2342
  let thisRequest;
2341
- return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
2343
+ return pendingRequest || (thisRequest = pendingRequest = loader(attrs).catch((err) => {
2342
2344
  err = err instanceof Error ? err : new Error(String(err));
2343
2345
  if (userOnError) {
2344
2346
  return new Promise((resolve, reject) => {
@@ -2384,7 +2386,7 @@ function defineAsyncComponent(source) {
2384
2386
  if (resolvedComp) {
2385
2387
  doHydrate();
2386
2388
  } else {
2387
- load().then(() => !instance.isUnmounted && doHydrate());
2389
+ load(instance.attrs).then(() => !instance.isUnmounted && doHydrate());
2388
2390
  }
2389
2391
  },
2390
2392
  get __asyncResolved() {
@@ -2406,7 +2408,7 @@ function defineAsyncComponent(source) {
2406
2408
  );
2407
2409
  };
2408
2410
  if (suspensible && instance.suspense || isInSSRComponentSetup) {
2409
- return load().then((comp) => {
2411
+ return load(instance.attrs).then((comp) => {
2410
2412
  return () => createInnerComp(comp, instance);
2411
2413
  }).catch((err) => {
2412
2414
  onError(err);
@@ -2434,7 +2436,7 @@ function defineAsyncComponent(source) {
2434
2436
  }
2435
2437
  }, timeout);
2436
2438
  }
2437
- load().then(() => {
2439
+ load(instance.attrs).then(() => {
2438
2440
  loaded.value = true;
2439
2441
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
2440
2442
  instance.parent.update();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabloy/vue-runtime-core",
3
- "version": "3.5.7",
3
+ "version": "3.5.9",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",
@@ -47,6 +47,6 @@
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
48
48
  "dependencies": {
49
49
  "@vue/shared": "3.5.6",
50
- "@vue/reactivity": "npm:@cabloy/vue-reactivity@3.5.7"
50
+ "@vue/reactivity": "npm:@cabloy/vue-reactivity@3.5.9"
51
51
  }
52
52
  }