@qwik.dev/core 2.0.0-beta.34 → 2.0.0-beta.35
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/dist/backpatch/package.json +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +26 -22
- package/dist/core-internal.d.ts +67 -1
- package/dist/core.min.mjs +9 -2
- package/dist/core.mjs +578 -230
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +3054 -2906
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.d.ts +2 -2
- package/dist/optimizer.mjs +2411 -1589
- package/dist/preloader.mjs +1 -268
- package/dist/server-modules.d.ts +1 -0
- package/dist/server.mjs +88 -139
- package/dist/server.prod.mjs +262 -310
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.mjs +427 -266
- package/dist/testing/package.json +1 -1
- package/dist/worker/index.d.mts +21 -0
- package/dist/worker/index.mjs +318 -0
- package/dist/worker/package.json +9 -0
- package/dist/worker/worker.js +13 -0
- package/dist/worker/worker.node.js +15 -0
- package/dist/worker/worker.shared.js +63 -0
- package/handlers.mjs +18 -1
- package/package.json +10 -4
- package/public.d.ts +5 -0
- package/worker.d.ts +2 -0
package/dist/build/package.json
CHANGED
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/cli 2.0.0-beta.
|
|
3
|
+
* @qwik.dev/core/cli 2.0.0-beta.35-dev+4603135
|
|
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
|
|
@@ -11964,6 +11964,25 @@ async function runBuildCommand(app) {
|
|
|
11964
11964
|
}
|
|
11965
11965
|
console.log(``);
|
|
11966
11966
|
let typecheck = null;
|
|
11967
|
+
const buildTypesCmd = buildTypes ? buildTypes.includes("--pretty") ? buildTypes : (
|
|
11968
|
+
// ensures colors flow throw when we console log the stdout
|
|
11969
|
+
`${buildTypes} --pretty`
|
|
11970
|
+
) : null;
|
|
11971
|
+
const runTypecheck = () => execaCommand(buildTypesCmd, {
|
|
11972
|
+
stdout: "inherit",
|
|
11973
|
+
stderr: "inherit",
|
|
11974
|
+
cwd: app.rootDir
|
|
11975
|
+
}).then(() => ({
|
|
11976
|
+
title: "Type checked"
|
|
11977
|
+
})).catch((e2) => {
|
|
11978
|
+
let out = e2.stdout || "";
|
|
11979
|
+
if (out.startsWith("tsc")) {
|
|
11980
|
+
out = out.slice(3);
|
|
11981
|
+
}
|
|
11982
|
+
console.log("\n" + out);
|
|
11983
|
+
process.exitCode = 1;
|
|
11984
|
+
throw new Error(`Type check failed: ${out}`);
|
|
11985
|
+
});
|
|
11967
11986
|
for (let i2 = 0; i2 < prebuildScripts.length; i2++) {
|
|
11968
11987
|
const script = prebuildScripts[i2];
|
|
11969
11988
|
try {
|
|
@@ -11981,26 +12000,8 @@ async function runBuildCommand(app) {
|
|
|
11981
12000
|
throw e2;
|
|
11982
12001
|
}
|
|
11983
12002
|
}
|
|
11984
|
-
if (
|
|
11985
|
-
|
|
11986
|
-
if (!copyScript.includes("--pretty")) {
|
|
11987
|
-
copyScript += " --pretty";
|
|
11988
|
-
}
|
|
11989
|
-
typecheck = execaCommand(copyScript, {
|
|
11990
|
-
stdout: "inherit",
|
|
11991
|
-
stderr: "inherit",
|
|
11992
|
-
cwd: app.rootDir
|
|
11993
|
-
}).then(() => ({
|
|
11994
|
-
title: "Type checked"
|
|
11995
|
-
})).catch((e2) => {
|
|
11996
|
-
let out = e2.stdout || "";
|
|
11997
|
-
if (out.startsWith("tsc")) {
|
|
11998
|
-
out = out.slice(3);
|
|
11999
|
-
}
|
|
12000
|
-
console.log("\n" + out);
|
|
12001
|
-
process.exitCode = 1;
|
|
12002
|
-
throw new Error(`Type check failed: ${out}`);
|
|
12003
|
-
});
|
|
12003
|
+
if (buildTypesCmd && !buildLibScript) {
|
|
12004
|
+
typecheck = runTypecheck();
|
|
12004
12005
|
}
|
|
12005
12006
|
if (buildClientScript) {
|
|
12006
12007
|
const script = attachArg(buildClientScript, "mode", mode);
|
|
@@ -12040,6 +12041,9 @@ async function runBuildCommand(app) {
|
|
|
12040
12041
|
throw e2;
|
|
12041
12042
|
});
|
|
12042
12043
|
step2.push(libBuild);
|
|
12044
|
+
if (buildTypesCmd) {
|
|
12045
|
+
step2.push(libBuild.then(() => runTypecheck()));
|
|
12046
|
+
}
|
|
12043
12047
|
}
|
|
12044
12048
|
if (buildPreviewScript) {
|
|
12045
12049
|
const script = attachArg(buildPreviewScript, "mode", mode);
|
|
@@ -12953,7 +12957,7 @@ async function printHelp(app) {
|
|
|
12953
12957
|
await runCommand2(Object.assign(app, { task: args[0], args }));
|
|
12954
12958
|
}
|
|
12955
12959
|
function printVersion() {
|
|
12956
|
-
console.log("2.0.0-beta.
|
|
12960
|
+
console.log("2.0.0-beta.35-dev+4603135");
|
|
12957
12961
|
}
|
|
12958
12962
|
export {
|
|
12959
12963
|
runCli,
|
package/dist/core-internal.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { AsyncLocalStorage } from 'node:async_hooks';
|
|
1
2
|
import type * as CSS_2 from 'csstype';
|
|
2
3
|
import { isBrowser } from './build';
|
|
3
4
|
import { isDev } from './build';
|
|
4
5
|
import { isServer } from './build';
|
|
5
6
|
import { ResolvedManifest } from './optimizer';
|
|
7
|
+
import type { ServerQwikManifest } from './optimizer';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* Qwik Optimizer marker function.
|
|
@@ -904,6 +906,7 @@ export declare interface _Container {
|
|
|
904
906
|
readonly $locale$: string;
|
|
905
907
|
readonly $getObjectById$: (id: number | string) => any;
|
|
906
908
|
readonly $serverData$: Record<string, any>;
|
|
909
|
+
readonly $instanceHash$: string | null;
|
|
907
910
|
$currentUniqueId$: number;
|
|
908
911
|
$buildBase$: string | null;
|
|
909
912
|
$renderPromise$: Promise<void> | null;
|
|
@@ -1162,6 +1165,9 @@ export declare const createComputedQrl: <T>(qrl: QRL<() => T>, options?: Compute
|
|
|
1162
1165
|
*/
|
|
1163
1166
|
export declare const createContextId: <STATE = unknown>(name: string) => ContextId<STATE>;
|
|
1164
1167
|
|
|
1168
|
+
/** @internal */
|
|
1169
|
+
export declare function _createDeserializeContainer(stateData: unknown[]): DeserializeContainer;
|
|
1170
|
+
|
|
1165
1171
|
/**
|
|
1166
1172
|
* Creates a QRL instance to represent a lazily loaded value. Normally this is a function, but it
|
|
1167
1173
|
* can be any value.
|
|
@@ -1470,6 +1476,17 @@ export declare type FunctionComponent<P = unknown> = {
|
|
|
1470
1476
|
renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput;
|
|
1471
1477
|
}['renderFn'];
|
|
1472
1478
|
|
|
1479
|
+
/** @internal */
|
|
1480
|
+
export declare const _getAsyncLocalStorage: () => (new <T>() => AsyncLocalStorage<T>) | undefined;
|
|
1481
|
+
|
|
1482
|
+
/**
|
|
1483
|
+
* Returns the client build manifest, which includes the mappings from symbols to bundles, the
|
|
1484
|
+
* bundlegraph etc.
|
|
1485
|
+
*
|
|
1486
|
+
* @public
|
|
1487
|
+
*/
|
|
1488
|
+
export declare const getClientManifest: () => ServerQwikManifest | undefined;
|
|
1489
|
+
|
|
1473
1490
|
/** Used by the optimizer for spread props operations @internal */
|
|
1474
1491
|
export declare const _getConstProps: (props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
|
|
1475
1492
|
|
|
@@ -2565,6 +2582,12 @@ export declare function _qrlToString(serializationContext: SerializationContext,
|
|
|
2565
2582
|
/** @internal */
|
|
2566
2583
|
export declare function _qrlToString(serializationContext: SerializationContext, qrl: _QRLInternal | SyncQRLInternal, raw: true): [string, string, string | null];
|
|
2567
2584
|
|
|
2585
|
+
/** @internal */
|
|
2586
|
+
export declare const _qrlWithChunk: <T = any>(chunk: string, importer: () => Promise<any>, symbol: string, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
|
|
2587
|
+
|
|
2588
|
+
/** @internal */
|
|
2589
|
+
export declare const _qrlWithChunkDEV: <T = any>(chunk: string, importer: () => Promise<any>, symbol: string, opts: QRLDev, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
|
|
2590
|
+
|
|
2568
2591
|
/** @public @deprecated Use `AnimationEvent` and use the second argument to the handler function for the current event target */
|
|
2569
2592
|
export declare type QwikAnimationEvent<T = Element> = NativeAnimationEvent;
|
|
2570
2593
|
|
|
@@ -2757,6 +2780,12 @@ export declare interface ReadonlySignal<T = unknown> {
|
|
|
2757
2780
|
readonly value: T;
|
|
2758
2781
|
}
|
|
2759
2782
|
|
|
2783
|
+
/** @internal */
|
|
2784
|
+
export declare const _reC: (props: RevealProps) => JSXNodeInternal<FunctionComponent< {
|
|
2785
|
+
name?: string;
|
|
2786
|
+
children?: JSXChildren;
|
|
2787
|
+
}>>;
|
|
2788
|
+
|
|
2760
2789
|
/**
|
|
2761
2790
|
* A ref can be either a signal or a function. Note that the type of Signal is Element so that it
|
|
2762
2791
|
* can accept more specialized elements too
|
|
@@ -2838,6 +2867,9 @@ export declare interface RenderSSROptions {
|
|
|
2838
2867
|
manifestHash: string;
|
|
2839
2868
|
}
|
|
2840
2869
|
|
|
2870
|
+
/** @internal */
|
|
2871
|
+
export declare const _reR: () => boolean;
|
|
2872
|
+
|
|
2841
2873
|
/**
|
|
2842
2874
|
* Resumes selected state (e.g. polling AsyncSignals) by deserializing captures. Used for
|
|
2843
2875
|
* document:onQIdle to resume async signals with active polling.
|
|
@@ -2943,6 +2975,21 @@ declare interface ResourceReturnInternal<T> {
|
|
|
2943
2975
|
/** @internal */
|
|
2944
2976
|
export declare const _restProps: (props: PropsProxy, omit?: string[], target?: Props) => Props;
|
|
2945
2977
|
|
|
2978
|
+
/** @internal */
|
|
2979
|
+
export declare const _reT: ({ cleanup }: TaskCtx) => void;
|
|
2980
|
+
|
|
2981
|
+
/** @public @experimental */
|
|
2982
|
+
export declare const Reveal: typeof _reC;
|
|
2983
|
+
|
|
2984
|
+
/** @public @experimental */
|
|
2985
|
+
export declare type RevealOrder = 'parallel' | 'sequential' | 'reverse' | 'together';
|
|
2986
|
+
|
|
2987
|
+
/** @public @experimental */
|
|
2988
|
+
export declare type RevealProps = {
|
|
2989
|
+
order?: RevealOrder;
|
|
2990
|
+
collapsed?: boolean;
|
|
2991
|
+
};
|
|
2992
|
+
|
|
2946
2993
|
/**
|
|
2947
2994
|
* The resource function wrapper
|
|
2948
2995
|
*
|
|
@@ -3626,6 +3673,25 @@ export declare class _SubscriptionData {
|
|
|
3626
3673
|
constructor(data: NodePropData);
|
|
3627
3674
|
}
|
|
3628
3675
|
|
|
3676
|
+
/** @internal */
|
|
3677
|
+
export declare const _suC: (props: SuspenseProps) => JSXNodeInternal<FunctionComponent< {
|
|
3678
|
+
children?: any;
|
|
3679
|
+
key?: string | number | null;
|
|
3680
|
+
}>>;
|
|
3681
|
+
|
|
3682
|
+
/** @public @experimental */
|
|
3683
|
+
export declare const Suspense: typeof _suC;
|
|
3684
|
+
|
|
3685
|
+
/** @public @experimental */
|
|
3686
|
+
export declare type SuspenseProps = {
|
|
3687
|
+
fallback?: JSXOutput;
|
|
3688
|
+
showStale?: boolean;
|
|
3689
|
+
delay?: number;
|
|
3690
|
+
};
|
|
3691
|
+
|
|
3692
|
+
/** @internal */
|
|
3693
|
+
export declare const _suT: ({ track, cleanup }: TaskCtx) => void;
|
|
3694
|
+
|
|
3629
3695
|
/**
|
|
3630
3696
|
* The TS types don't include the SVG attributes so we have to define them ourselves
|
|
3631
3697
|
*
|
|
@@ -4776,7 +4842,7 @@ export declare const _VAR_PROPS: unique symbol;
|
|
|
4776
4842
|
export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
|
|
4777
4843
|
|
|
4778
4844
|
/**
|
|
4779
|
-
* 2.0.0-beta.
|
|
4845
|
+
* 2.0.0-beta.35-dev+4603135
|
|
4780
4846
|
*
|
|
4781
4847
|
* @public
|
|
4782
4848
|
*/
|