@solidjs/web 2.0.0-beta.6 → 2.0.0-beta.8

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/web.js CHANGED
@@ -1,13 +1,13 @@
1
- import { createRenderEffect, createMemo as createMemo$1, sharedConfig, untrack, runWithOwner, flatten, createRoot, omit, enableHydration } from 'solid-js';
2
- export { Errored, For, Hydration, Loading, Match, NoHydration, Reveal, Show, Switch, createComponent, getOwner, merge as mergeProps, untrack } from 'solid-js';
1
+ import { createRenderEffect, createMemo as createMemo$1, sharedConfig, untrack, runWithOwner, flatten, createRoot, omit, enableHydration, flush } from 'solid-js';
2
+ export { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent, getOwner, merge as mergeProps, untrack } from 'solid-js';
3
3
  import { createMemo } from '@solidjs/signals';
4
4
 
5
5
  const DOMWithState = {
6
6
  INPUT: {
7
7
  value: 1,
8
- defaultValue: 1,
8
+ defaultValue: 2,
9
9
  checked: 1,
10
- defaultChecked: 1
10
+ defaultChecked: 2
11
11
  },
12
12
  SELECT: {
13
13
  value: 1
@@ -15,26 +15,21 @@ const DOMWithState = {
15
15
  OPTION: {
16
16
  value: 1,
17
17
  selected: 1,
18
- defaultSelected: 1
18
+ defaultSelected: 2
19
19
  },
20
20
  TEXTAREA: {
21
21
  value: 1,
22
- defaultValue: 1
22
+ defaultValue: 2
23
23
  },
24
24
  VIDEO: {
25
25
  muted: 1,
26
- defaultMuted: 1
26
+ defaultMuted: 2
27
27
  },
28
28
  AUDIO: {
29
29
  muted: 1,
30
- defaultMuted: 1
30
+ defaultMuted: 2
31
31
  }
32
32
  };
33
- for (const tagName in DOMWithState) {
34
- for (const propName in DOMWithState[tagName]) {
35
- DOMWithState[tagName]["prop:" + propName] = 1;
36
- }
37
- }
38
33
  const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
39
34
  const DelegatedEvents = /*#__PURE__*/new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
40
35
  const SVGElements = /*#__PURE__*/new Set([
@@ -53,10 +48,14 @@ const DOMElements = /*#__PURE__*/new Set(["html", "base", "head", "link", "meta"
53
48
  "webview",
54
49
  "isindex", "listing", "multicol", "nextid", "noindex", "search"]);
55
50
 
56
- const effect = (fn, effectFn, initial) => createRenderEffect(fn, effectFn, initial, {
51
+ const transparentOptions = {
57
52
  transparent: true
58
- });
59
- const memo = (fn, transparent) => transparent ? fn.$r ? fn : createMemo(() => fn(), undefined, {
53
+ };
54
+ const effect = (fn, effectFn, options) => createRenderEffect(fn, effectFn, options ? {
55
+ transparent: true,
56
+ ...options
57
+ } : transparentOptions);
58
+ const memo = (fn, transparent) => transparent ? fn.$r ? fn : createMemo(() => fn(), {
60
59
  transparent: true
61
60
  }) : createMemo$1(() => fn());
62
61
 
@@ -119,16 +118,17 @@ function reconcileArrays(parentNode, a, b) {
119
118
 
120
119
  const $$EVENTS = "_$DX_DELEGATE";
121
120
  function render$1(code, element, init, options = {}) {
121
+ const renderRoot = getChildRoot(element);
122
122
  let disposer;
123
123
  createRoot(dispose => {
124
124
  disposer = dispose;
125
- element === document ? flatten(code) : insert(element, code(), element.firstChild ? null : undefined, init);
125
+ element === document ? flatten(code) : insert(element, code(), renderRoot.firstChild ? null : undefined, init);
126
126
  }, {
127
127
  id: options.renderId
128
128
  });
129
129
  return () => {
130
130
  disposer();
131
- element.textContent = "";
131
+ renderRoot.textContent = "";
132
132
  };
133
133
  }
134
134
  function create(html, bypassGuard, flag) {
@@ -265,11 +265,12 @@ function ref(fn, element) {
265
265
  const resolved = untrack(fn);
266
266
  runWithOwner(null, () => applyRef(resolved, element));
267
267
  }
268
- function insert(parent, accessor, marker, initial) {
268
+ function insert(parent, accessor, marker, initial, options) {
269
+ const childRoot = getChildRoot(parent);
269
270
  const multi = marker !== undefined;
270
271
  if (multi && !initial) initial = [];
271
272
  if (isHydrating(parent)) {
272
- if (!multi && initial === undefined && parent) initial = [...parent.childNodes];
273
+ if (!multi && initial === undefined && parent) initial = [...childRoot.childNodes];
273
274
  if (Array.isArray(initial)) {
274
275
  let j = 0;
275
276
  for (let i = 0; i < initial.length; i++) {
@@ -285,10 +286,10 @@ function insert(parent, accessor, marker, initial) {
285
286
  accessor = memo(accessor, true);
286
287
  if (multi && initial.length === 0) {
287
288
  const placeholder = document.createTextNode("");
288
- parent.insertBefore(placeholder, marker);
289
+ childRoot.insertBefore(placeholder, marker);
289
290
  initial = [placeholder];
290
291
  }
291
- effect(prev => normalize(accessor, prev, multi), (value, current) => insertExpression(parent, value, current, marker), initial);
292
+ effect((prev = initial) => normalize(accessor, prev, multi), (value, current = initial) => insertExpression(parent, value, current, marker), options);
292
293
  }
293
294
  function assign(node, props, skipChildren, prevProps = {}, skipRef = false) {
294
295
  const nodeName = node.nodeName;
@@ -307,8 +308,24 @@ function assign(node, props, skipChildren, prevProps = {}, skipRef = false) {
307
308
  prevProps[prop] = assignProp(node, prop, props[prop], prevProps[prop], skipRef, nodeName);
308
309
  }
309
310
  }
311
+ function loadModuleAssets(mapping) {
312
+ const hy = globalThis._$HY;
313
+ if (!hy) return;
314
+ const pending = [];
315
+ for (const moduleUrl in mapping) {
316
+ if (hy.modules[moduleUrl]) continue;
317
+ const entryUrl = mapping[moduleUrl];
318
+ if (!hy.loading[moduleUrl]) {
319
+ hy.loading[moduleUrl] = import(entryUrl).then(mod => {
320
+ hy.modules[moduleUrl] = mod;
321
+ });
322
+ }
323
+ pending.push(hy.loading[moduleUrl]);
324
+ }
325
+ return pending.length ? Promise.all(pending).then(() => {}) : undefined;
326
+ }
310
327
  function hydrate$1(code, element, options = {}) {
311
- if (globalThis._$HY.done) return render$1(code, element, [...element.childNodes], options);
328
+ if (globalThis._$HY.done) return render$1(code, element, [...getChildRoot(element).childNodes], options);
312
329
  options.renderId ||= "";
313
330
  if (!globalThis._$HY.modules) globalThis._$HY.modules = {};
314
331
  if (!globalThis._$HY.loading) globalThis._$HY.loading = {};
@@ -317,6 +334,7 @@ function hydrate$1(code, element, options = {}) {
317
334
  sharedConfig.load = id => globalThis._$HY.r[id];
318
335
  sharedConfig.has = id => id in globalThis._$HY.r;
319
336
  sharedConfig.gather = root => gatherHydratable(element, root);
337
+ sharedConfig.loadModuleAssets = loadModuleAssets;
320
338
  sharedConfig.cleanupFragment = id => {
321
339
  const tpl = document.getElementById("pl-" + id);
322
340
  if (tpl) {
@@ -335,9 +353,27 @@ function hydrate$1(code, element, options = {}) {
335
353
  };
336
354
  sharedConfig.registry = new Map();
337
355
  sharedConfig.hydrating = true;
356
+ const rootMapping = globalThis._$HY.r && globalThis._$HY.r["_assets"];
357
+ if (rootMapping && typeof rootMapping === "object") {
358
+ const p = loadModuleAssets(rootMapping);
359
+ if (p) {
360
+ gatherHydratable(element, options.renderId);
361
+ let disposer;
362
+ p.then(() => {
363
+ try {
364
+ disposer = render$1(code, element, [...getChildRoot(element).childNodes], options);
365
+ } finally {
366
+ sharedConfig.hydrating = false;
367
+ }
368
+ }, () => {
369
+ sharedConfig.hydrating = false;
370
+ });
371
+ return () => disposer && disposer();
372
+ }
373
+ }
338
374
  try {
339
375
  gatherHydratable(element, options.renderId);
340
- return render$1(code, element, [...element.childNodes], options);
376
+ return render$1(code, element, [...getChildRoot(element).childNodes], options);
341
377
  } finally {
342
378
  sharedConfig.hydrating = false;
343
379
  }
@@ -380,7 +416,7 @@ function getNextMarker(start) {
380
416
  return [end, current];
381
417
  }
382
418
  function getFirstChild(node, expectedTag) {
383
- const child = node.firstChild;
419
+ const child = getChildRoot(node).firstChild;
384
420
  return child;
385
421
  }
386
422
  function getNextSibling(node, expectedTag) {
@@ -413,6 +449,9 @@ function runHydrationEvents() {
413
449
  function isHydrating(node) {
414
450
  return sharedConfig.hydrating && (!node || node.isConnected);
415
451
  }
452
+ function getChildRoot(node) {
453
+ return node && node.localName === "template" ? node.content : node;
454
+ }
416
455
  function toggleClassKey(node, key, value) {
417
456
  const classNames = key.trim().split(/\s+/);
418
457
  for (let i = 0, nameLen = classNames.length; i < nameLen; i++) node.classList.toggle(classNames[i], value);
@@ -434,7 +473,7 @@ function flattenClassList(list, result) {
434
473
  function assignProp(node, prop, value, prev, skipRef, nodeName) {
435
474
  if (prop === "style") return style(node, value, prev), value;
436
475
  if (prop === "class") return className(node, value, prev), value;
437
- if (value === prev && !DOMWithState[nodeName]?.[prop]) return prev;
476
+ if (value === prev && DOMWithState[nodeName]?.[prop] !== 1) return prev;
438
477
  if (prop === "ref") {
439
478
  if (!skipRef && value) ref(() => value, node);
440
479
  return value;
@@ -517,21 +556,22 @@ function eventHandler(e) {
517
556
  function insertExpression(parent, value, current, marker) {
518
557
  if (isHydrating(parent)) return;
519
558
  if (value === current) return;
559
+ const childRoot = getChildRoot(parent);
520
560
  const t = typeof value,
521
561
  multi = marker !== undefined;
522
562
  if (t === "string" || t === "number") {
523
563
  const tc = typeof current;
524
564
  if (tc === "string" || tc === "number") {
525
- parent.firstChild.data = value;
526
- } else parent.textContent = value;
565
+ childRoot.firstChild.data = value;
566
+ } else childRoot.textContent = value;
527
567
  } else if (value === undefined) {
528
568
  cleanChildren(parent, current, marker);
529
569
  } else if (value.nodeType) {
530
570
  if (Array.isArray(current)) {
531
571
  cleanChildren(parent, current, multi ? marker : null, value);
532
- } else if (current === undefined || !parent.firstChild) {
533
- parent.appendChild(value);
534
- } else parent.replaceChild(value, parent.firstChild);
572
+ } else if (current === undefined || !childRoot.firstChild) {
573
+ childRoot.appendChild(value);
574
+ } else childRoot.replaceChild(value, childRoot.firstChild);
535
575
  } else if (Array.isArray(value)) {
536
576
  const currentArray = current && Array.isArray(current);
537
577
  if (value.length === 0) {
@@ -539,7 +579,7 @@ function insertExpression(parent, value, current, marker) {
539
579
  } else if (currentArray) {
540
580
  if (current.length === 0) {
541
581
  appendNodes(parent, value, marker);
542
- } else reconcileArrays(parent, current, value);
582
+ } else reconcileArrays(childRoot, current, value);
543
583
  } else {
544
584
  current && cleanChildren(parent);
545
585
  appendNodes(parent, value);
@@ -564,9 +604,11 @@ function normalize(value, current, multi, doNotUnwrap) {
564
604
  return value;
565
605
  }
566
606
  function appendNodes(parent, array, marker = null) {
607
+ parent = getChildRoot(parent);
567
608
  for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
568
609
  }
569
610
  function cleanChildren(parent, current, marker, replacement) {
611
+ parent = getChildRoot(parent);
570
612
  if (marker === undefined) return parent.textContent = "";
571
613
  if (current.length) {
572
614
  let inserted = false;
@@ -615,17 +657,33 @@ function ssrHydrationKey() {}
615
657
  function resolveSSRNode(node) {}
616
658
  function escape(html) {}
617
659
 
618
- function render(...args) {
619
- const result = render$1(...args);
620
- return result;
621
- }
622
660
  const isServer = false;
623
661
  const isDev = false;
624
- const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
625
- function createElement(tagName, isSVG = false, is = undefined) {
626
- return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName, {
627
- is
662
+ function render(code, element, init, options = {}) {
663
+ const renderRoot = element.localName === "template" ? element.content : element;
664
+ let disposer;
665
+ createRoot(dispose => {
666
+ disposer = dispose;
667
+ if (element === document) {
668
+ flatten(code);
669
+ return;
670
+ }
671
+ const marker = renderRoot.firstChild ? null : undefined;
672
+ try {
673
+ const tree = code();
674
+ insert(element, () => tree, marker, init, {
675
+ schedule: true
676
+ });
677
+ } finally {
678
+ }
679
+ }, {
680
+ id: options.renderId
628
681
  });
682
+ flush();
683
+ return () => {
684
+ disposer();
685
+ renderRoot.textContent = "";
686
+ };
629
687
  }
630
688
  const hydrate = (...args) => {
631
689
  enableHydration();
@@ -651,6 +709,29 @@ function Portal(props) {
651
709
  });
652
710
  return treeMarker;
653
711
  }
712
+ function createDynamic(component, props) {
713
+ const cached = createMemo$1(component);
714
+ return createMemo$1(() => {
715
+ const component = cached();
716
+ switch (typeof component) {
717
+ case "function":
718
+ return untrack(() => component(props));
719
+ case "string":
720
+ const el = sharedConfig.hydrating ? getNextElement() : createElement(component, untrack(() => props.is));
721
+ spread(el, props);
722
+ return el;
723
+ }
724
+ });
725
+ }
726
+ function Dynamic(props) {
727
+ const others = omit(props, "component");
728
+ return createDynamic(() => props.component, others);
729
+ }
730
+ function createElement(tagName, is = undefined) {
731
+ return SVGElements.has(tagName) ? document.createElementNS(Namespaces.svg, tagName) : MathMLElements.has(tagName) ? document.createElementNS(Namespaces.mathml, tagName) : document.createElement(tagName, {
732
+ is
733
+ });
734
+ }
654
735
  function createElementProxy(el, marker) {
655
736
  return new Proxy(el, {
656
737
  get(target, prop) {
@@ -668,24 +749,5 @@ function createElementProxy(el, marker) {
668
749
  }
669
750
  });
670
751
  }
671
- function createDynamic(component, props) {
672
- const cached = createMemo$1(component);
673
- return createMemo$1(() => {
674
- const component = cached();
675
- switch (typeof component) {
676
- case "function":
677
- return untrack(() => component(props));
678
- case "string":
679
- const isSvg = SVGElements.has(component);
680
- const el = sharedConfig.hydrating ? getNextElement() : createElement(component, isSvg, untrack(() => props.is));
681
- spread(el, props, isSvg);
682
- return el;
683
- }
684
- });
685
- }
686
- function Dynamic(props) {
687
- const others = omit(props, "component");
688
- return createDynamic(() => props.component, others);
689
- }
690
752
 
691
753
  export { voidFn as Assets, ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, voidFn as HydrationScript, MathMLElements, Namespaces, Portal, RequestContext, SVGElements, addEventListener, applyRef, assign, className, clearDelegatedEvents, createDynamic, delegateEvents, dynamicProperty, effect, escape, voidFn as generateHydrationScript, voidFn as getAssets, getFirstChild, getHydrationKey, getNextElement, getNextMarker, getNextMatch, getNextSibling, voidFn as getRequestEvent, hydrate, insert, isDev, isServer, memo, ref, render, renderToStream, renderToString, renderToStringAsync, resolveSSRNode, runHydrationEvents, setAttribute, setAttributeNS, setProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassList, ssrElement, ssrHydrationKey, ssrStyle, style, template, voidFn as useAssets };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@solidjs/web",
3
3
  "description": "Solid's web runtime for the browser and the server",
4
- "version": "2.0.0-beta.6",
4
+ "version": "2.0.0-beta.8",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "homepage": "https://solidjs.com",
@@ -21,53 +21,94 @@
21
21
  "files": [
22
22
  "dist",
23
23
  "types",
24
+ "types-cjs",
24
25
  "package.json",
25
26
  "storage/dist",
26
27
  "storage/types",
28
+ "storage/types-cjs",
27
29
  "storage/package.json"
28
30
  ],
29
31
  "exports": {
30
32
  ".": {
31
33
  "worker": {
32
- "types": "./types/index.d.ts",
33
- "import": "./dist/server.js",
34
- "require": "./dist/server.cjs"
34
+ "import": {
35
+ "types": "./types/index.d.ts",
36
+ "default": "./dist/server.js"
37
+ },
38
+ "require": {
39
+ "types": "./types-cjs/index.d.cts",
40
+ "default": "./dist/server.cjs"
41
+ }
35
42
  },
36
43
  "browser": {
37
44
  "development": {
45
+ "import": {
46
+ "types": "./types/index.d.ts",
47
+ "default": "./dist/dev.js"
48
+ },
49
+ "require": {
50
+ "types": "./types-cjs/index.d.cts",
51
+ "default": "./dist/dev.cjs"
52
+ }
53
+ },
54
+ "import": {
38
55
  "types": "./types/index.d.ts",
39
- "import": "./dist/dev.js",
40
- "require": "./dist/dev.cjs"
56
+ "default": "./dist/web.js"
41
57
  },
42
- "types": "./types/index.d.ts",
43
- "import": "./dist/web.js",
44
- "require": "./dist/web.cjs"
58
+ "require": {
59
+ "types": "./types-cjs/index.d.cts",
60
+ "default": "./dist/web.cjs"
61
+ }
45
62
  },
46
63
  "deno": {
47
- "types": "./types/index.d.ts",
48
- "import": "./dist/server.js",
49
- "require": "./dist/server.cjs"
64
+ "import": {
65
+ "types": "./types/index.d.ts",
66
+ "default": "./dist/server.js"
67
+ },
68
+ "require": {
69
+ "types": "./types-cjs/index.d.cts",
70
+ "default": "./dist/server.cjs"
71
+ }
50
72
  },
51
73
  "node": {
52
- "types": "./types/index.d.ts",
53
- "import": "./dist/server.js",
54
- "require": "./dist/server.cjs"
74
+ "import": {
75
+ "types": "./types/index.d.ts",
76
+ "default": "./dist/server.js"
77
+ },
78
+ "require": {
79
+ "types": "./types-cjs/index.d.cts",
80
+ "default": "./dist/server.cjs"
81
+ }
55
82
  },
56
83
  "development": {
84
+ "import": {
85
+ "types": "./types/index.d.ts",
86
+ "default": "./dist/dev.js"
87
+ },
88
+ "require": {
89
+ "types": "./types-cjs/index.d.cts",
90
+ "default": "./dist/dev.cjs"
91
+ }
92
+ },
93
+ "import": {
57
94
  "types": "./types/index.d.ts",
58
- "import": "./dist/dev.js",
59
- "require": "./dist/dev.cjs"
95
+ "default": "./dist/web.js"
60
96
  },
61
- "types": "./types/index.d.ts",
62
- "import": "./dist/web.js",
63
- "require": "./dist/web.cjs"
97
+ "require": {
98
+ "types": "./types-cjs/index.d.cts",
99
+ "default": "./dist/web.cjs"
100
+ }
64
101
  },
65
102
  "./storage": {
66
- "types": "./storage/types/index.d.ts",
67
- "import": "./storage/dist/storage.js",
68
- "require": "./storage/dist/storage.cjs"
103
+ "import": {
104
+ "types": "./storage/types/index.d.ts",
105
+ "default": "./storage/dist/storage.js"
106
+ },
107
+ "require": {
108
+ "types": "./storage/types-cjs/index.d.cts",
109
+ "default": "./storage/dist/storage.cjs"
110
+ }
69
111
  },
70
- "./dist/*": "./dist/*",
71
112
  "./types/*": "./types/*"
72
113
  },
73
114
  "dependencies": {
@@ -75,23 +116,24 @@
75
116
  "seroval-plugins": "^1.1.0"
76
117
  },
77
118
  "peerDependencies": {
78
- "@solidjs/signals": "^0.13.11",
79
- "solid-js": "^2.0.0-beta.6"
119
+ "@solidjs/signals": "^2.0.0-beta.8",
120
+ "solid-js": "^2.0.0-beta.8"
80
121
  },
81
122
  "devDependencies": {
82
- "@solidjs/signals": "^0.13.11",
83
- "solid-js": "2.0.0-beta.6"
123
+ "@solidjs/signals": "2.0.0-beta.8",
124
+ "solid-js": "2.0.0-beta.8"
84
125
  },
85
126
  "scripts": {
86
127
  "build": "npm-run-all -nl build:*",
87
128
  "build:clean": "rimraf dist/",
88
129
  "build:js": "rollup -c",
89
130
  "link": "symlink-dir . node_modules/@solidjs/web",
90
- "types": "npm-run-all -nl types:*",
91
- "types:clean": "rimraf types/",
131
+ "types": "npm-run-all -nl types:clean types:web types:copy-web types:web-storage types:cjs",
132
+ "types:clean": "rimraf types/ types-cjs/ storage/types-cjs/",
92
133
  "types:web": "tsc --project ./tsconfig.build.json",
93
134
  "types:copy-web": "ncp ../../node_modules/dom-expressions/src/client.d.ts ./types/client.d.ts && ncp ../../node_modules/dom-expressions/src/server.d.ts ./types/server.d.ts",
94
135
  "types:web-storage": "tsc --project ./storage/tsconfig.build.json",
136
+ "types:cjs": "node ../../scripts/sync-dual-types.mjs ./types ./types-cjs ./storage/types ./storage/types-cjs",
95
137
  "test": "vitest run && vitest run --config vite.config.server.mjs && vitest run --config vite.config.hydrate.mjs",
96
138
  "test:server": "vitest run --config vite.config.server.mjs",
97
139
  "coverage": "vitest run --coverage",
@@ -7,9 +7,14 @@
7
7
  "sideEffects": false,
8
8
  "exports": {
9
9
  ".": {
10
- "types": "./types/index.d.ts",
11
- "import": "./dist/storage.js",
12
- "require": "./dist/storage.cjs"
10
+ "import": {
11
+ "types": "./types/index.d.ts",
12
+ "default": "./dist/storage.js"
13
+ },
14
+ "require": {
15
+ "types": "./types-cjs/index.d.cts",
16
+ "default": "./dist/storage.cjs"
17
+ }
13
18
  }
14
19
  }
15
20
  }
@@ -1,11 +1,30 @@
1
- import { hydrate as hydrateCore, render as renderCore } from "./client.js";
1
+ import { hydrate as hydrateCore } from "./client.js";
2
2
  import { JSX, ComponentProps, ValidComponent } from "solid-js";
3
3
  export * from "./client.js";
4
- export declare function render(...args: Parameters<typeof renderCore>): ReturnType<typeof renderCore>;
5
- export { For, Show, Switch, Match, Errored, Loading, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
6
4
  export * from "./server-mock.js";
5
+ export { For, Show, Switch, Match, Errored, Loading, Repeat, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
7
6
  export declare const isServer: boolean;
8
7
  export declare const isDev: boolean;
8
+ type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
9
+ export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
10
+ [K in keyof P]: P[K];
11
+ } & {
12
+ component: T | undefined;
13
+ };
14
+ /**
15
+ * Renders a component tree into a DOM element and returns a dispose function.
16
+ *
17
+ * The top-level insert runs with `schedule: true` so its initial DOM attach
18
+ * goes through the effect queue rather than executing inline. This lets the
19
+ * mount participate in transitions: if an uncaught async read surfaces during
20
+ * the initial render (no `Loading` ancestor absorbs it), the mount is held by
21
+ * the transition and attaches atomically once all pending settles. On the
22
+ * no-async happy path the tail `flush()` drains the queued callback so the
23
+ * attach is synchronous by the time `render()` returns.
24
+ */
25
+ export declare function render(code: () => JSX.Element, element: MountableElement, init?: unknown, options?: {
26
+ renderId?: string;
27
+ }): () => void;
9
28
  export declare const hydrate: typeof hydrateCore;
10
29
  /**
11
30
  * Renders components somewhere else in the DOM
@@ -18,11 +37,6 @@ export declare function Portal<T extends boolean = false, S extends boolean = fa
18
37
  mount?: Element;
19
38
  children: JSX.Element;
20
39
  }): Text;
21
- export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
22
- [K in keyof P]: P[K];
23
- } & {
24
- component: T | undefined;
25
- };
26
40
  /**
27
41
  * Renders an arbitrary component or element with the given props
28
42
  *
@@ -0,0 +1,2 @@
1
+ import type { RequestEvent } from "@solidjs/web";
2
+ export declare function provideRequestEvent<T extends RequestEvent, U>(init: T, cb: () => U): U;
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1 @@
1
+ export * from "dom-expressions/src/client.js";
@@ -0,0 +1,60 @@
1
+ import { hydrate as hydrateCore } from "./client.cjs";
2
+ import { JSX, ComponentProps, ValidComponent } from "solid-js";
3
+ export * from "./client.cjs";
4
+ export * from "./server-mock.cjs";
5
+ export { For, Show, Switch, Match, Errored, Loading, Repeat, Reveal, NoHydration, Hydration, merge as mergeProps } from "solid-js";
6
+ export declare const isServer: boolean;
7
+ export declare const isDev: boolean;
8
+ type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
9
+ export type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {
10
+ [K in keyof P]: P[K];
11
+ } & {
12
+ component: T | undefined;
13
+ };
14
+ /**
15
+ * Renders a component tree into a DOM element and returns a dispose function.
16
+ *
17
+ * The top-level insert runs with `schedule: true` so its initial DOM attach
18
+ * goes through the effect queue rather than executing inline. This lets the
19
+ * mount participate in transitions: if an uncaught async read surfaces during
20
+ * the initial render (no `Loading` ancestor absorbs it), the mount is held by
21
+ * the transition and attaches atomically once all pending settles. On the
22
+ * no-async happy path the tail `flush()` drains the queued callback so the
23
+ * attach is synchronous by the time `render()` returns.
24
+ */
25
+ export declare function render(code: () => JSX.Element, element: MountableElement, init?: unknown, options?: {
26
+ renderId?: string;
27
+ }): () => void;
28
+ export declare const hydrate: typeof hydrateCore;
29
+ /**
30
+ * Renders components somewhere else in the DOM
31
+ *
32
+ * Useful for inserting modals and tooltips outside of an cropping layout. If no mount point is given, the portal is inserted in document.body; it is wrapped in a `<div>` unless the target is document.head or `isSVG` is true. setting `useShadow` to true places the element in a shadow root to isolate styles.
33
+ *
34
+ * @description https://docs.solidjs.com/reference/components/portal
35
+ */
36
+ export declare function Portal<T extends boolean = false, S extends boolean = false>(props: {
37
+ mount?: Element;
38
+ children: JSX.Element;
39
+ }): Text;
40
+ /**
41
+ * Renders an arbitrary component or element with the given props
42
+ *
43
+ * This is a lower level version of the `Dynamic` component, useful for
44
+ * performance optimizations in libraries. Do not use this unless you know
45
+ * what you are doing.
46
+ * ```typescript
47
+ * const element = () => multiline() ? 'textarea' : 'input';
48
+ * createDynamic(element, { value: value() });
49
+ * ```
50
+ * @description https://docs.solidjs.com/reference/components/dynamic
51
+ */
52
+ export declare function createDynamic<T extends ValidComponent>(component: () => T | undefined, props: ComponentProps<T>): JSX.Element;
53
+ /**
54
+ * Renders an arbitrary custom or native component and passes the other props
55
+ * ```typescript
56
+ * <Dynamic component={multiline() ? 'textarea' : 'input'} value={value()} />
57
+ * ```
58
+ * @description https://docs.solidjs.com/reference/components/dynamic
59
+ */
60
+ export declare function Dynamic<T extends ValidComponent>(props: DynamicProps<T>): JSX.Element;