@qwik.dev/core 2.0.0-beta.27 → 2.0.0-beta.29

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.
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwik.dev/core/backpatch",
3
- "version": "2.0.0-beta.27-dev+7fc6984",
3
+ "version": "2.0.0-beta.29-dev+bc61b71",
4
4
  "main": "index.mjs",
5
5
  "types": "index.d.ts",
6
6
  "private": true,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwik.dev/core/build",
3
- "version": "2.0.0-beta.27-dev+7fc6984",
3
+ "version": "2.0.0-beta.29-dev+bc61b71",
4
4
  "main": "index.mjs",
5
5
  "types": "index.d.ts",
6
6
  "private": true,
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core/cli 2.0.0-beta.27-dev+7fc6984
3
+ * @qwik.dev/core/cli 2.0.0-beta.29-dev+bc61b71
4
4
  * Copyright QwikDev. All Rights Reserved.
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
@@ -12908,7 +12908,7 @@ async function printHelp(app) {
12908
12908
  await runCommand2(Object.assign(app, { task: args[0], args }));
12909
12909
  }
12910
12910
  function printVersion() {
12911
- console.log("2.0.0-beta.27-dev+7fc6984");
12911
+ console.log("2.0.0-beta.29-dev+bc61b71");
12912
12912
  }
12913
12913
  export {
12914
12914
  runCli,
@@ -79,6 +79,19 @@ import { isServer } from './build';
79
79
  */
80
80
  export declare const $: <T>(expression: T) => QRL<T>;
81
81
 
82
+ /**
83
+ * Register an external projection on a parent component VNode.
84
+ *
85
+ * Creates a new VirtualVNode that will render the given component QRL with the given props. The
86
+ * VNode is stored as a projection on the parent, and a low-priority cursor is added so the cursor
87
+ * walker will process it.
88
+ *
89
+ * Use `_setProjectionTarget` to set the DOM target element before the cursor fires.
90
+ *
91
+ * @internal
92
+ */
93
+ export declare function _addProjection(container: _Container, parentVNode: _VirtualVNode, componentQRL: QRL<any>, props: Record<string, unknown>, slotName: string): _VirtualVNode;
94
+
82
95
  declare interface AddRootFn {
83
96
  (obj: unknown, returnRef?: never): number;
84
97
  (obj: unknown, returnRef: true): SeenRef;
@@ -1076,7 +1089,7 @@ export declare const createContextId: <STATE = unknown>(name: string) => Context
1076
1089
  *
1077
1090
  * @internal
1078
1091
  */
1079
- export declare const _createQRL: <TYPE>(chunk: string | null, symbol: string, symbolRef?: null | ValueOrPromise<TYPE>, symbolFn?: null | (() => Promise<Record<string, TYPE>>), captures?: Readonly<unknown[]> | string | null) => _QRLInternal<TYPE>;
1092
+ export declare const _createQRL: <TYPE>(chunk: string | null, symbol: string, symbolRef?: null | ValueOrPromise<TYPE>, symbolFn?: null | (() => Promise<Record<string, TYPE>>), captures?: Readonly<unknown[]> | string | null, container?: _Container) => _QRLInternal<TYPE>;
1080
1093
 
1081
1094
  /**
1082
1095
  * Create a signal that holds a custom serializable value. See {@link useSerializer$} for more
@@ -1422,6 +1435,13 @@ export { h }
1422
1435
  */
1423
1436
  export declare const _hasStoreEffects: (value: StoreTarget, prop: keyof StoreTarget) => boolean;
1424
1437
 
1438
+ /**
1439
+ * HMR event handler. Replaces the component QRL with a fresh one and marks dirty.
1440
+ *
1441
+ * @internal
1442
+ */
1443
+ export declare const _hmr: (event: Event, element: Element) => void;
1444
+
1425
1445
  /** @public */
1426
1446
  declare interface HoistEntryStrategy {
1427
1447
  type: 'hoist';
@@ -1857,6 +1877,25 @@ declare type JSXWindowEvents = {
1857
1877
  */
1858
1878
  export declare type KnownEventNames = LiteralUnion<AllEventKeys, string>;
1859
1879
 
1880
+ /**
1881
+ * Shared lazy-loading reference that holds module loading metadata. Multiple QRLs pointing to the
1882
+ * same chunk+symbol can share a single LazyRef, differing only in their captured scope.
1883
+ */
1884
+ declare class LazyRef<TYPE = unknown> {
1885
+ readonly $chunk$: string | null;
1886
+ readonly $symbol$: string;
1887
+ readonly $symbolFn$: undefined | null | (() => Promise<Record<string, TYPE>>);
1888
+ $ref$?: (null | ValueOrPromise<TYPE>) | undefined;
1889
+ $container$: _Container | undefined;
1890
+ dev?: QRLDev | null | undefined;
1891
+ constructor($chunk$: string | null, $symbol$: string, $symbolFn$: undefined | null | (() => Promise<Record<string, TYPE>>), $ref$?: (null | ValueOrPromise<TYPE>) | undefined, container?: _Container | null);
1892
+ /** We don't read hash very often so let's not allocate a string for every QRL */
1893
+ get $hash$(): string;
1894
+ $setRef$(ref: ValueOrPromise<TYPE>): void;
1895
+ /** Load the raw module export without capture binding. */
1896
+ $load$(): ValueOrPromise<TYPE>;
1897
+ }
1898
+
1860
1899
  declare type LcEvent<T extends string, C extends string = Lowercase<T>> = C extends keyof AllEventsMap ? AllEventsMap[C] : Event;
1861
1900
 
1862
1901
  declare type LcEventNameMap = {
@@ -2372,21 +2411,35 @@ declare type QRLInternalMethods<TYPE> = {
2372
2411
  readonly $symbol$: string;
2373
2412
  readonly $hash$: string;
2374
2413
  /** If it's a string it's serialized */
2375
- $captures$: Readonly<unknown[]> | string | null;
2376
- dev: QRLDev | null;
2414
+ readonly $captures$?: Readonly<unknown[]> | string | null;
2415
+ dev?: QRLDev | null;
2377
2416
  resolve(container?: _Container): Promise<TYPE>;
2378
2417
  resolved: undefined | TYPE;
2379
2418
  getSymbol(): string;
2380
2419
  getHash(): string;
2381
2420
  getCaptured(): unknown[] | null;
2382
- getFn(currentCtx?: InvokeContext, beforeFn?: () => void): TYPE extends (...args: any) => any ? (...args: Parameters<TYPE>) => ValueOrPromise<ReturnType<TYPE>> : unknown;
2421
+ getFn(currentCtx?: InvokeContext,
2422
+ /** If this returns false, the function execution will be skipped */
2423
+ beforeFn?: () => void | false): TYPE extends (...args: any) => any ? (...args: Parameters<TYPE>) => ValueOrPromise<ReturnType<TYPE> | undefined> : unknown;
2424
+ $callFn$(withThis: unknown, ...args: QrlArgs<TYPE>): ValueOrPromise<QrlReturn<TYPE>>;
2425
+ /**
2426
+ * "with captures" - Get a new QRL for these captures, reusing the lazy ref. It's an internal
2427
+ * method but we need to have a stable name because it gets called in user code by the optimizer,
2428
+ * after the $name$ props are mangled
2429
+ */
2430
+ w(captures: Readonly<unknown[]> | string | null): _QRLInternal<TYPE>;
2431
+ /**
2432
+ * "set ref" - Set the ref of the QRL. It's an internal method but we need to have a stable name
2433
+ * because it gets called in user code by the optimizer, after the $name$ props are mangled
2434
+ */
2435
+ s(ref: ValueOrPromise<TYPE>): void;
2383
2436
  /**
2384
2437
  * Needed for deserialization and importing. We don't always have the container while creating
2385
2438
  * qrls in async sections of code
2386
2439
  */
2387
- $container$: _Container | null;
2388
- /** Only in dev mode */
2389
- $symbolRef$?: null | ValueOrPromise<TYPE>;
2440
+ readonly $container$?: _Container | null;
2441
+ /** The shared lazy-loading reference */
2442
+ readonly $lazy$: LazyRef<TYPE>;
2390
2443
  };
2391
2444
 
2392
2445
  declare type QrlReturn<T> = T extends (...args: any) => infer R ? Awaited<R> : unknown;
@@ -2731,6 +2784,13 @@ declare type RefFnInterface<EL> = {
2731
2784
  */
2732
2785
  export declare const _regSymbol: (symbol: any, hash: string) => any;
2733
2786
 
2787
+ /**
2788
+ * Remove an external projection from its parent and clean up.
2789
+ *
2790
+ * @internal
2791
+ */
2792
+ export declare function _removeProjection(container: _Container, parentVNode: _VirtualVNode, vnode: _VirtualVNode, slotName: string): void;
2793
+
2734
2794
  /**
2735
2795
  * Render JSX.
2736
2796
  *
@@ -3095,6 +3155,16 @@ export declare function _setEvent(serializationCtx: SerializationContext, key: s
3095
3155
  */
3096
3156
  export declare const setPlatform: (plt: CorePlatform) => CorePlatform;
3097
3157
 
3158
+ /**
3159
+ * Set the DOM target element for an external projection VNode.
3160
+ *
3161
+ * When the cursor walker processes this VNode, DOM operations will target this element instead of
3162
+ * walking the parent chain.
3163
+ *
3164
+ * @internal
3165
+ */
3166
+ export declare function _setProjectionTarget(vnode: _VirtualVNode, targetElement: Element): void;
3167
+
3098
3168
  /** @internal */
3099
3169
  export declare abstract class _SharedContainer implements _Container {
3100
3170
  readonly $version$: string;
@@ -3165,7 +3235,7 @@ declare class SignalImpl<T = any> implements Signal<T> {
3165
3235
  $effects$: undefined | Set<EffectSubscription>;
3166
3236
  $container$: _Container | null;
3167
3237
  $wrappedSignal$: WrappedSignalImpl<T> | null;
3168
- constructor(container: _Container | null, value: T);
3238
+ constructor(container: _Container | null | undefined, value: T);
3169
3239
  /**
3170
3240
  * Use this to trigger running subscribers, for example when the calculated value has mutated but
3171
3241
  * remained the same object
@@ -4032,6 +4102,13 @@ declare type UnwantedKeys = keyof HTMLAttributesBase | keyof DOMAttributes<any>
4032
4102
  */
4033
4103
  export declare const unwrapStore: <T>(value: T) => T;
4034
4104
 
4105
+ /**
4106
+ * Update the props on an external projection VNode and trigger re-rendering.
4107
+ *
4108
+ * @internal
4109
+ */
4110
+ export declare function _updateProjectionProps(container: _Container, vnode: _VirtualVNode, newProps: Record<string, unknown>): void;
4111
+
4035
4112
  /**
4036
4113
  * Creates an AsyncSignal which holds the result of the given async function. If the function uses
4037
4114
  * `track()` to track reactive state, and that state changes, the AsyncSignal is recalculated, and
@@ -4205,6 +4282,14 @@ export declare const useContextProvider: <STATE>(context: ContextId<STATE>, newV
4205
4282
  /** @public */
4206
4283
  export declare const useErrorBoundary: () => ErrorBoundaryStore;
4207
4284
 
4285
+ /**
4286
+ * Injected by the optimizer into component$ bodies in HMR mode. Registers a document event listener
4287
+ * that triggers component re-render on HMR updates.
4288
+ *
4289
+ * @internal
4290
+ */
4291
+ export declare function _useHmr(devPath: string): void;
4292
+
4208
4293
  /** @public */
4209
4294
  export declare const useId: () => string;
4210
4295
 
@@ -4688,7 +4773,7 @@ export declare const _VAR_PROPS: unique symbol;
4688
4773
  export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
4689
4774
 
4690
4775
  /**
4691
- * 2.0.0-beta.27-dev+7fc6984
4776
+ * 2.0.0-beta.29-dev+bc61b71
4692
4777
  *
4693
4778
  * @public
4694
4779
  */
@@ -4822,7 +4907,8 @@ export declare const enum _VNodeFlags {
4822
4907
  NEGATED_NAMESPACE_MASK = -1537,
4823
4908
  NS_html = 0,// http://www.w3.org/1999/xhtml
4824
4909
  NS_svg = 512,// http://www.w3.org/2000/svg
4825
- NS_math = 1024
4910
+ NS_math = 1024,// http://www.w3.org/1998/Math/MathML
4911
+ HasTargetElement = 2048
4826
4912
  }
4827
4913
 
4828
4914
  /** @internal */