@qwik.dev/core 2.0.0-beta.24 → 2.0.0-beta.26
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/bindings/qwik.darwin-arm64.node +0 -0
- package/bindings/qwik.linux-x64-gnu.node +0 -0
- package/bindings/qwik.win32-x64-msvc.node +0 -0
- package/bindings/qwik_wasm_bg.wasm +0 -0
- package/dist/backpatch/package.json +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/core-internal.d.ts +6 -4
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +251 -134
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +210 -140
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.mjs +320 -319
- package/dist/server.mjs +3 -17
- package/dist/starters/adapters/fastify/package.json +1 -1
- package/dist/testing/index.d.ts +133 -2
- package/dist/testing/index.mjs +206 -164
- package/dist/testing/package.json +1 -1
- package/package.json +3 -3
package/dist/server.mjs
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/server 2.0.0-beta.
|
|
3
|
+
* @qwik.dev/core/server 2.0.0-beta.26-dev+c693cf5
|
|
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
|
|
7
7
|
*/
|
|
8
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
9
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
10
|
-
}) : x)(function(x) {
|
|
11
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
12
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
-
});
|
|
14
8
|
|
|
15
9
|
// packages/qwik/src/server/index.ts
|
|
16
10
|
import { setPlatform as setPlatform2 } from "@qwik.dev/core";
|
|
@@ -1174,15 +1168,7 @@ function createPlatform(opts, resolvedManifest) {
|
|
|
1174
1168
|
if (regSym) {
|
|
1175
1169
|
return regSym;
|
|
1176
1170
|
}
|
|
1177
|
-
|
|
1178
|
-
if (!modulePath.endsWith(".js")) {
|
|
1179
|
-
modulePath += ".js";
|
|
1180
|
-
}
|
|
1181
|
-
const module = __require(modulePath);
|
|
1182
|
-
if (!(symbolName in module)) {
|
|
1183
|
-
throw new Error(`Q-ERROR: missing symbol '${symbolName}' in module '${modulePath}'.`);
|
|
1184
|
-
}
|
|
1185
|
-
return module[symbolName];
|
|
1171
|
+
throw qError(6 /* dynamicImportFailed */, [symbolName]);
|
|
1186
1172
|
},
|
|
1187
1173
|
raf: () => {
|
|
1188
1174
|
console.error("server can not rerender");
|
|
@@ -1232,7 +1218,7 @@ function getBuildBase(opts) {
|
|
|
1232
1218
|
return `${import.meta.env.BASE_URL || "/"}build/`;
|
|
1233
1219
|
}
|
|
1234
1220
|
var versions = {
|
|
1235
|
-
qwik: "2.0.0-beta.
|
|
1221
|
+
qwik: "2.0.0-beta.26-dev+c693cf5",
|
|
1236
1222
|
qwikDom: "2.1.19"
|
|
1237
1223
|
};
|
|
1238
1224
|
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -50,6 +50,9 @@ declare const enum ChoreBits {
|
|
|
50
50
|
DIRTY_MASK = 127
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
/** @internal */
|
|
54
|
+
declare const _CONST_PROPS: unique symbol;
|
|
55
|
+
|
|
53
56
|
/**
|
|
54
57
|
* Effect is something which needs to happen (side-effect) due to signal value change.
|
|
55
58
|
*
|
|
@@ -187,6 +190,14 @@ declare interface DescriptorBase<T = unknown, B = unknown> extends BackRef {
|
|
|
187
190
|
$destroy$: (() => void) | null;
|
|
188
191
|
}
|
|
189
192
|
|
|
193
|
+
/** @public */
|
|
194
|
+
declare interface DevJSX {
|
|
195
|
+
fileName: string;
|
|
196
|
+
lineNumber: number;
|
|
197
|
+
columnNumber: number;
|
|
198
|
+
stack?: string;
|
|
199
|
+
}
|
|
200
|
+
|
|
190
201
|
declare type DomRef = {
|
|
191
202
|
$ssrNode$: SsrNode;
|
|
192
203
|
};
|
|
@@ -204,6 +215,8 @@ export declare function domRender(jsx: JSXOutput, opts?: {
|
|
|
204
215
|
/** @internal */
|
|
205
216
|
declare const _EFFECT_BACK_REF: unique symbol;
|
|
206
217
|
|
|
218
|
+
declare type EffectBackRef = SignalImpl | StoreTarget | PropsProxy;
|
|
219
|
+
|
|
207
220
|
declare const enum EffectProperty {
|
|
208
221
|
COMPONENT = ":",
|
|
209
222
|
VNODE = "."
|
|
@@ -248,9 +261,9 @@ declare const enum EffectProperty {
|
|
|
248
261
|
declare class EffectSubscription {
|
|
249
262
|
consumer: Consumer;
|
|
250
263
|
property: EffectProperty | string;
|
|
251
|
-
backRef: Set<
|
|
264
|
+
backRef: Set<EffectBackRef> | null;
|
|
252
265
|
data: SubscriptionData | null;
|
|
253
|
-
constructor(consumer: Consumer, property: EffectProperty | string, backRef?: Set<
|
|
266
|
+
constructor(consumer: Consumer, property: EffectProperty | string, backRef?: Set<EffectBackRef> | null, data?: SubscriptionData | null);
|
|
254
267
|
}
|
|
255
268
|
|
|
256
269
|
/**
|
|
@@ -288,6 +301,17 @@ export declare function emulateExecutionOfQwikFuncs(document: Document): void;
|
|
|
288
301
|
/** @public */
|
|
289
302
|
export declare function expectDOM(actual: Element, expected: string): Promise<void>;
|
|
290
303
|
|
|
304
|
+
/**
|
|
305
|
+
* Any function taking a props object that returns JSXOutput.
|
|
306
|
+
*
|
|
307
|
+
* The `key`, `flags` and `dev` parameters are for internal use.
|
|
308
|
+
*
|
|
309
|
+
* @public
|
|
310
|
+
*/
|
|
311
|
+
declare type FunctionComponent<P = unknown> = {
|
|
312
|
+
renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput_2;
|
|
313
|
+
}['renderFn'];
|
|
314
|
+
|
|
291
315
|
/** @public */
|
|
292
316
|
export declare function getTestPlatform(): TestPlatform;
|
|
293
317
|
|
|
@@ -318,6 +342,84 @@ declare interface ISsrNode {
|
|
|
318
342
|
setTreeNonUpdatable(): void;
|
|
319
343
|
}
|
|
320
344
|
|
|
345
|
+
/** @public */
|
|
346
|
+
declare type JSXChildren = string | number | boolean | null | undefined | Function | RegExp | JSXChildren[] | Promise<JSXChildren> | Signal<JSXChildren> | JSXNode;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* A JSX Node, an internal structure. You probably want to use `JSXOutput` instead.
|
|
350
|
+
*
|
|
351
|
+
* @public
|
|
352
|
+
*/
|
|
353
|
+
declare interface JSXNode<T extends string | FunctionComponent | unknown = unknown> {
|
|
354
|
+
type: T;
|
|
355
|
+
props: T extends FunctionComponent<infer P> ? P : Record<any, unknown>;
|
|
356
|
+
children: JSXChildren | null;
|
|
357
|
+
key: string | null;
|
|
358
|
+
dev?: DevJSX;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
declare class JSXNodeImpl<T = unknown> implements JSXNodeInternal_2<T> {
|
|
362
|
+
type: T;
|
|
363
|
+
children: JSXChildren;
|
|
364
|
+
toSort: boolean;
|
|
365
|
+
key: string | null;
|
|
366
|
+
varProps: Props;
|
|
367
|
+
constProps: Props | null;
|
|
368
|
+
dev?: DevJSX & {
|
|
369
|
+
stack: string | undefined;
|
|
370
|
+
};
|
|
371
|
+
_proxy: Props | null;
|
|
372
|
+
constructor(type: T, varProps: Props | null, constProps: Props | null, children: JSXChildren, key: string | number | null | undefined, toSort?: boolean, dev?: DevJSX);
|
|
373
|
+
get props(): T extends FunctionComponent<infer PROPS> ? PROPS : Props;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* The internal representation of a JSX Node.
|
|
378
|
+
*
|
|
379
|
+
* @internal
|
|
380
|
+
*/
|
|
381
|
+
declare interface JSXNodeInternal_2<T extends string | FunctionComponent | unknown = unknown> extends JSXNode<T> {
|
|
382
|
+
/** The type of node */
|
|
383
|
+
type: T;
|
|
384
|
+
/** Do the varProps need sorting */
|
|
385
|
+
toSort: boolean;
|
|
386
|
+
/** The key property */
|
|
387
|
+
key: string | null;
|
|
388
|
+
/**
|
|
389
|
+
* Props that are not guaranteed shallow equal across runs.
|
|
390
|
+
*
|
|
391
|
+
* Any prop that is in `constProps` takes precedence over `varProps`.
|
|
392
|
+
*
|
|
393
|
+
* Does not contain `children` or `key`.
|
|
394
|
+
*
|
|
395
|
+
* `onEvent$` props are normalized to the html `q-x:event` version
|
|
396
|
+
*/
|
|
397
|
+
varProps: Props;
|
|
398
|
+
/**
|
|
399
|
+
* Props that will be shallow equal across runs. Does not contain any props that are in varProps.
|
|
400
|
+
*
|
|
401
|
+
* Any prop that is in `constProps` takes precedence over `varProps`.
|
|
402
|
+
*
|
|
403
|
+
* Does not contain `children` or `key`.
|
|
404
|
+
*
|
|
405
|
+
* `onEvent$` props are normalized to the html `q-x:event` version
|
|
406
|
+
*/
|
|
407
|
+
constProps: Props | null;
|
|
408
|
+
/** The children of the node */
|
|
409
|
+
children: JSXChildren;
|
|
410
|
+
/** Filename etc for debugging */
|
|
411
|
+
dev?: DevJSX & {
|
|
412
|
+
stack: string | undefined;
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Any valid output for a component
|
|
418
|
+
*
|
|
419
|
+
* @public
|
|
420
|
+
*/
|
|
421
|
+
declare type JSXOutput_2 = JSXNode | string | number | boolean | null | undefined | JSXOutput_2[];
|
|
422
|
+
|
|
321
423
|
/** @public */
|
|
322
424
|
declare interface MockDocument extends Document {
|
|
323
425
|
}
|
|
@@ -344,10 +446,36 @@ declare interface NodePropData {
|
|
|
344
446
|
|
|
345
447
|
declare type ObjToProxyMap = WeakMap<any, any>;
|
|
346
448
|
|
|
449
|
+
/** @internal */
|
|
450
|
+
declare const _OWNER: unique symbol;
|
|
451
|
+
|
|
347
452
|
declare type PossibleEvents = Event | SimplifiedServerRequestEvent | typeof TaskEvent | typeof RenderEvent;
|
|
348
453
|
|
|
349
454
|
declare type Props = Record<string, unknown>;
|
|
350
455
|
|
|
456
|
+
/** @internal */
|
|
457
|
+
declare const _PROPS_HANDLER: unique symbol;
|
|
458
|
+
|
|
459
|
+
declare type PropsProxy = {
|
|
460
|
+
[_VAR_PROPS]: Props;
|
|
461
|
+
[_CONST_PROPS]: Props | null;
|
|
462
|
+
[_OWNER]: JSXNodeInternal_2;
|
|
463
|
+
[_PROPS_HANDLER]: PropsProxyHandler;
|
|
464
|
+
} & Record<string | symbol, unknown>;
|
|
465
|
+
|
|
466
|
+
declare class PropsProxyHandler implements ProxyHandler<any> {
|
|
467
|
+
owner: JSXNodeImpl;
|
|
468
|
+
$effects$: undefined | Map<string | symbol, Set<EffectSubscription>>;
|
|
469
|
+
$container$: Container | null;
|
|
470
|
+
constructor(owner: JSXNodeImpl);
|
|
471
|
+
get(_: any, prop: string | symbol): any;
|
|
472
|
+
set(_: any, prop: string | symbol, value: any): boolean;
|
|
473
|
+
deleteProperty(_: any, prop: string | symbol): boolean;
|
|
474
|
+
has(_: any, prop: string | symbol): boolean;
|
|
475
|
+
getOwnPropertyDescriptor(_: any, p: string | symbol): PropertyDescriptor | undefined;
|
|
476
|
+
ownKeys(): string[];
|
|
477
|
+
}
|
|
478
|
+
|
|
351
479
|
/**
|
|
352
480
|
* The `QRL` type represents a lazy-loadable AND serializable resource.
|
|
353
481
|
*
|
|
@@ -736,6 +864,9 @@ export declare function trigger(root: Element, queryOrElement: string | Element
|
|
|
736
864
|
*/
|
|
737
865
|
declare type ValueOrPromise<T> = T | Promise<T>;
|
|
738
866
|
|
|
867
|
+
/** @internal */
|
|
868
|
+
declare const _VAR_PROPS: unique symbol;
|
|
869
|
+
|
|
739
870
|
/** @internal */
|
|
740
871
|
declare abstract class VNode implements BackRef {
|
|
741
872
|
flags: VNodeFlags;
|