@qwik.dev/core 2.0.0-beta.31 → 2.0.0-beta.34
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/index.mjs +2 -2
- package/dist/backpatch/package.json +1 -1
- package/dist/backpatch-executor.debug.js +12 -6
- package/dist/backpatch-executor.js +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/core-internal.d.ts +182 -38
- package/dist/core.min.mjs +2 -2
- package/dist/core.mjs +790 -438
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +3405 -3161
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.mjs +727 -722
- package/dist/preloader.mjs +64 -89
- package/dist/qwikloader.debug.js +237 -90
- package/dist/qwikloader.js +1 -1
- package/dist/server.d.ts +0 -54
- package/dist/server.mjs +119 -491
- package/dist/server.prod.mjs +625 -1033
- package/dist/starters/adapters/bun/src/entry.bun.ts +2 -8
- package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +2 -4
- package/dist/starters/adapters/deno/src/entry.deno.ts +2 -8
- package/dist/starters/adapters/express/src/entry.express.tsx +1 -4
- package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +1 -2
- package/dist/starters/adapters/node-server/src/entry.node-server.tsx +2 -4
- package/dist/testing/index.d.ts +7 -4
- package/dist/testing/index.mjs +1452 -3772
- package/dist/testing/package.json +1 -1
- package/package.json +3 -3
package/dist/backpatch/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const QWIK_BACKPATCH_EXECUTOR_MINIFIED = "const t='script[type=\"qwik/backpatch\"]'
|
|
2
|
-
const QWIK_BACKPATCH_EXECUTOR_DEBUG = "const BACKPATCH_DATA_SELECTOR = 'script[type=\"qwik/backpatch\"]';\
|
|
1
|
+
const QWIK_BACKPATCH_EXECUTOR_MINIFIED = "const t='script[type=\"qwik/backpatch\"]';function e(e,n){const o=n||e.querySelector(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");if(o){const n=o.querySelector(t);if(n){const t=JSON.parse(n.textContent||\"[]\"),r=e.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);let c=r.currentNode,i=c.hasAttribute(\":\")?0:-1;for(let e=0;e<t.length;e+=3){const n=t[e],o=t[e+1];let s=t[e+2];for(;i<n&&(c=r.nextNode(),c);)c.hasAttribute(\":\")&&i++;const a=c;null==s||!1===s?a.removeAttribute(o):(\"boolean\"==typeof s&&(s=\"\"),a.setAttribute(o,s))}}}}const n=document.currentScript;if(n){const t=n.closest(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");t&&e(document,t)}";
|
|
2
|
+
const QWIK_BACKPATCH_EXECUTOR_DEBUG = "const BACKPATCH_DATA_SELECTOR = 'script[type=\"qwik/backpatch\"]';\nfunction executeBackpatch(doc, containerElement) {\n const container = containerElement || doc.querySelector(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\");\n if (container) {\n const script = container.querySelector(BACKPATCH_DATA_SELECTOR);\n if (script) {\n const data = JSON.parse(script.textContent || \"[]\");\n const walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);\n let currentNode = walker.currentNode;\n let currentNodeIdx = currentNode.hasAttribute(\":\") ? 0 : -1;\n for (let i = 0; i < data.length; i += 3) {\n const elementIdx = data[i];\n const attrName = data[i + 1];\n let value = data[i + 2];\n while (currentNodeIdx < elementIdx) {\n currentNode = walker.nextNode();\n if (!currentNode) {\n break;\n }\n if (currentNode.hasAttribute(\":\")) {\n currentNodeIdx++;\n }\n }\n const element = currentNode;\n if (value == null || value === false) {\n element.removeAttribute(attrName);\n } else {\n if (typeof value === \"boolean\") {\n value = \"\";\n }\n element.setAttribute(attrName, value);\n }\n }\n }\n }\n}\nconst executorScript = document.currentScript;\nif (executorScript) {\n const container = executorScript.closest(\n \"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\"\n );\n if (container) {\n executeBackpatch(document, container);\n }\n}";
|
|
3
3
|
globalThis.QWIK_BACKPATCH_EXECUTOR_MINIFIED = QWIK_BACKPATCH_EXECUTOR_MINIFIED;
|
|
4
4
|
globalThis.QWIK_BACKPATCH_EXECUTOR_DEBUG = QWIK_BACKPATCH_EXECUTOR_DEBUG;
|
|
5
5
|
export { QWIK_BACKPATCH_EXECUTOR_MINIFIED, QWIK_BACKPATCH_EXECUTOR_DEBUG };
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
const BACKPATCH_DATA_SELECTOR = 'script[type="qwik/backpatch"]';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const container = executorScript.closest(
|
|
5
|
-
"[q\\:container]:not([q\\:container=html]):not([q\\:container=text])"
|
|
6
|
-
);
|
|
2
|
+
function executeBackpatch(doc, containerElement) {
|
|
3
|
+
const container = containerElement || doc.querySelector("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");
|
|
7
4
|
if (container) {
|
|
8
5
|
const script = container.querySelector(BACKPATCH_DATA_SELECTOR);
|
|
9
6
|
if (script) {
|
|
10
7
|
const data = JSON.parse(script.textContent || "[]");
|
|
11
|
-
const walker =
|
|
8
|
+
const walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);
|
|
12
9
|
let currentNode = walker.currentNode;
|
|
13
10
|
let currentNodeIdx = currentNode.hasAttribute(":") ? 0 : -1;
|
|
14
11
|
for (let i = 0; i < data.length; i += 3) {
|
|
@@ -37,3 +34,12 @@ if (executorScript) {
|
|
|
37
34
|
}
|
|
38
35
|
}
|
|
39
36
|
}
|
|
37
|
+
const executorScript = document.currentScript;
|
|
38
|
+
if (executorScript) {
|
|
39
|
+
const container = executorScript.closest(
|
|
40
|
+
"[q\\:container]:not([q\\:container=html]):not([q\\:container=text])"
|
|
41
|
+
);
|
|
42
|
+
if (container) {
|
|
43
|
+
executeBackpatch(document, container);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t='script[type="qwik/backpatch"]'
|
|
1
|
+
const t='script[type="qwik/backpatch"]';function e(e,n){const o=n||e.querySelector("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");if(o){const n=o.querySelector(t);if(n){const t=JSON.parse(n.textContent||"[]"),r=e.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);let c=r.currentNode,i=c.hasAttribute(":")?0:-1;for(let e=0;e<t.length;e+=3){const n=t[e],o=t[e+1];let s=t[e+2];for(;i<n&&(c=r.nextNode(),c);)c.hasAttribute(":")&&i++;const a=c;null==s||!1===s?a.removeAttribute(o):("boolean"==typeof s&&(s=""),a.setAttribute(o,s))}}}}const n=document.currentScript;if(n){const t=n.closest("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])");t&&e(document,t)}
|
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.34-dev+8b055bb
|
|
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
|
|
@@ -12953,7 +12953,7 @@ async function printHelp(app) {
|
|
|
12953
12953
|
await runCommand2(Object.assign(app, { task: args[0], args }));
|
|
12954
12954
|
}
|
|
12955
12955
|
function printVersion() {
|
|
12956
|
-
console.log("2.0.0-beta.
|
|
12956
|
+
console.log("2.0.0-beta.34-dev+8b055bb");
|
|
12957
12957
|
}
|
|
12958
12958
|
export {
|
|
12959
12959
|
runCli,
|
package/dist/core-internal.d.ts
CHANGED
|
@@ -381,7 +381,7 @@ declare type AsyncCtx<T = unknown> = {
|
|
|
381
381
|
/** The result of the previous computation, if any */
|
|
382
382
|
readonly previous: T | undefined;
|
|
383
383
|
/** Extra info passed to `invalidate(info)` for this computation, if any. */
|
|
384
|
-
readonly info
|
|
384
|
+
readonly info?: unknown;
|
|
385
385
|
};
|
|
386
386
|
|
|
387
387
|
/**
|
|
@@ -396,16 +396,16 @@ export declare type AsyncFn<T> = (ctx: AsyncCtx) => ValueOrPromise<T>;
|
|
|
396
396
|
/** Retains job metadata and also serves as the argument for the compute function */
|
|
397
397
|
declare class AsyncJob<T> implements AsyncCtx<T> {
|
|
398
398
|
readonly $signal$: AsyncSignalImpl<T>;
|
|
399
|
-
readonly info: unknown;
|
|
400
|
-
readonly $infoVersion$: number;
|
|
401
399
|
/** First holds the compute promise and then the cleanup promise */
|
|
402
|
-
$promise$: Promise<void> | null;
|
|
400
|
+
$promise$: Promise<void> | null | void;
|
|
403
401
|
$cleanupRequested$: boolean;
|
|
404
402
|
$canWrite$: boolean;
|
|
405
403
|
$track$: AsyncCtx<T>['track'] | undefined;
|
|
406
404
|
$cleanups$: Parameters<AsyncCtx<T>['cleanup']>[0][] | undefined;
|
|
407
405
|
$abortController$: AbortController | undefined;
|
|
408
|
-
|
|
406
|
+
info: unknown;
|
|
407
|
+
$infoVersion$: number | undefined;
|
|
408
|
+
constructor($signal$: AsyncSignalImpl<T>, info: unknown, $infoVersion$: number | undefined);
|
|
409
409
|
get track(): AsyncCtx<T>['track'];
|
|
410
410
|
get abortSignal(): AbortSignal;
|
|
411
411
|
/** Backward compatible cache method for resource */
|
|
@@ -451,18 +451,40 @@ export declare interface AsyncSignal<T = unknown> extends ComputedSignal<T> {
|
|
|
451
451
|
* ```
|
|
452
452
|
*/
|
|
453
453
|
loading: boolean;
|
|
454
|
+
/**
|
|
455
|
+
* Lets you read the loading state without subscribing to `.loading` updates. It also triggers
|
|
456
|
+
* lazy loading of the signal.
|
|
457
|
+
*
|
|
458
|
+
* Setting it will trigger listeners for `.loading`.
|
|
459
|
+
*/
|
|
460
|
+
untrackedLoading: boolean;
|
|
454
461
|
/**
|
|
455
462
|
* The error that occurred while computing the signal, if any. This will be cleared when the
|
|
456
|
-
* signal is successfully computed.
|
|
463
|
+
* signal is successfully computed. It does not trigger lazy loading of the signal.
|
|
457
464
|
*/
|
|
458
465
|
error: Error | undefined;
|
|
459
466
|
/**
|
|
460
|
-
*
|
|
467
|
+
* Lets you read the error state without subscribing to `.error` updates. It does not trigger lazy
|
|
468
|
+
* loading of the signal.
|
|
461
469
|
*
|
|
462
|
-
*
|
|
463
|
-
* - **Negative**: Stale-only — mark stale after `|interval|` ms, no auto-recompute.
|
|
464
|
-
* - **`0`**: No staleness tracking or polling.
|
|
470
|
+
* Setting it will trigger listeners for `.error`.
|
|
465
471
|
*/
|
|
472
|
+
untrackedError: Error | undefined;
|
|
473
|
+
/**
|
|
474
|
+
* Expiration time in ms. Writable and immediately effective.
|
|
475
|
+
*
|
|
476
|
+
* When set, the signal is invalidated after this many ms. Whether it auto-recomputes depends on
|
|
477
|
+
* the `poll` property. `0` means no expiration.
|
|
478
|
+
*/
|
|
479
|
+
expires: number;
|
|
480
|
+
/**
|
|
481
|
+
* Whether to automatically re-run the function when the value expires. Writable and immediately
|
|
482
|
+
* effective. Only relevant when `expires` is set.
|
|
483
|
+
*
|
|
484
|
+
* Defaults to `true`.
|
|
485
|
+
*/
|
|
486
|
+
poll: boolean;
|
|
487
|
+
/** @deprecated Use `expires` and `poll` instead. Will be removed before v2 */
|
|
466
488
|
interval: number;
|
|
467
489
|
/** A promise that resolves when the value is computed or rejected. */
|
|
468
490
|
promise(): Promise<void>;
|
|
@@ -477,7 +499,9 @@ export declare interface AsyncSignal<T = unknown> extends ComputedSignal<T> {
|
|
|
477
499
|
|
|
478
500
|
declare const enum AsyncSignalFlags {
|
|
479
501
|
EAGER_CLEANUP = 32,
|
|
480
|
-
CLIENT_ONLY = 64
|
|
502
|
+
CLIENT_ONLY = 64,
|
|
503
|
+
CLEAR_ON_INVALIDATE = 128,
|
|
504
|
+
NO_POLL = 256
|
|
481
505
|
}
|
|
482
506
|
|
|
483
507
|
/**
|
|
@@ -486,21 +510,23 @@ declare const enum AsyncSignalFlags {
|
|
|
486
510
|
* AsyncSignalImpl
|
|
487
511
|
*
|
|
488
512
|
* # ================================
|
|
513
|
+
*
|
|
514
|
+
* @internal
|
|
489
515
|
*/
|
|
490
516
|
declare class AsyncSignalImpl<T> extends ComputedSignalImpl<T, AsyncQRL<T>> implements BackRef, AsyncSignal<T> {
|
|
491
517
|
$untrackedLoading$: boolean;
|
|
492
518
|
$untrackedError$: Error | undefined;
|
|
493
|
-
$loadingEffects$: undefined | Set<EffectSubscription>;
|
|
494
|
-
$errorEffects$: undefined | Set<EffectSubscription>;
|
|
495
519
|
$current$: AsyncJob<T> | null;
|
|
496
|
-
$jobs$: AsyncJob<T>[];
|
|
497
|
-
$concurrency$: number;
|
|
498
|
-
$
|
|
520
|
+
$jobs$: AsyncJob<T>[] | undefined;
|
|
521
|
+
$concurrency$: number | undefined;
|
|
522
|
+
$expires$: number | undefined;
|
|
499
523
|
$timeoutMs$: number | undefined;
|
|
500
|
-
$
|
|
501
|
-
$
|
|
524
|
+
$loadingEffects$: undefined | Set<EffectSubscription>;
|
|
525
|
+
$errorEffects$: undefined | Set<EffectSubscription>;
|
|
502
526
|
$pollTimeoutId$: ReturnType<typeof setTimeout> | undefined;
|
|
503
527
|
$computationTimeoutId$: ReturnType<typeof setTimeout> | undefined;
|
|
528
|
+
$info$: unknown | undefined;
|
|
529
|
+
$infoVersion$: number | undefined;
|
|
504
530
|
[_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | undefined;
|
|
505
531
|
constructor(container: _Container | null, fn: AsyncQRL<T>, flags?: SignalFlags | SerializationSignalFlags, options?: AsyncSignalOptions<T>);
|
|
506
532
|
get untrackedValue(): T;
|
|
@@ -532,10 +558,16 @@ declare class AsyncSignalImpl<T> extends ComputedSignalImpl<T, AsyncQRL<T>> impl
|
|
|
532
558
|
get error(): Error | undefined;
|
|
533
559
|
set untrackedError(value: Error | undefined);
|
|
534
560
|
get untrackedError(): Error | undefined;
|
|
561
|
+
get expires(): number;
|
|
562
|
+
set expires(value: number);
|
|
563
|
+
get poll(): boolean;
|
|
564
|
+
set poll(value: boolean);
|
|
565
|
+
/** @deprecated Use `expires` and `poll` instead. */
|
|
535
566
|
get interval(): number;
|
|
536
567
|
set interval(value: number);
|
|
537
568
|
/** Invalidates the signal, causing it to re-compute its value. */
|
|
538
569
|
invalidate(info?: unknown): Promise<void>;
|
|
570
|
+
$setInvalid$(allowRecalc: boolean, mustClear: boolean | number): void;
|
|
539
571
|
/** Abort the current computation and run cleanups if needed. */
|
|
540
572
|
abort(reason?: any): void;
|
|
541
573
|
/** Schedule eager cleanup on next macro task if no subscribers remain. */
|
|
@@ -545,14 +577,19 @@ declare class AsyncSignalImpl<T> extends ComputedSignalImpl<T, AsyncQRL<T>> impl
|
|
|
545
577
|
/** Run the computation if needed */
|
|
546
578
|
$computeIfNeeded$(): void;
|
|
547
579
|
$runComputation$(running: AsyncJob<T>): Promise<void>;
|
|
580
|
+
/**
|
|
581
|
+
* Sets the error from the given job. We only accept errors from the current job and we ignore
|
|
582
|
+
* AbortErrors.
|
|
583
|
+
*/
|
|
584
|
+
$setError$(job: AsyncJob<T>, error: Error): void;
|
|
548
585
|
/** Called after SSR/unmount */
|
|
549
586
|
$destroy$(): Promise<void>;
|
|
550
587
|
private $clearNextPoll$;
|
|
551
588
|
private $scheduleNextPoll$;
|
|
552
589
|
private $hasSubscribers$;
|
|
553
|
-
$requestCleanups$(job: AsyncJob<T>, reason?: any):
|
|
590
|
+
$requestCleanups$(job: AsyncJob<T>, reason?: any): void;
|
|
554
591
|
/** Clean up and trigger signal compute once complete */
|
|
555
|
-
$runCleanups$(job: AsyncJob<T>): Promise<void
|
|
592
|
+
$runCleanups$(job: AsyncJob<T>): Promise<void> | undefined;
|
|
556
593
|
}
|
|
557
594
|
|
|
558
595
|
/** @public */
|
|
@@ -573,21 +610,23 @@ export declare interface AsyncSignalOptions<T> extends ComputedOptions {
|
|
|
573
610
|
*/
|
|
574
611
|
eagerCleanup?: boolean;
|
|
575
612
|
/**
|
|
576
|
-
*
|
|
613
|
+
* Time in milliseconds after which the value expires.
|
|
577
614
|
*
|
|
578
|
-
*
|
|
615
|
+
* When the value expires and subscribers exist, the signal is invalidated. If `poll` is `true`
|
|
616
|
+
* (default), the function is re-run automatically. If `poll` is `false`, the value is marked
|
|
617
|
+
* stale and recomputation happens when reading `.value` or `.loading`.
|
|
579
618
|
*
|
|
580
|
-
*
|
|
619
|
+
* `0` (default) means no expiration.
|
|
581
620
|
*/
|
|
582
|
-
|
|
621
|
+
expires?: number;
|
|
583
622
|
/**
|
|
584
|
-
*
|
|
623
|
+
* Whether to automatically re-run the function when the value expires. Only relevant when
|
|
624
|
+
* `expires` is set.
|
|
585
625
|
*
|
|
586
|
-
*
|
|
587
|
-
* - **Negative**: Mark the value as stale after `|interval|` ms, but do NOT auto-recompute.
|
|
588
|
-
* Consumers can check staleness and manually trigger recomputation.
|
|
589
|
-
* - **`0`** (default): No staleness tracking or polling.
|
|
626
|
+
* Defaults to `true`.
|
|
590
627
|
*/
|
|
628
|
+
poll?: boolean;
|
|
629
|
+
/** @deprecated Use `expires` and `poll` instead. Will be removed before v2 */
|
|
591
630
|
interval?: number;
|
|
592
631
|
/**
|
|
593
632
|
* When true, the async computation is postponed to the browser. On SSR, the signal remains
|
|
@@ -596,6 +635,23 @@ export declare interface AsyncSignalOptions<T> extends ComputedOptions {
|
|
|
596
635
|
* Defaults to `false`.
|
|
597
636
|
*/
|
|
598
637
|
clientOnly?: boolean;
|
|
638
|
+
/**
|
|
639
|
+
* When true (default), the previous value is kept while the signal re-computes after
|
|
640
|
+
* invalidation, so reads return stale data instead of throwing a promise. Reactivity will then
|
|
641
|
+
* update the readers when the new value is ready.
|
|
642
|
+
*
|
|
643
|
+
* When false, invalidation clears the value so reads throw the computation promise (like the
|
|
644
|
+
* initial load), which is useful for navigations where showing old data would be confusing.
|
|
645
|
+
*
|
|
646
|
+
* Note that polling invalidations (`expires` with `poll: true`) are not affected by this option
|
|
647
|
+
* and will keep the old value while the new value is loading, to avoid flashing loaders.
|
|
648
|
+
*
|
|
649
|
+
* This option only affects manual invalidations via `invalidate()`, and non-polling expirations
|
|
650
|
+
* (`poll: false`, or there are no subscribers).
|
|
651
|
+
*
|
|
652
|
+
* Defaults to `true`.
|
|
653
|
+
*/
|
|
654
|
+
allowStale?: boolean;
|
|
599
655
|
/**
|
|
600
656
|
* Maximum time in milliseconds to wait for the async computation to complete. If exceeded, the
|
|
601
657
|
* computation is aborted and an error is thrown.
|
|
@@ -633,6 +689,10 @@ declare type BivariantQrlFn<ARGS extends any[], RETURN> = {
|
|
|
633
689
|
/** @public */
|
|
634
690
|
declare type Booleanish = boolean | `${boolean}`;
|
|
635
691
|
|
|
692
|
+
declare type Capture = {
|
|
693
|
+
[K in keyof HTMLElementEventMap as `capture:${K}`]?: boolean;
|
|
694
|
+
};
|
|
695
|
+
|
|
636
696
|
/**
|
|
637
697
|
* The current captured scope during QRL invocation. This is used to provide the lexical scope for
|
|
638
698
|
* QRL functions. It is used one time per invocation, synchronously, so it is safe to store it in
|
|
@@ -1155,6 +1215,11 @@ export declare interface CSSProperties extends CSS_2.Properties<string | number>
|
|
|
1155
1215
|
[v: `--${string}`]: string | number | undefined;
|
|
1156
1216
|
}
|
|
1157
1217
|
|
|
1218
|
+
declare class DeleteOperation {
|
|
1219
|
+
target: Element | Text;
|
|
1220
|
+
constructor(target: Element | Text);
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1158
1223
|
declare interface DescriptorBase<T = unknown, B = unknown> extends BackRef {
|
|
1159
1224
|
$flags$: number;
|
|
1160
1225
|
$index$: number;
|
|
@@ -1194,7 +1259,7 @@ export declare interface DOMAttributes<EL extends Element> extends DOMAttributes
|
|
|
1194
1259
|
class?: ClassList | Signal<ClassList> | undefined;
|
|
1195
1260
|
}
|
|
1196
1261
|
|
|
1197
|
-
declare interface DOMAttributesBase<EL extends Element> extends QwikIntrinsicAttributes, PreventDefault, StopPropagation, RefAttr<EL> {
|
|
1262
|
+
declare interface DOMAttributesBase<EL extends Element> extends QwikIntrinsicAttributes, PreventDefault, StopPropagation, Capture, Passive, RefAttr<EL> {
|
|
1198
1263
|
dangerouslySetInnerHTML?: string | undefined;
|
|
1199
1264
|
}
|
|
1200
1265
|
|
|
@@ -1607,6 +1672,13 @@ export declare const inlinedQrl: <T>(symbol: T | null, symbolName: string, lexic
|
|
|
1607
1672
|
/** @internal */
|
|
1608
1673
|
export declare const inlinedQrlDEV: <T = any>(symbol: T, symbolName: string, opts: QRLDev, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
|
|
1609
1674
|
|
|
1675
|
+
declare class InsertOrMoveOperation {
|
|
1676
|
+
target: Element | Text;
|
|
1677
|
+
parent: Element;
|
|
1678
|
+
beforeTarget: Element | Text | null;
|
|
1679
|
+
constructor(target: Element | Text, parent: Element, beforeTarget: Element | Text | null);
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1610
1682
|
/**
|
|
1611
1683
|
* These are the HTML tags with handlers allowing plain callbacks, to be used for the JSX interface
|
|
1612
1684
|
*
|
|
@@ -1701,9 +1773,10 @@ export declare const _isTask: (value: any) => value is Task;
|
|
|
1701
1773
|
|
|
1702
1774
|
/** @internal */
|
|
1703
1775
|
declare interface IStreamHandler {
|
|
1704
|
-
flush(): void
|
|
1776
|
+
flush(): ValueOrPromise<void>;
|
|
1777
|
+
waitForPendingFlush(): ValueOrPromise<void>;
|
|
1705
1778
|
streamBlockStart(): void;
|
|
1706
|
-
streamBlockEnd(): void
|
|
1779
|
+
streamBlockEnd(): ValueOrPromise<void>;
|
|
1707
1780
|
}
|
|
1708
1781
|
|
|
1709
1782
|
/**
|
|
@@ -2103,6 +2176,10 @@ declare type PascalCaseName<T extends string> = T extends keyof LcEventNameMap ?
|
|
|
2103
2176
|
*/
|
|
2104
2177
|
declare type PascalCaseNames = 'AnimationEnd' | 'AnimationIteration' | 'AnimationStart' | 'AuxClick' | 'BeforeToggle' | 'CanPlay' | 'CanPlayThrough' | 'CompositionEnd' | 'CompositionStart' | 'CompositionUpdate' | 'ContextMenu' | 'DblClick' | 'DragEnd' | 'DragEnter' | 'DragExit' | 'DragLeave' | 'DragOver' | 'DragStart' | 'DurationChange' | 'FocusIn' | 'FocusOut' | 'FullscreenChange' | 'FullscreenError' | 'GotPointerCapture' | 'KeyDown' | 'KeyPress' | 'KeyUp' | 'LoadedData' | 'LoadedMetadata' | 'LoadEnd' | 'LoadStart' | 'LostPointerCapture' | 'MouseDown' | 'MouseEnter' | 'MouseLeave' | 'MouseMove' | 'MouseOut' | 'MouseOver' | 'MouseUp' | 'PointerCancel' | 'PointerDown' | 'PointerEnter' | 'PointerLeave' | 'PointerMove' | 'PointerOut' | 'PointerOver' | 'PointerUp' | 'QIdle' | 'QInit' | 'QResume' | 'QSymbol' | 'QVisible' | 'QViewTransition' | 'RateChange' | 'RateChange' | 'SecurityPolicyViolation' | 'SelectionChange' | 'SelectStart' | 'TimeUpdate' | 'TouchCancel' | 'TouchEnd' | 'TouchMove' | 'TouchStart' | 'TransitionCancel' | 'TransitionEnd' | 'TransitionRun' | 'TransitionStart' | 'VisibilityChange' | 'VolumeChange';
|
|
2105
2178
|
|
|
2179
|
+
declare type Passive = {
|
|
2180
|
+
[K in keyof HTMLElementEventMap as `passive:${K}`]?: boolean;
|
|
2181
|
+
};
|
|
2182
|
+
|
|
2106
2183
|
declare type PopoverTargetAction = 'hide' | 'show' | 'toggle';
|
|
2107
2184
|
|
|
2108
2185
|
declare type PossibleEvents = Event | SimplifiedServerRequestEvent | typeof TaskEvent | typeof RenderEvent;
|
|
@@ -2672,7 +2749,10 @@ export declare type QwikWheelEvent<T = Element> = NativeWheelEvent;
|
|
|
2672
2749
|
|
|
2673
2750
|
declare type QwikWindowEventMap = Omit<WindowEventHandlersEventMap, keyof QwikDocumentEventMap> & QwikDocumentEventMap;
|
|
2674
2751
|
|
|
2675
|
-
/**
|
|
2752
|
+
/**
|
|
2753
|
+
* @deprecated Use `Readonly<Signal<T>>` instead.
|
|
2754
|
+
* @public
|
|
2755
|
+
*/
|
|
2676
2756
|
export declare interface ReadonlySignal<T = unknown> {
|
|
2677
2757
|
readonly value: T;
|
|
2678
2758
|
}
|
|
@@ -2701,6 +2781,11 @@ declare type RefFnInterface<EL> = {
|
|
|
2701
2781
|
*/
|
|
2702
2782
|
export declare const _regSymbol: (symbol: any, hash: string) => any;
|
|
2703
2783
|
|
|
2784
|
+
declare class RemoveAllChildrenOperation {
|
|
2785
|
+
target: Element;
|
|
2786
|
+
constructor(target: Element);
|
|
2787
|
+
}
|
|
2788
|
+
|
|
2704
2789
|
/**
|
|
2705
2790
|
* Remove an external projection from its parent and clean up.
|
|
2706
2791
|
*
|
|
@@ -3036,6 +3121,15 @@ declare class SerializerSignalImpl<T, S> extends ComputedSignalImpl<T> {
|
|
|
3036
3121
|
*/
|
|
3037
3122
|
export declare const SerializerSymbol: unique symbol;
|
|
3038
3123
|
|
|
3124
|
+
declare class SetAttributeOperation {
|
|
3125
|
+
target: Element;
|
|
3126
|
+
attrName: string;
|
|
3127
|
+
attrValue: any;
|
|
3128
|
+
scopedStyleIdPrefix: string | null;
|
|
3129
|
+
isSvg: boolean;
|
|
3130
|
+
constructor(target: Element, attrName: string, attrValue: any, scopedStyleIdPrefix: string | null, isSvg: boolean);
|
|
3131
|
+
}
|
|
3132
|
+
|
|
3039
3133
|
/** @internal */
|
|
3040
3134
|
export declare function _setEvent(serializationCtx: SerializationContext, key: string, rawValue: unknown, hasMovedCaptures: boolean): string | null;
|
|
3041
3135
|
|
|
@@ -3061,6 +3155,12 @@ export declare const setPlatform: (plt: CorePlatform) => CorePlatform;
|
|
|
3061
3155
|
*/
|
|
3062
3156
|
export declare function _setProjectionTarget(vnode: _VirtualVNode, targetElement: Element): void;
|
|
3063
3157
|
|
|
3158
|
+
declare class SetTextOperation {
|
|
3159
|
+
target: Text;
|
|
3160
|
+
text: string;
|
|
3161
|
+
constructor(target: Text, text: string);
|
|
3162
|
+
}
|
|
3163
|
+
|
|
3064
3164
|
/** @internal */
|
|
3065
3165
|
export declare abstract class _SharedContainer implements _Container {
|
|
3066
3166
|
readonly $version$: string;
|
|
@@ -3512,7 +3612,8 @@ declare type StoreTarget = Record<string | symbol, any>;
|
|
|
3512
3612
|
|
|
3513
3613
|
/** @internal */
|
|
3514
3614
|
export declare interface StreamWriter {
|
|
3515
|
-
write(chunk: string): void
|
|
3615
|
+
write(chunk: string): ValueOrPromise<void>;
|
|
3616
|
+
waitForDrain?(): ValueOrPromise<void>;
|
|
3516
3617
|
}
|
|
3517
3618
|
|
|
3518
3619
|
/** @file Shared types */
|
|
@@ -4205,7 +4306,7 @@ export declare const useLexicalScope: <VARS extends any[]>() => VARS;
|
|
|
4205
4306
|
* @public
|
|
4206
4307
|
* @see `useOn`, `useOnWindow`, `useOnDocument`.
|
|
4207
4308
|
*/
|
|
4208
|
-
export declare const useOn: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T
|
|
4309
|
+
export declare const useOn: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>, options?: UseOnOptions) => void;
|
|
4209
4310
|
|
|
4210
4311
|
/**
|
|
4211
4312
|
* Register a listener on `document`.
|
|
@@ -4234,7 +4335,21 @@ export declare const useOn: <T extends KnownEventNames>(event: T | T[], eventQrl
|
|
|
4234
4335
|
* });
|
|
4235
4336
|
* ```
|
|
4236
4337
|
*/
|
|
4237
|
-
export declare const useOnDocument: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T
|
|
4338
|
+
export declare const useOnDocument: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>, options?: UseOnOptions) => void;
|
|
4339
|
+
|
|
4340
|
+
/** @public */
|
|
4341
|
+
export declare type UseOnOptions = UseOnOptionsBase & ({
|
|
4342
|
+
passive?: boolean;
|
|
4343
|
+
preventdefault?: never;
|
|
4344
|
+
} | {
|
|
4345
|
+
passive?: never;
|
|
4346
|
+
preventdefault?: boolean;
|
|
4347
|
+
});
|
|
4348
|
+
|
|
4349
|
+
declare interface UseOnOptionsBase {
|
|
4350
|
+
capture?: boolean;
|
|
4351
|
+
stoppropagation?: boolean;
|
|
4352
|
+
}
|
|
4238
4353
|
|
|
4239
4354
|
/**
|
|
4240
4355
|
* Register a listener on `window`.
|
|
@@ -4264,7 +4379,7 @@ export declare const useOnDocument: <T extends KnownEventNames>(event: T | T[],
|
|
|
4264
4379
|
* });
|
|
4265
4380
|
* ```
|
|
4266
4381
|
*/
|
|
4267
|
-
export declare const useOnWindow: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T
|
|
4382
|
+
export declare const useOnWindow: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>, options?: UseOnOptions) => void;
|
|
4268
4383
|
|
|
4269
4384
|
/**
|
|
4270
4385
|
* This method works like an async memoized function that runs whenever some tracked value changes
|
|
@@ -4661,7 +4776,7 @@ export declare const _VAR_PROPS: unique symbol;
|
|
|
4661
4776
|
export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
|
|
4662
4777
|
|
|
4663
4778
|
/**
|
|
4664
|
-
* 2.0.0-beta.
|
|
4779
|
+
* 2.0.0-beta.34-dev+8b055bb
|
|
4665
4780
|
*
|
|
4666
4781
|
* @public
|
|
4667
4782
|
*/
|
|
@@ -4700,9 +4815,24 @@ export declare const _vnode_ensureElementInflated: (container: _Container, vnode
|
|
|
4700
4815
|
/** @internal */
|
|
4701
4816
|
export declare const _vnode_getAttrKeys: (container: _Container, vnode: _ElementVNode | _VirtualVNode) => string[];
|
|
4702
4817
|
|
|
4818
|
+
/** @internal */
|
|
4819
|
+
export declare const _vnode_getElementName: (vnode: _ElementVNode) => string;
|
|
4820
|
+
|
|
4703
4821
|
/** @internal */
|
|
4704
4822
|
export declare const _vnode_getFirstChild: (vnode: _VNode) => _VNode | null;
|
|
4705
4823
|
|
|
4824
|
+
/** @internal */
|
|
4825
|
+
export declare const _vnode_getProp: <T = unknown>(vNode: _VNode, key: string, getObject: ((id: string) => unknown) | null) => T | null;
|
|
4826
|
+
|
|
4827
|
+
/** @internal */
|
|
4828
|
+
export declare const _vnode_getVNodeForChildNode: (vNode: _ElementVNode, childElement: Element) => _ElementVNode;
|
|
4829
|
+
|
|
4830
|
+
/** @internal */
|
|
4831
|
+
export declare const _vnode_insertBefore: (journal: _VNodeJournal, parent: _ElementVNode | _VirtualVNode, newChild: _VNode, insertBefore: _VNode | null) => void;
|
|
4832
|
+
|
|
4833
|
+
/** @internal */
|
|
4834
|
+
export declare const _vnode_isElementVNode: (vNode: _VNode) => vNode is _ElementVNode;
|
|
4835
|
+
|
|
4706
4836
|
/** @internal */
|
|
4707
4837
|
export declare const _vnode_isMaterialized: (vNode: _VNode) => boolean;
|
|
4708
4838
|
|
|
@@ -4712,6 +4842,15 @@ export declare const _vnode_isTextVNode: (vNode: _VNode) => vNode is _TextVNode;
|
|
|
4712
4842
|
/** @internal */
|
|
4713
4843
|
export declare const _vnode_isVirtualVNode: (vNode: _VNode) => vNode is _VirtualVNode;
|
|
4714
4844
|
|
|
4845
|
+
/** @internal */
|
|
4846
|
+
export declare const _vnode_newVirtual: () => _VirtualVNode;
|
|
4847
|
+
|
|
4848
|
+
/** @internal */
|
|
4849
|
+
export declare const _vnode_remove: (journal: _VNodeJournal, vParent: _ElementVNode | _VirtualVNode, vToRemove: _VNode, removeDOM: boolean) => void;
|
|
4850
|
+
|
|
4851
|
+
/** @internal */
|
|
4852
|
+
export declare const _vnode_setProp: (vNode: _VNode, key: string, value: unknown) => void;
|
|
4853
|
+
|
|
4715
4854
|
/** @internal */
|
|
4716
4855
|
export declare function _vnode_toString(this: _VNode | null, depth?: number, offset?: string, materialize?: boolean, siblings?: boolean, colorize?: boolean, container?: _Container | null): string;
|
|
4717
4856
|
|
|
@@ -4799,6 +4938,11 @@ export declare const enum _VNodeFlags {
|
|
|
4799
4938
|
HasTargetElement = 2048
|
|
4800
4939
|
}
|
|
4801
4940
|
|
|
4941
|
+
/** @internal */
|
|
4942
|
+
export declare type _VNodeJournal = Array<VNodeOperation>;
|
|
4943
|
+
|
|
4944
|
+
declare type VNodeOperation = DeleteOperation | RemoveAllChildrenOperation | SetTextOperation | InsertOrMoveOperation | SetAttributeOperation;
|
|
4945
|
+
|
|
4802
4946
|
/** @internal */
|
|
4803
4947
|
export declare const _waitUntilRendered: (container: _Container) => Promise<void>;
|
|
4804
4948
|
|