@qwik.dev/core 2.0.0-beta.16 → 2.0.0-beta.17
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 +2 -2
- package/dist/core-internal.d.ts +61 -123
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +5941 -6110
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +3273 -3305
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.mjs +1 -1
- package/dist/server.mjs +447 -414
- package/dist/testing/index.d.ts +27 -263
- package/dist/testing/index.mjs +4807 -4966
- package/dist/testing/package.json +1 -1
- package/package.json +3 -3
package/dist/testing/index.d.ts
CHANGED
|
@@ -18,19 +18,9 @@ declare interface AddRootFn {
|
|
|
18
18
|
|
|
19
19
|
declare type AllSignalFlags = SignalFlags | WrappedSignalFlags | SerializationSignalFlags;
|
|
20
20
|
|
|
21
|
-
declare type AsyncComputedCtx = {
|
|
22
|
-
track: Tracker;
|
|
23
|
-
cleanup: (callback: () => void) => void;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/** @public */
|
|
27
|
-
declare type AsyncComputedFn<T> = (ctx: AsyncComputedCtx) => Promise<T>;
|
|
28
|
-
|
|
29
|
-
declare type AsyncComputeQRL<T> = QRLInternal<AsyncComputedFn<T>>;
|
|
30
|
-
|
|
31
21
|
/** Class for back reference to the EffectSubscription */
|
|
32
22
|
declare abstract class BackRef {
|
|
33
|
-
[_EFFECT_BACK_REF]: Map<
|
|
23
|
+
[_EFFECT_BACK_REF]: Map<any, any> | undefined;
|
|
34
24
|
}
|
|
35
25
|
|
|
36
26
|
declare type BivariantQrlFn<ARGS extends any[], RETURN> = {
|
|
@@ -43,58 +33,18 @@ declare type BivariantQrlFn<ARGS extends any[], RETURN> = {
|
|
|
43
33
|
bivarianceHack(...args: ARGS): Promise<RETURN>;
|
|
44
34
|
}['bivarianceHack'];
|
|
45
35
|
|
|
46
|
-
declare
|
|
47
|
-
$type$: T;
|
|
48
|
-
$idx$: number | string;
|
|
49
|
-
$host$: HostElement;
|
|
50
|
-
$target$: ChoreTarget | null;
|
|
51
|
-
$payload$: unknown;
|
|
52
|
-
$state$: ChoreState;
|
|
53
|
-
$blockedChores$: ChoreArray | null;
|
|
54
|
-
$startTime$: number | undefined;
|
|
55
|
-
$endTime$: number | undefined;
|
|
56
|
-
$resolve$: ((value: any) => void) | undefined;
|
|
57
|
-
$reject$: ((reason?: any) => void) | undefined;
|
|
58
|
-
$returnValue$: ValueOrPromise<ChoreReturnValue<T>>;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
declare class ChoreArray extends Array<Chore> {
|
|
62
|
-
add(value: Chore): number;
|
|
63
|
-
delete(value: Chore): number;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
declare type ChoreReturnValue<T extends ChoreType = ChoreType> = T extends ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS | ChoreType.WAIT_FOR_QUEUE | ChoreType.NODE_PROP ? void : T extends ChoreType.NODE_DIFF | ChoreType.COMPONENT ? JSXOutput_2 : unknown;
|
|
67
|
-
|
|
68
|
-
declare enum ChoreState {
|
|
36
|
+
declare const enum ChoreBits {
|
|
69
37
|
NONE = 0,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
38
|
+
TASKS = 1,
|
|
39
|
+
NODE_DIFF = 2,
|
|
40
|
+
COMPONENT = 4,
|
|
41
|
+
NODE_PROPS = 8,
|
|
42
|
+
COMPUTE = 16,
|
|
43
|
+
CHILDREN = 32,
|
|
44
|
+
CLEANUP = 64,
|
|
45
|
+
DIRTY_MASK = 127
|
|
73
46
|
}
|
|
74
47
|
|
|
75
|
-
declare type ChoreTarget = HostElement | QRLInternal<(...args: unknown[]) => unknown> | Signal | StoreTarget;
|
|
76
|
-
|
|
77
|
-
declare const enum ChoreType {
|
|
78
|
-
MACRO = 240,
|
|
79
|
-
MICRO = 15,
|
|
80
|
-
/** Ensure that the QRL promise is resolved before processing next chores in the queue */
|
|
81
|
-
QRL_RESOLVE = 1,
|
|
82
|
-
RUN_QRL = 2,
|
|
83
|
-
TASK = 3,
|
|
84
|
-
NODE_DIFF = 4,
|
|
85
|
-
NODE_PROP = 5,
|
|
86
|
-
COMPONENT = 6,
|
|
87
|
-
RECOMPUTE_AND_SCHEDULE_EFFECTS = 7,
|
|
88
|
-
VISIBLE = 16,
|
|
89
|
-
CLEANUP_VISIBLE = 32,
|
|
90
|
-
WAIT_FOR_QUEUE = 255
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/** @public */
|
|
94
|
-
declare type ComputedFn<T> = () => T;
|
|
95
|
-
|
|
96
|
-
declare type ComputeQRL<T> = QRLInternal<ComputedFn<T>>;
|
|
97
|
-
|
|
98
48
|
/**
|
|
99
49
|
* Effect is something which needs to happen (side-effect) due to signal value change.
|
|
100
50
|
*
|
|
@@ -104,17 +54,19 @@ declare type ComputeQRL<T> = QRLInternal<ComputedFn<T>>;
|
|
|
104
54
|
* - `VNode` and `ISsrNode`: Either a component or `<Signal>`
|
|
105
55
|
* - `Signal2`: A derived signal which contains a computation function.
|
|
106
56
|
*/
|
|
107
|
-
declare type Consumer = Task | VNode |
|
|
57
|
+
declare type Consumer = Task | VNode | SignalImpl | ISsrNode;
|
|
108
58
|
|
|
109
59
|
declare interface Container {
|
|
110
60
|
readonly $version$: string;
|
|
111
|
-
readonly $scheduler$: Scheduler;
|
|
112
61
|
readonly $storeProxyMap$: ObjToProxyMap;
|
|
113
62
|
readonly $locale$: string;
|
|
114
63
|
readonly $getObjectById$: (id: number | string) => any;
|
|
115
64
|
readonly $serverData$: Record<string, any>;
|
|
116
65
|
$currentUniqueId$: number;
|
|
117
66
|
$buildBase$: string | null;
|
|
67
|
+
$renderPromise$: Promise<void> | null;
|
|
68
|
+
$resolveRenderPromise$: (() => void) | null;
|
|
69
|
+
$cursorCount$: number;
|
|
118
70
|
handleError(err: any, $host$: HostElement | null): void;
|
|
119
71
|
getParentHost(host: HostElement): HostElement | null;
|
|
120
72
|
setContext<T>(host: HostElement, context: ContextId<T>, value: T): void;
|
|
@@ -219,18 +171,6 @@ export declare const createDOM: ({ html }?: {
|
|
|
219
171
|
userEvent: (queryOrElement: string | Element | keyof HTMLElementTagNameMap | null, eventNameCamel: string | keyof WindowEventMap, eventPayload?: any) => Promise<void>;
|
|
220
172
|
}>;
|
|
221
173
|
|
|
222
|
-
declare const createScheduler: (container: Container, journalFlush: () => void, choreQueue: ChoreArray, blockedChores: ChoreArray, runningChores: Set<Chore>) => {
|
|
223
|
-
(type: ChoreType.QRL_RESOLVE, ignore: null, target: ComputeQRL<any> | AsyncComputeQRL<any>): Chore<ChoreType.QRL_RESOLVE>;
|
|
224
|
-
(type: ChoreType.WAIT_FOR_QUEUE): Chore<ChoreType.WAIT_FOR_QUEUE>;
|
|
225
|
-
(type: ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS, host: HostElement | undefined, target: Signal<unknown> | StoreTarget, effects: Set<EffectSubscription> | undefined): Chore<ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS>;
|
|
226
|
-
(type: ChoreType.TASK | ChoreType.VISIBLE, task: Task): Chore<ChoreType.TASK | ChoreType.VISIBLE>;
|
|
227
|
-
(type: ChoreType.RUN_QRL, host: HostElement, target: QRLInternal<(...args: unknown[]) => unknown>, args: unknown[]): Chore<ChoreType.RUN_QRL>;
|
|
228
|
-
(type: ChoreType.COMPONENT, host: HostElement, qrl: QRLInternal<OnRenderFn<unknown>>, props: Props | null): Chore<ChoreType.COMPONENT>;
|
|
229
|
-
(type: ChoreType.NODE_DIFF, host: HostElement, target: HostElement, value: JSXOutput_2 | Signal): Chore<ChoreType.NODE_DIFF>;
|
|
230
|
-
(type: ChoreType.NODE_PROP, host: HostElement, prop: string, value: any): Chore<ChoreType.NODE_PROP>;
|
|
231
|
-
(type: ChoreType.CLEANUP_VISIBLE, task: Task): Chore<ChoreType.CLEANUP_VISIBLE>;
|
|
232
|
-
};
|
|
233
|
-
|
|
234
174
|
declare interface DescriptorBase<T = unknown, B = unknown> extends BackRef {
|
|
235
175
|
$flags$: number;
|
|
236
176
|
$index$: number;
|
|
@@ -240,14 +180,6 @@ declare interface DescriptorBase<T = unknown, B = unknown> extends BackRef {
|
|
|
240
180
|
$destroy$: NoSerialize<() => void> | null;
|
|
241
181
|
}
|
|
242
182
|
|
|
243
|
-
/** @public */
|
|
244
|
-
declare interface DevJSX {
|
|
245
|
-
fileName: string;
|
|
246
|
-
lineNumber: number;
|
|
247
|
-
columnNumber: number;
|
|
248
|
-
stack?: string;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
183
|
declare type DomRef = {
|
|
252
184
|
$ssrNode$: SsrNode;
|
|
253
185
|
};
|
|
@@ -345,32 +277,12 @@ declare interface ElementFixtureOptions {
|
|
|
345
277
|
html?: string;
|
|
346
278
|
}
|
|
347
279
|
|
|
348
|
-
/** @internal */
|
|
349
|
-
declare class ElementVNode extends VNode {
|
|
350
|
-
firstChild: VNode | null | undefined;
|
|
351
|
-
lastChild: VNode | null | undefined;
|
|
352
|
-
element: QElement;
|
|
353
|
-
elementName: string | undefined;
|
|
354
|
-
constructor(flags: VNodeFlags, parent: ElementVNode | VirtualVNode | null, previousSibling: VNode | null | undefined, nextSibling: VNode | null | undefined, firstChild: VNode | null | undefined, lastChild: VNode | null | undefined, element: QElement, elementName: string | undefined);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
280
|
/** @public */
|
|
358
281
|
export declare function emulateExecutionOfQwikFuncs(document: Document): void;
|
|
359
282
|
|
|
360
283
|
/** @public */
|
|
361
284
|
export declare function expectDOM(actual: Element, expected: string): Promise<void>;
|
|
362
285
|
|
|
363
|
-
/**
|
|
364
|
-
* Any function taking a props object that returns JSXOutput.
|
|
365
|
-
*
|
|
366
|
-
* The `key`, `flags` and `dev` parameters are for internal use.
|
|
367
|
-
*
|
|
368
|
-
* @public
|
|
369
|
-
*/
|
|
370
|
-
declare type FunctionComponent<P = unknown> = {
|
|
371
|
-
renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput_2;
|
|
372
|
-
}['renderFn'];
|
|
373
|
-
|
|
374
286
|
/** @public */
|
|
375
287
|
export declare function getTestPlatform(): TestPlatform;
|
|
376
288
|
|
|
@@ -381,8 +293,6 @@ declare interface InvokeContext {
|
|
|
381
293
|
$url$: URL | undefined;
|
|
382
294
|
/** The Virtual parent component for the current component code */
|
|
383
295
|
$hostElement$: HostElement | undefined;
|
|
384
|
-
/** The current DOM element */
|
|
385
|
-
$element$: Element | undefined;
|
|
386
296
|
/** The event we're currently handling */
|
|
387
297
|
$event$: PossibleEvents | undefined;
|
|
388
298
|
/** The QRL function we're currently executing */
|
|
@@ -397,6 +307,7 @@ declare type InvokeTuple = [Element, Event, URL?];
|
|
|
397
307
|
declare interface ISsrNode {
|
|
398
308
|
id: string;
|
|
399
309
|
flags: SsrNodeFlags;
|
|
310
|
+
dirty: ChoreBits;
|
|
400
311
|
parentComponent: ISsrNode | null;
|
|
401
312
|
vnodeData: VNodeData;
|
|
402
313
|
currentFile: string | null;
|
|
@@ -407,29 +318,6 @@ declare interface ISsrNode {
|
|
|
407
318
|
setTreeNonUpdatable(): void;
|
|
408
319
|
}
|
|
409
320
|
|
|
410
|
-
/** @public */
|
|
411
|
-
declare type JSXChildren = string | number | boolean | null | undefined | Function | RegExp | JSXChildren[] | Promise<JSXChildren> | Signal<JSXChildren> | JSXNode;
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* A JSX Node, an internal structure. You probably want to use `JSXOutput` instead.
|
|
415
|
-
*
|
|
416
|
-
* @public
|
|
417
|
-
*/
|
|
418
|
-
declare interface JSXNode<T extends string | FunctionComponent | unknown = unknown> {
|
|
419
|
-
type: T;
|
|
420
|
-
props: T extends FunctionComponent<infer P> ? P : Record<any, unknown>;
|
|
421
|
-
children: JSXChildren | null;
|
|
422
|
-
key: string | null;
|
|
423
|
-
dev?: DevJSX;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
* Any valid output for a component
|
|
428
|
-
*
|
|
429
|
-
* @public
|
|
430
|
-
*/
|
|
431
|
-
declare type JSXOutput_2 = JSXNode | string | number | boolean | null | undefined | JSXOutput_2[];
|
|
432
|
-
|
|
433
321
|
/** @public */
|
|
434
322
|
declare interface MockDocument extends Document {
|
|
435
323
|
}
|
|
@@ -466,18 +354,10 @@ declare type NoSerialize<T> = (T & {
|
|
|
466
354
|
|
|
467
355
|
declare type ObjToProxyMap = WeakMap<any, any>;
|
|
468
356
|
|
|
469
|
-
/** @public */
|
|
470
|
-
declare type OnRenderFn<PROPS> = (props: PROPS) => JSXOutput_2;
|
|
471
|
-
|
|
472
357
|
declare type PossibleEvents = Event | SimplifiedServerRequestEvent | typeof TaskEvent | typeof RenderEvent | typeof ResourceEvent;
|
|
473
358
|
|
|
474
359
|
declare type Props = Record<string, unknown>;
|
|
475
360
|
|
|
476
|
-
declare interface QElement extends Element {
|
|
477
|
-
qDispatchEvent?: (event: Event, scope: QwikLoaderEventScope) => ValueOrPromise<unknown>;
|
|
478
|
-
vNode?: VNode;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
361
|
/**
|
|
482
362
|
* The `QRL` type represents a lazy-loadable AND serializable resource.
|
|
483
363
|
*
|
|
@@ -643,8 +523,6 @@ declare type QRLInternalMethods<TYPE> = {
|
|
|
643
523
|
|
|
644
524
|
declare type QrlReturn<T> = T extends (...args: any) => infer R ? Awaited<R> : unknown;
|
|
645
525
|
|
|
646
|
-
declare type QwikLoaderEventScope = '-document' | '-window' | '';
|
|
647
|
-
|
|
648
526
|
/** @public */
|
|
649
527
|
declare interface ReadonlySignal<T = unknown> {
|
|
650
528
|
readonly value: T;
|
|
@@ -661,12 +539,11 @@ declare interface ResourceReturnInternal<T> {
|
|
|
661
539
|
_error: Error | undefined;
|
|
662
540
|
_cache: number;
|
|
663
541
|
_timeout: number;
|
|
542
|
+
_generation: number;
|
|
664
543
|
value: Promise<T>;
|
|
665
544
|
loading: boolean;
|
|
666
545
|
}
|
|
667
546
|
|
|
668
|
-
declare type Scheduler = ReturnType<typeof createScheduler>;
|
|
669
|
-
|
|
670
547
|
/** Stores the location of an object. If no parent, it's a root. */
|
|
671
548
|
declare type SeenRef = {
|
|
672
549
|
$index$: number;
|
|
@@ -857,91 +734,6 @@ declare interface TestPlatform extends CorePlatform {
|
|
|
857
734
|
flush: () => Promise<void>;
|
|
858
735
|
}
|
|
859
736
|
|
|
860
|
-
/**
|
|
861
|
-
* Used to signal to Qwik which state should be watched for changes.
|
|
862
|
-
*
|
|
863
|
-
* The `Tracker` is passed into the `taskFn` of `useTask`. It is intended to be used to wrap state
|
|
864
|
-
* objects in a read proxy which signals to Qwik which properties should be watched for changes. A
|
|
865
|
-
* change to any of the properties causes the `taskFn` to rerun.
|
|
866
|
-
*
|
|
867
|
-
* ### Example
|
|
868
|
-
*
|
|
869
|
-
* The `obs` passed into the `taskFn` is used to mark `state.count` as a property of interest. Any
|
|
870
|
-
* changes to the `state.count` property will cause the `taskFn` to rerun.
|
|
871
|
-
*
|
|
872
|
-
* ```tsx
|
|
873
|
-
* const Cmp = component$(() => {
|
|
874
|
-
* const store = useStore({ count: 0, doubleCount: 0 });
|
|
875
|
-
* const signal = useSignal(0);
|
|
876
|
-
* useTask$(({ track }) => {
|
|
877
|
-
* // Any signals or stores accessed inside the task will be tracked
|
|
878
|
-
* const count = track(() => store.count);
|
|
879
|
-
* // You can also pass a signal to track() directly
|
|
880
|
-
* const signalCount = track(signal);
|
|
881
|
-
* store.doubleCount = count + signalCount;
|
|
882
|
-
* });
|
|
883
|
-
* return (
|
|
884
|
-
* <div>
|
|
885
|
-
* <span>
|
|
886
|
-
* {store.count} / {store.doubleCount}
|
|
887
|
-
* </span>
|
|
888
|
-
* <button
|
|
889
|
-
* onClick$={() => {
|
|
890
|
-
* store.count++;
|
|
891
|
-
* signal.value++;
|
|
892
|
-
* }}
|
|
893
|
-
* >
|
|
894
|
-
* +
|
|
895
|
-
* </button>
|
|
896
|
-
* </div>
|
|
897
|
-
* );
|
|
898
|
-
* });
|
|
899
|
-
* ```
|
|
900
|
-
*
|
|
901
|
-
* @public
|
|
902
|
-
* @see `useTask`
|
|
903
|
-
*/
|
|
904
|
-
declare interface Tracker {
|
|
905
|
-
/**
|
|
906
|
-
* Include the expression using stores / signals to track:
|
|
907
|
-
*
|
|
908
|
-
* ```tsx
|
|
909
|
-
* track(() => store.count);
|
|
910
|
-
* ```
|
|
911
|
-
*
|
|
912
|
-
* The `track()` function also returns the value of the scoped expression:
|
|
913
|
-
*
|
|
914
|
-
* ```tsx
|
|
915
|
-
* const count = track(() => store.count);
|
|
916
|
-
* ```
|
|
917
|
-
*/
|
|
918
|
-
<T>(fn: () => T): T;
|
|
919
|
-
/**
|
|
920
|
-
* Used to track the whole object. If any property of the passed store changes, the task will be
|
|
921
|
-
* scheduled to run. Also accepts signals.
|
|
922
|
-
*
|
|
923
|
-
* Note that the change tracking is not deep. If you want to track changes to nested properties,
|
|
924
|
-
* you need to use `track` on each of them.
|
|
925
|
-
*
|
|
926
|
-
* ```tsx
|
|
927
|
-
* track(store); // returns store
|
|
928
|
-
* track(signal); // returns signal.value
|
|
929
|
-
* ```
|
|
930
|
-
*/
|
|
931
|
-
<T extends object>(obj: T): T extends Signal<infer U> ? U : T;
|
|
932
|
-
/**
|
|
933
|
-
* Used to track to track a specific property of an object.
|
|
934
|
-
*
|
|
935
|
-
* Note that the change tracking is not deep. If you want to track changes to nested properties,
|
|
936
|
-
* you need to use `track` on each of them.
|
|
937
|
-
*
|
|
938
|
-
* ```tsx
|
|
939
|
-
* track(store, 'propA'); // returns store.propA
|
|
940
|
-
* ```
|
|
941
|
-
*/
|
|
942
|
-
<T extends object, P extends keyof T>(obj: T, prop: P): T[P];
|
|
943
|
-
}
|
|
944
|
-
|
|
945
737
|
/**
|
|
946
738
|
* Trigger an event in unit tests on an element. Needs to be kept in sync with the Qwik Loader event
|
|
947
739
|
* dispatching.
|
|
@@ -961,28 +753,18 @@ export declare function trigger(root: Element, queryOrElement: string | Element
|
|
|
961
753
|
*/
|
|
962
754
|
declare type ValueOrPromise<T> = T | Promise<T>;
|
|
963
755
|
|
|
964
|
-
/** @internal */
|
|
965
|
-
declare class VirtualVNode extends VNode {
|
|
966
|
-
firstChild: VNode | null | undefined;
|
|
967
|
-
lastChild: VNode | null | undefined;
|
|
968
|
-
constructor(flags: VNodeFlags, parent: ElementVNode | VirtualVNode | null, previousSibling: VNode | null | undefined, nextSibling: VNode | null | undefined, firstChild: VNode | null | undefined, lastChild: VNode | null | undefined);
|
|
969
|
-
}
|
|
970
|
-
|
|
971
756
|
/** @internal */
|
|
972
757
|
declare abstract class VNode extends BackRef {
|
|
973
758
|
flags: VNodeFlags;
|
|
974
|
-
parent:
|
|
759
|
+
parent: VNode | null;
|
|
975
760
|
previousSibling: VNode | null | undefined;
|
|
976
761
|
nextSibling: VNode | null | undefined;
|
|
977
|
-
props:
|
|
762
|
+
props: Props | null;
|
|
978
763
|
slotParent: VNode | null;
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
setProp(key: string, value: any): void;
|
|
984
|
-
getAttr(key: string): string | null;
|
|
985
|
-
setAttr(key: string, value: string | null | boolean, journal: VNodeJournal | null): void;
|
|
764
|
+
dirty: ChoreBits;
|
|
765
|
+
dirtyChildren: VNode[] | null;
|
|
766
|
+
nextDirtyChildIndex: number;
|
|
767
|
+
constructor(flags: VNodeFlags, parent: VNode | null, previousSibling: VNode | null | undefined, nextSibling: VNode | null | undefined, props: Props | null);
|
|
986
768
|
toString(): string;
|
|
987
769
|
}
|
|
988
770
|
|
|
@@ -1067,30 +849,12 @@ declare const enum VNodeFlags {
|
|
|
1067
849
|
Inflated = 8,
|
|
1068
850
|
Resolved = 16,
|
|
1069
851
|
Deleted = 32,
|
|
1070
|
-
|
|
1071
|
-
|
|
852
|
+
Cursor = 64,
|
|
853
|
+
NAMESPACE_MASK = 384,
|
|
854
|
+
NEGATED_NAMESPACE_MASK = -385,
|
|
1072
855
|
NS_html = 0,// http://www.w3.org/1999/xhtml
|
|
1073
|
-
NS_svg =
|
|
1074
|
-
NS_math =
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
|
-
declare type VNodeJournal = Array<VNodeJournalOpCode | Document | Element | Text | string | boolean | null>;
|
|
1078
|
-
|
|
1079
|
-
/**
|
|
1080
|
-
* Fundamental DOM operations are:
|
|
1081
|
-
*
|
|
1082
|
-
* - Insert new DOM element/text
|
|
1083
|
-
* - Remove DOM element/text
|
|
1084
|
-
* - Set DOM element attributes
|
|
1085
|
-
* - Set text node value
|
|
1086
|
-
*/
|
|
1087
|
-
declare const enum VNodeJournalOpCode {
|
|
1088
|
-
SetText = 1,// ------ [SetAttribute, target, text]
|
|
1089
|
-
SetAttribute = 2,// - [SetAttribute, target, ...(key, values)]]
|
|
1090
|
-
HoistStyles = 3,// -- [HoistStyles, document]
|
|
1091
|
-
Remove = 4,// ------- [Remove, target(parent), ...nodes]
|
|
1092
|
-
RemoveAll = 5,// ------- [RemoveAll, target(parent)]
|
|
1093
|
-
Insert = 6
|
|
856
|
+
NS_svg = 128,// http://www.w3.org/2000/svg
|
|
857
|
+
NS_math = 256
|
|
1094
858
|
}
|
|
1095
859
|
|
|
1096
860
|
/**
|