solid-js 1.8.4 → 1.8.6

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/dev.cjs CHANGED
@@ -159,7 +159,8 @@ let Effects = null;
159
159
  let ExecCount = 0;
160
160
  const DevHooks = {
161
161
  afterUpdate: null,
162
- afterCreateOwner: null
162
+ afterCreateOwner: null,
163
+ afterCreateSignal: null
163
164
  };
164
165
  const [transPending, setTransPending] = /*@__PURE__*/createSignal(false);
165
166
  function createRoot(fn, detachedOwner) {
@@ -199,9 +200,10 @@ function createSignal(value, options) {
199
200
  observerSlots: null,
200
201
  comparator: options.equals || undefined
201
202
  };
202
- if (!options.internal) {
203
+ {
203
204
  if (options.name) s.name = options.name;
204
- registerGraph(s);
205
+ if (DevHooks.afterCreateSignal) DevHooks.afterCreateSignal(s);
206
+ if (!options.internal) registerGraph(s);
205
207
  }
206
208
  const setter = value => {
207
209
  if (typeof value === "function") {
@@ -352,11 +354,11 @@ function createResource(pSource, pFetcher, pOptions) {
352
354
  loadEnd(pr, p, undefined, lookup);
353
355
  return p;
354
356
  }
357
+ pr = p;
355
358
  if ("value" in p) {
356
359
  if (p.status === "success") loadEnd(pr, p.value, undefined, lookup);else loadEnd(pr, undefined, undefined, lookup);
357
360
  return p;
358
361
  }
359
- pr = p;
360
362
  scheduled = true;
361
363
  queueMicrotask(() => scheduled = false);
362
364
  runUpdates(() => {
@@ -676,10 +678,7 @@ function writeSignal(node, value, isComp) {
676
678
  function updateComputation(node) {
677
679
  if (!node.fn) return;
678
680
  cleanNode(node);
679
- const owner = Owner,
680
- listener = Listener,
681
- time = ExecCount;
682
- Listener = Owner = node;
681
+ const time = ExecCount;
683
682
  runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
684
683
  if (Transition && !Transition.running && Transition.sources.has(node)) {
685
684
  queueMicrotask(() => {
@@ -691,11 +690,12 @@ function updateComputation(node) {
691
690
  }, false);
692
691
  });
693
692
  }
694
- Listener = listener;
695
- Owner = owner;
696
693
  }
697
694
  function runComputation(node, value, time) {
698
695
  let nextValue;
696
+ const owner = Owner,
697
+ listener = Listener;
698
+ Listener = Owner = node;
699
699
  try {
700
700
  nextValue = node.fn(value);
701
701
  } catch (err) {
@@ -712,6 +712,9 @@ function runComputation(node, value, time) {
712
712
  }
713
713
  node.updatedAt = time + 1;
714
714
  return handleError(err);
715
+ } finally {
716
+ Listener = listener;
717
+ Owner = owner;
715
718
  }
716
719
  if (!node.updatedAt || node.updatedAt <= time) {
717
720
  if (node.updatedAt != null && "observers" in node) {
package/dist/dev.js CHANGED
@@ -159,7 +159,8 @@ let Effects = null;
159
159
  let ExecCount = 0;
160
160
  const DevHooks = {
161
161
  afterUpdate: null,
162
- afterCreateOwner: null
162
+ afterCreateOwner: null,
163
+ afterCreateSignal: null
163
164
  };
164
165
  const [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);
165
166
  function createRoot(fn, detachedOwner) {
@@ -204,9 +205,10 @@ function createSignal(value, options) {
204
205
  observerSlots: null,
205
206
  comparator: options.equals || undefined
206
207
  };
207
- if (!options.internal) {
208
+ {
208
209
  if (options.name) s.name = options.name;
209
- registerGraph(s);
210
+ if (DevHooks.afterCreateSignal) DevHooks.afterCreateSignal(s);
211
+ if (!options.internal) registerGraph(s);
210
212
  }
211
213
  const setter = value => {
212
214
  if (typeof value === "function") {
@@ -376,12 +378,12 @@ function createResource(pSource, pFetcher, pOptions) {
376
378
  loadEnd(pr, p, undefined, lookup);
377
379
  return p;
378
380
  }
381
+ pr = p;
379
382
  if ("value" in p) {
380
383
  if (p.status === "success") loadEnd(pr, p.value, undefined, lookup);
381
384
  else loadEnd(pr, undefined, undefined, lookup);
382
385
  return p;
383
386
  }
384
- pr = p;
385
387
  scheduled = true;
386
388
  queueMicrotask(() => (scheduled = false));
387
389
  runUpdates(() => {
@@ -753,10 +755,7 @@ function writeSignal(node, value, isComp) {
753
755
  function updateComputation(node) {
754
756
  if (!node.fn) return;
755
757
  cleanNode(node);
756
- const owner = Owner,
757
- listener = Listener,
758
- time = ExecCount;
759
- Listener = Owner = node;
758
+ const time = ExecCount;
760
759
  runComputation(
761
760
  node,
762
761
  Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
@@ -772,11 +771,12 @@ function updateComputation(node) {
772
771
  }, false);
773
772
  });
774
773
  }
775
- Listener = listener;
776
- Owner = owner;
777
774
  }
778
775
  function runComputation(node, value, time) {
779
776
  let nextValue;
777
+ const owner = Owner,
778
+ listener = Listener;
779
+ Listener = Owner = node;
780
780
  try {
781
781
  nextValue = node.fn(value);
782
782
  } catch (err) {
@@ -793,6 +793,9 @@ function runComputation(node, value, time) {
793
793
  }
794
794
  node.updatedAt = time + 1;
795
795
  return handleError(err);
796
+ } finally {
797
+ Listener = listener;
798
+ Owner = owner;
796
799
  }
797
800
  if (!node.updatedAt || node.updatedAt <= time) {
798
801
  if (node.updatedAt != null && "observers" in node) {
package/dist/solid.cjs CHANGED
@@ -336,11 +336,11 @@ function createResource(pSource, pFetcher, pOptions) {
336
336
  loadEnd(pr, p, undefined, lookup);
337
337
  return p;
338
338
  }
339
+ pr = p;
339
340
  if ("value" in p) {
340
341
  if (p.status === "success") loadEnd(pr, p.value, undefined, lookup);else loadEnd(pr, undefined, undefined, lookup);
341
342
  return p;
342
343
  }
343
- pr = p;
344
344
  scheduled = true;
345
345
  queueMicrotask(() => scheduled = false);
346
346
  runUpdates(() => {
@@ -638,10 +638,7 @@ function writeSignal(node, value, isComp) {
638
638
  function updateComputation(node) {
639
639
  if (!node.fn) return;
640
640
  cleanNode(node);
641
- const owner = Owner,
642
- listener = Listener,
643
- time = ExecCount;
644
- Listener = Owner = node;
641
+ const time = ExecCount;
645
642
  runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
646
643
  if (Transition && !Transition.running && Transition.sources.has(node)) {
647
644
  queueMicrotask(() => {
@@ -653,11 +650,12 @@ function updateComputation(node) {
653
650
  }, false);
654
651
  });
655
652
  }
656
- Listener = listener;
657
- Owner = owner;
658
653
  }
659
654
  function runComputation(node, value, time) {
660
655
  let nextValue;
656
+ const owner = Owner,
657
+ listener = Listener;
658
+ Listener = Owner = node;
661
659
  try {
662
660
  nextValue = node.fn(value);
663
661
  } catch (err) {
@@ -674,6 +672,9 @@ function runComputation(node, value, time) {
674
672
  }
675
673
  node.updatedAt = time + 1;
676
674
  return handleError(err);
675
+ } finally {
676
+ Listener = listener;
677
+ Owner = owner;
677
678
  }
678
679
  if (!node.updatedAt || node.updatedAt <= time) {
679
680
  if (node.updatedAt != null && "observers" in node) {
package/dist/solid.js CHANGED
@@ -356,12 +356,12 @@ function createResource(pSource, pFetcher, pOptions) {
356
356
  loadEnd(pr, p, undefined, lookup);
357
357
  return p;
358
358
  }
359
+ pr = p;
359
360
  if ("value" in p) {
360
361
  if (p.status === "success") loadEnd(pr, p.value, undefined, lookup);
361
362
  else loadEnd(pr, undefined, undefined, lookup);
362
363
  return p;
363
364
  }
364
- pr = p;
365
365
  scheduled = true;
366
366
  queueMicrotask(() => (scheduled = false));
367
367
  runUpdates(() => {
@@ -702,10 +702,7 @@ function writeSignal(node, value, isComp) {
702
702
  function updateComputation(node) {
703
703
  if (!node.fn) return;
704
704
  cleanNode(node);
705
- const owner = Owner,
706
- listener = Listener,
707
- time = ExecCount;
708
- Listener = Owner = node;
705
+ const time = ExecCount;
709
706
  runComputation(
710
707
  node,
711
708
  Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
@@ -721,11 +718,12 @@ function updateComputation(node) {
721
718
  }, false);
722
719
  });
723
720
  }
724
- Listener = listener;
725
- Owner = owner;
726
721
  }
727
722
  function runComputation(node, value, time) {
728
723
  let nextValue;
724
+ const owner = Owner,
725
+ listener = Listener;
726
+ Listener = Owner = node;
729
727
  try {
730
728
  nextValue = node.fn(value);
731
729
  } catch (err) {
@@ -742,6 +740,9 @@ function runComputation(node, value, time) {
742
740
  }
743
741
  node.updatedAt = time + 1;
744
742
  return handleError(err);
743
+ } finally {
744
+ Listener = listener;
745
+ Owner = owner;
745
746
  }
746
747
  if (!node.updatedAt || node.updatedAt <= time) {
747
748
  if (node.updatedAt != null && "observers" in node) {
@@ -51,6 +51,13 @@ export namespace JSX {
51
51
  1: any;
52
52
  }
53
53
  type EventHandlerUnion<T, E extends Event> = EventHandler<T, E> | BoundEventHandler<T, E>;
54
+
55
+ const SERIALIZABLE: unique symbol;
56
+ interface SerializableAttributeValue {
57
+ toString(): string;
58
+ [SERIALIZABLE]: never;
59
+ }
60
+
54
61
  interface IntrinsicAttributes {
55
62
  ref?: unknown | ((e: unknown) => void);
56
63
  }
@@ -718,7 +725,7 @@ export namespace JSX {
718
725
  autofocus?: FunctionMaybe<boolean>;
719
726
  disabled?: FunctionMaybe<boolean>;
720
727
  form?: FunctionMaybe<string>;
721
- formaction?: FunctionMaybe<string>;
728
+ formaction?: FunctionMaybe<string | SerializableAttributeValue>;
722
729
  formenctype?: FunctionMaybe<HTMLFormEncType>;
723
730
  formmethod?: FunctionMaybe<HTMLFormMethod>;
724
731
  formnovalidate?: FunctionMaybe<boolean>;
@@ -726,7 +733,7 @@ export namespace JSX {
726
733
  name?: FunctionMaybe<string>;
727
734
  type?: FunctionMaybe<"submit" | "reset" | "button">;
728
735
  value?: FunctionMaybe<string>;
729
- formAction?: FunctionMaybe<string>;
736
+ formAction?: FunctionMaybe<string | SerializableAttributeValue>;
730
737
  formEnctype?: FunctionMaybe<HTMLFormEncType>;
731
738
  formMethod?: FunctionMaybe<HTMLFormMethod>;
732
739
  formNoValidate?: FunctionMaybe<boolean>;
@@ -767,7 +774,7 @@ export namespace JSX {
767
774
  }
768
775
  interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
769
776
  "accept-charset"?: FunctionMaybe<string>;
770
- action?: FunctionMaybe<string>;
777
+ action?: FunctionMaybe<string | SerializableAttributeValue>;
771
778
  autocomplete?: FunctionMaybe<string>;
772
779
  encoding?: FunctionMaybe<HTMLFormEncType>;
773
780
  enctype?: FunctionMaybe<HTMLFormEncType>;
@@ -819,7 +826,7 @@ export namespace JSX {
819
826
  crossorigin?: FunctionMaybe<HTMLCrossorigin>;
820
827
  disabled?: FunctionMaybe<boolean>;
821
828
  form?: FunctionMaybe<string>;
822
- formaction?: FunctionMaybe<string>;
829
+ formaction?: FunctionMaybe<string | SerializableAttributeValue>;
823
830
  formenctype?: FunctionMaybe<HTMLFormEncType>;
824
831
  formmethod?: FunctionMaybe<HTMLFormMethod>;
825
832
  formnovalidate?: FunctionMaybe<boolean>;
@@ -843,7 +850,7 @@ export namespace JSX {
843
850
  value?: FunctionMaybe<string | string[] | number>;
844
851
  width?: FunctionMaybe<number | string>;
845
852
  crossOrigin?: FunctionMaybe<HTMLCrossorigin>;
846
- formAction?: FunctionMaybe<string>;
853
+ formAction?: FunctionMaybe<string | SerializableAttributeValue>;
847
854
  formEnctype?: FunctionMaybe<HTMLFormEncType>;
848
855
  formMethod?: FunctionMaybe<HTMLFormMethod>;
849
856
  formNoValidate?: FunctionMaybe<boolean>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "solid-js",
3
3
  "description": "A declarative JavaScript library for building user interfaces.",
4
- "version": "1.8.4",
4
+ "version": "1.8.6",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "homepage": "https://solidjs.com",
@@ -80,6 +80,7 @@
80
80
  "require": "./dist/solid.cjs"
81
81
  },
82
82
  "./dist/*": "./dist/*",
83
+ "./types/*": "./types/*",
83
84
  "./jsx-runtime": {
84
85
  "types": "./types/jsx.d.ts",
85
86
  "default": "./dist/solid.js"
@@ -124,6 +125,7 @@
124
125
  "require": "./store/dist/store.cjs"
125
126
  },
126
127
  "./store/dist/*": "./store/dist/*",
128
+ "./store/types/*": "./store/types/*",
127
129
  "./web": {
128
130
  "worker": {
129
131
  "types": "./web/types/index.d.ts",
@@ -164,6 +166,7 @@
164
166
  "require": "./web/dist/storage.cjs"
165
167
  },
166
168
  "./web/dist/*": "./web/dist/*",
169
+ "./web/types/*": "./web/types/*",
167
170
  "./universal": {
168
171
  "development": {
169
172
  "types": "./universal/types/index.d.ts",
@@ -175,6 +178,7 @@
175
178
  "require": "./universal/dist/universal.cjs"
176
179
  },
177
180
  "./universal/dist/*": "./universal/dist/*",
181
+ "./universal/types/*": "./universal/types/*",
178
182
  "./h": {
179
183
  "types": "./h/types/index.d.ts",
180
184
  "import": "./h/dist/h.js",
@@ -191,6 +195,7 @@
191
195
  "require": "./h/jsx-runtime/dist/jsx.cjs"
192
196
  },
193
197
  "./h/dist/*": "./h/dist/*",
198
+ "./h/types/*": "./h/types/*",
194
199
  "./html": {
195
200
  "types": "./html/types/index.d.ts",
196
201
  "import": "./html/dist/html.js",
@@ -210,7 +215,7 @@
210
215
  ],
211
216
  "dependencies": {
212
217
  "csstype": "^3.1.0",
213
- "seroval": "^0.12.0"
218
+ "seroval": "^0.14.1"
214
219
  },
215
220
  "scripts": {
216
221
  "build": "npm-run-all -nl build:*",
package/types/index.d.ts CHANGED
@@ -74,6 +74,9 @@ export declare const DEV:
74
74
  readonly hooks: {
75
75
  afterUpdate: (() => void) | null;
76
76
  afterCreateOwner: ((owner: import("./reactive/signal.js").Owner) => void) | null;
77
+ afterCreateSignal:
78
+ | ((signal: import("./reactive/signal.js").SignalState<any>) => void)
79
+ | null;
77
80
  };
78
81
  readonly writeSignal: typeof writeSignal;
79
82
  readonly registerGraph: typeof registerGraph;
package/types/jsx.d.ts CHANGED
@@ -118,6 +118,12 @@ export namespace JSX {
118
118
  | FocusEventHandler<T, E>
119
119
  | BoundFocusEventHandler<T, E>;
120
120
 
121
+ const SERIALIZABLE: unique symbol;
122
+ interface SerializableAttributeValue {
123
+ toString(): string;
124
+ [SERIALIZABLE]: never;
125
+ }
126
+
121
127
  interface IntrinsicAttributes {
122
128
  ref?: unknown | ((e: unknown) => void);
123
129
  }
@@ -791,7 +797,7 @@ export namespace JSX {
791
797
  autofocus?: boolean;
792
798
  disabled?: boolean;
793
799
  form?: string;
794
- formaction?: string;
800
+ formaction?: string | SerializableAttributeValue;
795
801
  formenctype?: HTMLFormEncType;
796
802
  formmethod?: HTMLFormMethod;
797
803
  formnovalidate?: boolean;
@@ -799,7 +805,7 @@ export namespace JSX {
799
805
  name?: string;
800
806
  type?: "submit" | "reset" | "button";
801
807
  value?: string;
802
- formAction?: string;
808
+ formAction?: string | SerializableAttributeValue;
803
809
  formEnctype?: HTMLFormEncType;
804
810
  formMethod?: HTMLFormMethod;
805
811
  formNoValidate?: boolean;
@@ -842,7 +848,7 @@ export namespace JSX {
842
848
  }
843
849
  interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
844
850
  "accept-charset"?: string;
845
- action?: string;
851
+ action?: string | SerializableAttributeValue;
846
852
  autocomplete?: string;
847
853
  encoding?: HTMLFormEncType;
848
854
  enctype?: HTMLFormEncType;
@@ -898,7 +904,7 @@ export namespace JSX {
898
904
  disabled?: boolean;
899
905
  enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send";
900
906
  form?: string;
901
- formaction?: string;
907
+ formaction?: string | SerializableAttributeValue;
902
908
  formenctype?: HTMLFormEncType;
903
909
  formmethod?: HTMLFormMethod;
904
910
  formnovalidate?: boolean;
@@ -924,7 +930,7 @@ export namespace JSX {
924
930
  value?: string | string[] | number;
925
931
  width?: number | string;
926
932
  crossOrigin?: HTMLCrossorigin;
927
- formAction?: string;
933
+ formAction?: string | SerializableAttributeValue;
928
934
  formEnctype?: HTMLFormEncType;
929
935
  formMethod?: HTMLFormMethod;
930
936
  formNoValidate?: boolean;
@@ -35,6 +35,7 @@ declare let ExternalSourceFactory: ExternalSourceFactory | null;
35
35
  export declare const DevHooks: {
36
36
  afterUpdate: (() => void) | null;
37
37
  afterCreateOwner: ((owner: Owner) => void) | null;
38
+ afterCreateSignal: ((signal: SignalState<any>) => void) | null;
38
39
  };
39
40
  export type ComputationState = 0 | 1 | 2;
40
41
  export interface SourceMapValue {
package/web/dist/dev.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  var solidJs = require('solid-js');
4
4
 
5
- const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
5
+ const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
6
6
  const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
7
7
  const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
8
8
  const Aliases = /*#__PURE__*/Object.assign(Object.create(null), {
package/web/dist/dev.js CHANGED
@@ -42,6 +42,7 @@ const booleans = [
42
42
  "formnovalidate",
43
43
  "hidden",
44
44
  "indeterminate",
45
+ "inert",
45
46
  "ismap",
46
47
  "loop",
47
48
  "multiple",
@@ -3,7 +3,7 @@
3
3
  var solidJs = require('solid-js');
4
4
  var seroval = require('seroval');
5
5
 
6
- const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
6
+ const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
7
7
  const BooleanAttributes = /*#__PURE__*/new Set(booleans);
8
8
  const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
9
9
  const Aliases = /*#__PURE__*/Object.assign(Object.create(null), {
@@ -30,9 +30,6 @@ function createSerializer({
30
30
  onError
31
31
  });
32
32
  }
33
- function getGlobalHeaderScript() {
34
- return seroval.GLOBAL_CONTEXT_API_SCRIPT;
35
- }
36
33
  function getLocalHeaderScript(id) {
37
34
  return seroval.getCrossReferenceHeader(id);
38
35
  }
@@ -63,6 +60,12 @@ function renderToString(code, options = {}) {
63
60
  nonce: options.nonce,
64
61
  serialize(id, p) {
65
62
  !solidJs.sharedConfig.context.noHydrate && serializer.write(id, p);
63
+ },
64
+ pushed: 0,
65
+ push(p) {
66
+ const id = this.renderId + "i-" + this.pushed++;
67
+ this.serialize(id, p);
68
+ return id;
66
69
  }
67
70
  };
68
71
  let html = solidJs.createRoot(d => {
@@ -185,13 +188,19 @@ function renderToStream(code, options = {}) {
185
188
  });
186
189
  } else if (!serverOnly) serializer.write(id, p);
187
190
  },
191
+ pushed: 0,
192
+ push(p) {
193
+ const id = this.renderId + "i-" + this.pushed++;
194
+ this.serialize(id, p);
195
+ return id;
196
+ },
188
197
  registerFragment(key) {
189
198
  if (!registry.has(key)) {
190
199
  let resolve, reject;
191
200
  const p = new Promise((r, rej) => (resolve = r, reject = rej));
192
201
  registry.set(key, {
193
- resolve,
194
- reject
202
+ resolve: v => queue(() => queue(() => resolve(v))),
203
+ reject: e => queue(() => queue(() => reject(e)))
195
204
  });
196
205
  serializer.write(key, p);
197
206
  }
@@ -208,7 +217,7 @@ function renderToStream(code, options = {}) {
208
217
  }
209
218
  if ((value !== undefined || error) && !completed) {
210
219
  if (!firstFlushed) {
211
- Promise.resolve().then(() => html = replacePlaceholder(html, key, value !== undefined ? value : ""));
220
+ queue(() => html = replacePlaceholder(html, key, value !== undefined ? value : ""));
212
221
  error ? reject(error) : resolve(true);
213
222
  } else {
214
223
  buffer.write(`<template id="${key}">${value !== undefined ? value : " "}</template>`);
@@ -218,7 +227,7 @@ function renderToStream(code, options = {}) {
218
227
  }
219
228
  }
220
229
  }
221
- if (!registry.size) Promise.resolve().then(flushEnd);
230
+ if (!registry.size) queue(flushEnd);
222
231
  return firstFlushed;
223
232
  };
224
233
  }
@@ -253,7 +262,7 @@ function renderToStream(code, options = {}) {
253
262
  complete();
254
263
  };
255
264
  } else onCompleteAll = complete;
256
- if (!registry.size) Promise.resolve().then(flushEnd);
265
+ if (!registry.size) queue(flushEnd);
257
266
  },
258
267
  pipe(w) {
259
268
  Promise.allSettled(blockingPromises).then(() => {
@@ -466,7 +475,7 @@ function generateHydrationScript({
466
475
  eventNames = ["click", "input"],
467
476
  nonce
468
477
  } = {}) {
469
- return `<script${nonce ? ` nonce="${nonce}"` : ""}>window._$HY||(e=>{let t=e=>e&&e.hasAttribute&&(e.hasAttribute("data-hk")?e:t(e.host&&e.host.nodeType?e.host:e.parentNode));["${eventNames.join('", "')}"].forEach((o=>document.addEventListener(o,(o=>{let a=o.composedPath&&o.composedPath()[0]||o.target,s=t(a);s&&!e.completed.has(s)&&e.events.push([s,o])}))))})(_$HY={events:[],completed:new WeakSet,r:{},fe(){}});${getGlobalHeaderScript()}</script><!--xs-->`;
478
+ return `<script${nonce ? ` nonce="${nonce}"` : ""}>window._$HY||(e=>{let t=e=>e&&e.hasAttribute&&(e.hasAttribute("data-hk")?e:t(e.host&&e.host.nodeType?e.host:e.parentNode));["${eventNames.join('", "')}"].forEach((o=>document.addEventListener(o,(o=>{let a=o.composedPath&&o.composedPath()[0]||o.target,s=t(a);s&&!e.completed.has(s)&&e.events.push([s,o])}))))})(_$HY={events:[],completed:new WeakSet,r:{},fe(){}});</script><!--xs-->`;
470
479
  }
471
480
  function Hydration(props) {
472
481
  if (!solidJs.sharedConfig.context.noHydrate) return props.children;
@@ -485,6 +494,9 @@ function NoHydration(props) {
485
494
  solidJs.sharedConfig.context.noHydrate = true;
486
495
  return props.children;
487
496
  }
497
+ function queue(fn) {
498
+ return Promise.resolve().then(fn);
499
+ }
488
500
  function injectAssets(assets, html) {
489
501
  if (!assets || !assets.length) return html;
490
502
  let out = "";
@@ -11,7 +11,7 @@ export {
11
11
  createComponent,
12
12
  mergeProps
13
13
  } from "solid-js";
14
- import { Feature, Serializer, GLOBAL_CONTEXT_API_SCRIPT, getCrossReferenceHeader } from "seroval";
14
+ import { Feature, Serializer, getCrossReferenceHeader } from "seroval";
15
15
 
16
16
  const booleans = [
17
17
  "allowfullscreen",
@@ -25,6 +25,7 @@ const booleans = [
25
25
  "formnovalidate",
26
26
  "hidden",
27
27
  "indeterminate",
28
+ "inert",
28
29
  "ismap",
29
30
  "loop",
30
31
  "multiple",
@@ -63,9 +64,6 @@ function createSerializer({ onData, onDone, scopeId, onError }) {
63
64
  onError
64
65
  });
65
66
  }
66
- function getGlobalHeaderScript() {
67
- return GLOBAL_CONTEXT_API_SCRIPT;
68
- }
69
67
  function getLocalHeaderScript(id) {
70
68
  return getCrossReferenceHeader(id);
71
69
  }
@@ -95,6 +93,12 @@ function renderToString(code, options = {}) {
95
93
  nonce: options.nonce,
96
94
  serialize(id, p) {
97
95
  !sharedConfig.context.noHydrate && serializer.write(id, p);
96
+ },
97
+ pushed: 0,
98
+ push(p) {
99
+ const id = this.renderId + "i-" + this.pushed++;
100
+ this.serialize(id, p);
101
+ return id;
98
102
  }
99
103
  };
100
104
  let html = createRoot(d => {
@@ -216,13 +220,19 @@ function renderToStream(code, options = {}) {
216
220
  });
217
221
  } else if (!serverOnly) serializer.write(id, p);
218
222
  },
223
+ pushed: 0,
224
+ push(p) {
225
+ const id = this.renderId + "i-" + this.pushed++;
226
+ this.serialize(id, p);
227
+ return id;
228
+ },
219
229
  registerFragment(key) {
220
230
  if (!registry.has(key)) {
221
231
  let resolve, reject;
222
232
  const p = new Promise((r, rej) => ((resolve = r), (reject = rej)));
223
233
  registry.set(key, {
224
- resolve,
225
- reject
234
+ resolve: v => queue(() => queue(() => resolve(v))),
235
+ reject: e => queue(() => queue(() => reject(e)))
226
236
  });
227
237
  serializer.write(key, p);
228
238
  }
@@ -236,9 +246,7 @@ function renderToStream(code, options = {}) {
236
246
  }
237
247
  if ((value !== undefined || error) && !completed) {
238
248
  if (!firstFlushed) {
239
- Promise.resolve().then(
240
- () => (html = replacePlaceholder(html, key, value !== undefined ? value : ""))
241
- );
249
+ queue(() => (html = replacePlaceholder(html, key, value !== undefined ? value : "")));
242
250
  error ? reject(error) : resolve(true);
243
251
  } else {
244
252
  buffer.write(`<template id="${key}">${value !== undefined ? value : " "}</template>`);
@@ -248,7 +256,7 @@ function renderToStream(code, options = {}) {
248
256
  }
249
257
  }
250
258
  }
251
- if (!registry.size) Promise.resolve().then(flushEnd);
259
+ if (!registry.size) queue(flushEnd);
252
260
  return firstFlushed;
253
261
  };
254
262
  }
@@ -284,7 +292,7 @@ function renderToStream(code, options = {}) {
284
292
  complete();
285
293
  };
286
294
  } else onCompleteAll = complete;
287
- if (!registry.size) Promise.resolve().then(flushEnd);
295
+ if (!registry.size) queue(flushEnd);
288
296
  },
289
297
  pipe(w) {
290
298
  Promise.allSettled(blockingPromises).then(() => {
@@ -508,7 +516,7 @@ function generateHydrationScript({ eventNames = ["click", "input"], nonce } = {}
508
516
  nonce ? ` nonce="${nonce}"` : ""
509
517
  }>window._$HY||(e=>{let t=e=>e&&e.hasAttribute&&(e.hasAttribute("data-hk")?e:t(e.host&&e.host.nodeType?e.host:e.parentNode));["${eventNames.join(
510
518
  '", "'
511
- )}"].forEach((o=>document.addEventListener(o,(o=>{let a=o.composedPath&&o.composedPath()[0]||o.target,s=t(a);s&&!e.completed.has(s)&&e.events.push([s,o])}))))})(_$HY={events:[],completed:new WeakSet,r:{},fe(){}});${getGlobalHeaderScript()}</script><!--xs-->`;
519
+ )}"].forEach((o=>document.addEventListener(o,(o=>{let a=o.composedPath&&o.composedPath()[0]||o.target,s=t(a);s&&!e.completed.has(s)&&e.events.push([s,o])}))))})(_$HY={events:[],completed:new WeakSet,r:{},fe(){}});</script><!--xs-->`;
512
520
  }
513
521
  function Hydration(props) {
514
522
  if (!sharedConfig.context.noHydrate) return props.children;
@@ -527,6 +535,9 @@ function NoHydration(props) {
527
535
  sharedConfig.context.noHydrate = true;
528
536
  return props.children;
529
537
  }
538
+ function queue(fn) {
539
+ return Promise.resolve().then(fn);
540
+ }
530
541
  function injectAssets(assets, html) {
531
542
  if (!assets || !assets.length) return html;
532
543
  let out = "";
package/web/dist/web.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  var solidJs = require('solid-js');
4
4
 
5
- const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
5
+ const booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
6
6
  const Properties = /*#__PURE__*/new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
7
7
  const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
8
8
  const Aliases = /*#__PURE__*/Object.assign(Object.create(null), {
package/web/dist/web.js CHANGED
@@ -41,6 +41,7 @@ const booleans = [
41
41
  "formnovalidate",
42
42
  "hidden",
43
43
  "indeterminate",
44
+ "inert",
44
45
  "ismap",
45
46
  "loop",
46
47
  "multiple",