@shadow-js/web 1.0.0 → 1.0.1
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/CHANGELOG.md +6 -0
- package/dist/dev/attributes.d.ts +0 -2
- package/dist/dev/attributes.js +1 -2
- package/dist/dev/autofocus.d.ts +0 -2
- package/dist/dev/autofocus.js +1 -2
- package/dist/dev/class-style.d.ts +0 -2
- package/dist/dev/class-style.js +1 -2
- package/dist/dev/component.d.ts +0 -2
- package/dist/dev/component.js +1 -2
- package/dist/dev/control-flow/activity.d.ts +0 -2
- package/dist/dev/control-flow/activity.js +1 -2
- package/dist/dev/control-flow/branch.js +0 -1
- package/dist/dev/control-flow/client-only.d.ts +0 -2
- package/dist/dev/control-flow/client-only.js +1 -2
- package/dist/dev/control-flow/dynamic.d.ts +0 -2
- package/dist/dev/control-flow/dynamic.js +1 -2
- package/dist/dev/control-flow/error-boundary.d.ts +0 -2
- package/dist/dev/control-flow/error-boundary.js +1 -2
- package/dist/dev/control-flow/for.d.ts +0 -2
- package/dist/dev/control-flow/for.js +1 -2
- package/dist/dev/control-flow/fragment.d.ts +0 -2
- package/dist/dev/control-flow/fragment.js +1 -2
- package/dist/dev/control-flow/hot-link.js +1 -2
- package/dist/dev/control-flow/index-list.d.ts +0 -2
- package/dist/dev/control-flow/index-list.js +1 -2
- package/dist/dev/control-flow/lazy.d.ts +0 -2
- package/dist/dev/control-flow/lazy.js +1 -2
- package/dist/dev/control-flow/no-hydration.d.ts +0 -2
- package/dist/dev/control-flow/no-hydration.js +1 -2
- package/dist/dev/control-flow/portal.d.ts +0 -2
- package/dist/dev/control-flow/portal.js +1 -2
- package/dist/dev/control-flow/root-errors.d.ts +0 -2
- package/dist/dev/control-flow/root-errors.js +1 -2
- package/dist/dev/control-flow/show.d.ts +0 -2
- package/dist/dev/control-flow/show.js +1 -2
- package/dist/dev/control-flow/suspense-list.d.ts +0 -2
- package/dist/dev/control-flow/suspense-list.js +1 -2
- package/dist/dev/control-flow/suspense.d.ts +0 -2
- package/dist/dev/control-flow/suspense.js +1 -2
- package/dist/dev/control-flow/switch.d.ts +0 -2
- package/dist/dev/control-flow/switch.js +1 -2
- package/dist/dev/derived.d.ts +0 -2
- package/dist/dev/derived.js +1 -2
- package/dist/dev/element.d.ts +0 -2
- package/dist/dev/element.js +1 -2
- package/dist/dev/events.d.ts +0 -2
- package/dist/dev/events.js +1 -2
- package/dist/dev/head/components.d.ts +0 -2
- package/dist/dev/head/components.js +1 -2
- package/dist/dev/head/registry.js +1 -2
- package/dist/dev/head/server-head.d.ts +0 -2
- package/dist/dev/head/server-head.js +1 -2
- package/dist/dev/head/sink.js +1 -2
- package/dist/dev/head/use-head.d.ts +0 -2
- package/dist/dev/head/use-head.js +1 -2
- package/dist/dev/head/validate.d.ts +0 -2
- package/dist/dev/head/validate.js +1 -2
- package/dist/dev/hmr.d.ts +0 -2
- package/dist/dev/hmr.js +1 -2
- package/dist/dev/hydration.d.ts +0 -2
- package/dist/dev/hydration.js +1 -2
- package/dist/dev/insert.d.ts +0 -2
- package/dist/dev/insert.js +1 -2
- package/dist/dev/internal/claim.d.ts +0 -2
- package/dist/dev/internal/claim.js +1 -2
- package/dist/dev/internal/css-units.js +1 -2
- package/dist/dev/internal/diagnostics.d.ts +0 -2
- package/dist/dev/internal/diagnostics.js +1 -2
- package/dist/dev/internal/early-events.js +1 -2
- package/dist/dev/internal/hydration-hooks.d.ts +0 -2
- package/dist/dev/internal/hydration-hooks.js +0 -1
- package/dist/dev/internal/hydration-scope.d.ts +0 -2
- package/dist/dev/internal/hydration-scope.js +1 -2
- package/dist/dev/internal/names.d.ts +0 -2
- package/dist/dev/internal/names.js +1 -2
- package/dist/dev/internal/portal-context.d.ts +0 -2
- package/dist/dev/internal/portal-context.js +1 -2
- package/dist/dev/internal/react-names.js +1 -2
- package/dist/dev/internal/reconcile.d.ts +0 -2
- package/dist/dev/internal/reconcile.js +1 -2
- package/dist/dev/internal/stream-context.d.ts +0 -2
- package/dist/dev/internal/stream-context.js +1 -2
- package/dist/dev/jsx/aria.d.ts +0 -2
- package/dist/dev/jsx/component.d.ts +0 -2
- package/dist/dev/jsx/events.d.ts +0 -2
- package/dist/dev/jsx/global.d.ts +0 -2
- package/dist/dev/jsx/html.d.ts +0 -2
- package/dist/dev/jsx/intrinsic.d.ts +0 -2
- package/dist/dev/jsx/mathml.d.ts +0 -2
- package/dist/dev/jsx/svg.d.ts +0 -2
- package/dist/dev/jsx/types.d.ts +0 -2
- package/dist/dev/jsx-runtime.d.ts +0 -2
- package/dist/dev/reactive.d.ts +0 -2
- package/dist/dev/reactive.js +1 -2
- package/dist/dev/render.d.ts +0 -2
- package/dist/dev/render.js +1 -2
- package/dist/dev/resource-hints.d.ts +0 -2
- package/dist/dev/resource-hints.js +1 -2
- package/dist/dev/select-value.d.ts +0 -2
- package/dist/dev/select-value.js +1 -2
- package/dist/dev/server/attributes.d.ts +0 -2
- package/dist/dev/server/attributes.js +1 -2
- package/dist/dev/server/class-style.d.ts +0 -2
- package/dist/dev/server/class-style.js +1 -2
- package/dist/dev/server/component.d.ts +0 -2
- package/dist/dev/server/component.js +1 -2
- package/dist/dev/server/derived.d.ts +0 -2
- package/dist/dev/server/derived.js +1 -2
- package/dist/dev/server/element.d.ts +0 -2
- package/dist/dev/server/element.js +1 -2
- package/dist/dev/server/errors.js +1 -2
- package/dist/dev/server/escape.d.ts +0 -2
- package/dist/dev/server/escape.js +1 -2
- package/dist/dev/server/form-controls.d.ts +0 -2
- package/dist/dev/server/form-controls.js +1 -2
- package/dist/dev/server/hydration-script.d.ts +0 -2
- package/dist/dev/server/hydration-script.js +1 -2
- package/dist/dev/server/node.d.ts +0 -2
- package/dist/dev/server/node.js +1 -2
- package/dist/dev/server/portals.d.ts +0 -2
- package/dist/dev/server/portals.js +0 -1
- package/dist/dev/server/render.d.ts +0 -2
- package/dist/dev/server/render.js +1 -2
- package/dist/dev/server/serialize.d.ts +0 -2
- package/dist/dev/server/serialize.js +1 -2
- package/dist/dev/server/stream.d.ts +0 -2
- package/dist/dev/server/stream.js +1 -2
- package/dist/dev/spread.d.ts +0 -2
- package/dist/dev/spread.js +1 -2
- package/dist/dev/template.d.ts +0 -2
- package/dist/dev/template.js +1 -2
- package/dist/dev/view-transition.d.ts +0 -2
- package/dist/dev/view-transition.js +1 -2
- package/dist/server-dev/attributes.js +1 -2
- package/dist/server-dev/autofocus.js +1 -2
- package/dist/server-dev/class-style.js +1 -2
- package/dist/server-dev/component.js +1 -2
- package/dist/server-dev/control-flow/activity.js +1 -2
- package/dist/server-dev/control-flow/branch.js +0 -1
- package/dist/server-dev/control-flow/client-only.js +1 -2
- package/dist/server-dev/control-flow/dynamic.js +1 -2
- package/dist/server-dev/control-flow/error-boundary.js +1 -2
- package/dist/server-dev/control-flow/for.js +1 -2
- package/dist/server-dev/control-flow/fragment.js +1 -2
- package/dist/server-dev/control-flow/hot-link.js +1 -2
- package/dist/server-dev/control-flow/index-list.js +1 -2
- package/dist/server-dev/control-flow/lazy.js +1 -2
- package/dist/server-dev/control-flow/no-hydration.js +1 -2
- package/dist/server-dev/control-flow/portal.js +1 -2
- package/dist/server-dev/control-flow/root-errors.js +1 -2
- package/dist/server-dev/control-flow/show.js +1 -2
- package/dist/server-dev/control-flow/suspense-list.js +1 -2
- package/dist/server-dev/control-flow/suspense.js +1 -2
- package/dist/server-dev/control-flow/switch.js +1 -2
- package/dist/server-dev/derived.js +1 -2
- package/dist/server-dev/element.js +1 -2
- package/dist/server-dev/events.js +1 -2
- package/dist/server-dev/head/components.js +1 -2
- package/dist/server-dev/head/registry.js +1 -2
- package/dist/server-dev/head/server-head.js +1 -2
- package/dist/server-dev/head/sink.js +1 -2
- package/dist/server-dev/head/use-head.js +1 -2
- package/dist/server-dev/head/validate.js +1 -2
- package/dist/server-dev/hydration.js +1 -2
- package/dist/server-dev/insert.js +1 -2
- package/dist/server-dev/internal/claim.js +1 -2
- package/dist/server-dev/internal/css-units.js +1 -2
- package/dist/server-dev/internal/diagnostics.js +1 -2
- package/dist/server-dev/internal/early-events.js +1 -2
- package/dist/server-dev/internal/hydration-hooks.js +0 -1
- package/dist/server-dev/internal/hydration-scope.js +1 -2
- package/dist/server-dev/internal/names.js +1 -2
- package/dist/server-dev/internal/portal-context.js +1 -2
- package/dist/server-dev/internal/react-names.js +1 -2
- package/dist/server-dev/internal/reconcile.js +1 -2
- package/dist/server-dev/internal/stream-context.js +1 -2
- package/dist/server-dev/reactive.js +1 -2
- package/dist/server-dev/render.js +1 -2
- package/dist/server-dev/resource-hints.js +1 -2
- package/dist/server-dev/select-value.js +1 -2
- package/dist/server-dev/server/attributes.js +1 -2
- package/dist/server-dev/server/class-style.js +1 -2
- package/dist/server-dev/server/component.js +1 -2
- package/dist/server-dev/server/derived.js +1 -2
- package/dist/server-dev/server/element.js +1 -2
- package/dist/server-dev/server/errors.js +1 -2
- package/dist/server-dev/server/escape.js +1 -2
- package/dist/server-dev/server/form-controls.js +1 -2
- package/dist/server-dev/server/hydration-script.js +1 -2
- package/dist/server-dev/server/node.js +1 -2
- package/dist/server-dev/server/portals.js +0 -1
- package/dist/server-dev/server/render.js +1 -2
- package/dist/server-dev/server/serialize.js +1 -2
- package/dist/server-dev/server/stream.js +1 -2
- package/dist/server-dev/spread.js +1 -2
- package/dist/server-dev/template.js +1 -2
- package/dist/server-dev/view-transition.js +1 -2
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext } from "@shadow-js/core";
|
|
2
|
-
|
|
2
|
+
// src/internal/stream-context.ts
|
|
3
3
|
/**
|
|
4
4
|
* The context through which `renderToStream` lets a Suspense-like boundary defer its content: a
|
|
5
5
|
* boundary that is pending in the shell renders its fallback between `<!--[b:ID-->` and `<!--]-->`
|
|
@@ -17,7 +17,6 @@ import { createContext } from "@shadow-js/core";
|
|
|
17
17
|
* @since 1.0.0
|
|
18
18
|
*/
|
|
19
19
|
const StreamContext = /* @__PURE__ */ createContext(null, { name: "Stream" });
|
|
20
|
-
//#endregion
|
|
21
20
|
export { StreamContext };
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=stream-context.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getOwner, onCleanup, untrack, useMemo, useRenderEffect } from "@shadow-js/core";
|
|
2
|
-
|
|
2
|
+
// src/reactive.ts
|
|
3
3
|
function effect(compute, apply) {
|
|
4
4
|
if (apply === void 0) useRenderEffect(compute);
|
|
5
5
|
else useRenderEffect(compute, apply);
|
|
@@ -79,7 +79,6 @@ function refTo(target, el) {
|
|
|
79
79
|
holder.current = null;
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
//#endregion
|
|
83
82
|
export { effect, memo, refTo, use };
|
|
84
83
|
|
|
85
84
|
//# sourceMappingURL=reactive.js.map
|
|
@@ -3,7 +3,7 @@ import { claims } from "./internal/hydration-hooks.js";
|
|
|
3
3
|
import { bindRegion, createRegion, removeRegion } from "./insert.js";
|
|
4
4
|
import { attachRootErrors } from "./control-flow/root-errors.js";
|
|
5
5
|
import { batch, createRoot, flushSync, untrack } from "@shadow-js/core";
|
|
6
|
-
|
|
6
|
+
// src/render.ts
|
|
7
7
|
/**
|
|
8
8
|
* Mounts `code` into `container`. Creates an owner, inserts the output, flushes the effects, and
|
|
9
9
|
* returns a dispose function that stops the owner and removes the nodes this call inserted. A
|
|
@@ -46,7 +46,6 @@ function render(code, container, options) {
|
|
|
46
46
|
removeRegion(region);
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
//#endregion
|
|
50
49
|
export { render };
|
|
51
50
|
|
|
52
51
|
//# sourceMappingURL=render.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useHead } from "./head/use-head.js";
|
|
2
2
|
import { isServer } from "@shadow-js/core";
|
|
3
|
-
|
|
3
|
+
// src/resource-hints.ts
|
|
4
4
|
/** Hints are page-level and only ever use http(s) URLs; anything else throws, like head tags do. */
|
|
5
5
|
function checkUrl(href) {
|
|
6
6
|
const url = new URL(href, "https://base.invalid");
|
|
@@ -194,7 +194,6 @@ function preinitModule(href, options) {
|
|
|
194
194
|
...options?.crossOrigin === void 0 ? {} : { crossorigin: options.crossOrigin }
|
|
195
195
|
}));
|
|
196
196
|
}
|
|
197
|
-
//#endregion
|
|
198
197
|
export { preconnect, prefetchDNS, preinit, preinitModule, preload, preloadModule };
|
|
199
198
|
|
|
200
199
|
//# sourceMappingURL=resource-hints.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/select-value.ts
|
|
2
2
|
/** The values an array stands for, as strings; null and undefined entries are skipped. */
|
|
3
3
|
function listed(value) {
|
|
4
4
|
const values = /* @__PURE__ */ new Set();
|
|
@@ -45,7 +45,6 @@ function selectShows(select, value) {
|
|
|
45
45
|
}
|
|
46
46
|
return select.value === single(value);
|
|
47
47
|
}
|
|
48
|
-
//#endregion
|
|
49
48
|
export { selectShows, setSelectValue };
|
|
50
49
|
|
|
51
50
|
//# sourceMappingURL=select-value.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { invalid } from "./errors.js";
|
|
2
2
|
import { escapeHtml, resolveValue } from "./escape.js";
|
|
3
|
-
|
|
3
|
+
// src/server/attributes.ts
|
|
4
4
|
/** Names that can appear in markup: an XML-name subset without `@` or whitespace. Same as the client. */
|
|
5
5
|
const ATTRIBUTE_NAME = /^[A-Za-z_:][A-Za-z0-9_:.-]*$/;
|
|
6
6
|
/** Attributes whose value is a URL and is therefore checked for script schemes. Same as the client. */
|
|
@@ -149,7 +149,6 @@ function ssrAttribute(name, value, isBoolean = false) {
|
|
|
149
149
|
if (isUnsafeAttributeValue(lowerName, text)) return "";
|
|
150
150
|
return ` ${name}="${escapeHtml(text)}"`;
|
|
151
151
|
}
|
|
152
|
-
//#endregion
|
|
153
152
|
export { BOOLEAN_ATTRIBUTES, assertAttributeName, attributeText, isEventName, isUnsafeUrl, ssrAttribute };
|
|
154
153
|
|
|
155
154
|
//# sourceMappingURL=attributes.js.map
|
|
@@ -2,7 +2,7 @@ import { cssValueText } from "../internal/css-units.js";
|
|
|
2
2
|
import { invalid } from "./errors.js";
|
|
3
3
|
import { isSsrNode } from "./node.js";
|
|
4
4
|
import { escapeHtml, resolveValue } from "./escape.js";
|
|
5
|
-
|
|
5
|
+
// src/server/class-style.ts
|
|
6
6
|
/** A CSS property name: a custom property, or a lower-case name with an optional vendor dash. */
|
|
7
7
|
const CSS_PROPERTY = /^(--[A-Za-z0-9_-]+|-?[a-z][a-z0-9-]*)$/;
|
|
8
8
|
/**
|
|
@@ -167,7 +167,6 @@ function ssrStyle(value) {
|
|
|
167
167
|
const text = styleText(value);
|
|
168
168
|
return text === "" ? "" : ` style="${escapeHtml(text)}"`;
|
|
169
169
|
}
|
|
170
|
-
//#endregion
|
|
171
170
|
export { classText, collectClasses, isSafeCssValue, ssrClass, ssrStyle, styleText, toCssProperty };
|
|
172
171
|
|
|
173
172
|
//# sourceMappingURL=class-style.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { currentScope, enterComponent } from "../internal/hydration-scope.js";
|
|
2
2
|
import { untrack } from "@shadow-js/core";
|
|
3
3
|
import { createOwner, runInScope } from "@shadow-js/core/extend";
|
|
4
|
-
|
|
4
|
+
// src/server/component.ts
|
|
5
5
|
/**
|
|
6
6
|
* Calls a component on the server, untracked, with its own owner and hydration scope, so the
|
|
7
7
|
* hydration keys it hands out depend only on where it sits in the tree. The server twin of the client
|
|
@@ -66,7 +66,6 @@ function memo(fn) {
|
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
//#endregion
|
|
70
69
|
export { createComponent, memo };
|
|
71
70
|
|
|
72
71
|
//# sourceMappingURL=component.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/server/derived.ts
|
|
2
2
|
/**
|
|
3
3
|
* The server twin of the client `derived`, which the compiler emits for `const x = <expression
|
|
4
4
|
* reading signals>` inside a component. On the server it calls `compute` once, immediately, and
|
|
@@ -20,7 +20,6 @@ function derived(compute) {
|
|
|
20
20
|
Object.defineProperty(read, "value", { value: current });
|
|
21
21
|
return read;
|
|
22
22
|
}
|
|
23
|
-
//#endregion
|
|
24
23
|
export { derived };
|
|
25
24
|
|
|
26
25
|
//# sourceMappingURL=derived.js.map
|
|
@@ -6,7 +6,7 @@ import { escape, escapeHtml, resolveValue } from "./escape.js";
|
|
|
6
6
|
import { BOOLEAN_ATTRIBUTES, isEventName, ssrAttribute } from "./attributes.js";
|
|
7
7
|
import { classText, ssrStyle, styleText } from "./class-style.js";
|
|
8
8
|
import { markSelectedOptions, textareaContent } from "./form-controls.js";
|
|
9
|
-
|
|
9
|
+
// src/server/element.ts
|
|
10
10
|
/** A tag name: letters, digits and dashes, starting with a letter. Anything else could break out. */
|
|
11
11
|
const TAG_NAME = /^[A-Za-z][A-Za-z0-9-]*$/;
|
|
12
12
|
/** Elements that never have children or a closing tag. */
|
|
@@ -210,7 +210,6 @@ function plainHtml(value) {
|
|
|
210
210
|
if (typeof value === "symbol") throw invalid("UNRECOGNIZED_INSERT_VALUE", "A symbol cannot be innerHTML.");
|
|
211
211
|
return String(value);
|
|
212
212
|
}
|
|
213
|
-
//#endregion
|
|
214
213
|
export { ssr, ssrElement, ssrHydrationKey, ssrRaw };
|
|
215
214
|
|
|
216
215
|
//# sourceMappingURL=element.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/server/errors.ts
|
|
2
2
|
/**
|
|
3
3
|
* Error thrown by the server renderer, carrying a stable code. Dev builds carry the full text;
|
|
4
4
|
* production builds keep only the code (the same split as core's diagnostics).
|
|
@@ -20,7 +20,6 @@ var SsrError = class extends Error {
|
|
|
20
20
|
function invalid(code, detail) {
|
|
21
21
|
return /* @__PURE__ */ new TypeError(`[shadow ${code}] ${detail}`);
|
|
22
22
|
}
|
|
23
|
-
//#endregion
|
|
24
23
|
export { SsrError, invalid };
|
|
25
24
|
|
|
26
25
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { invalid } from "./errors.js";
|
|
2
2
|
import { isSsrNode } from "./node.js";
|
|
3
3
|
import { untrack } from "@shadow-js/core";
|
|
4
|
-
|
|
4
|
+
// src/server/escape.ts
|
|
5
5
|
const HTML_ESCAPES = {
|
|
6
6
|
"&": "&",
|
|
7
7
|
"<": "<",
|
|
@@ -113,7 +113,6 @@ function escape(value) {
|
|
|
113
113
|
item = next;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
//#endregion
|
|
117
116
|
export { escape, escapeHtml, resolveValue };
|
|
118
117
|
|
|
119
118
|
//# sourceMappingURL=escape.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { invalid } from "./errors.js";
|
|
2
2
|
import { SsrNode } from "./node.js";
|
|
3
3
|
import { escape, escapeHtml, resolveValue } from "./escape.js";
|
|
4
|
-
|
|
4
|
+
// src/server/form-controls.ts
|
|
5
5
|
/**
|
|
6
6
|
* Server markup for the controls whose state is not an attribute. A browser ignores `value` on a
|
|
7
7
|
* `<textarea>` and on a `<select>`: the textarea's text is its content, and the select's value is
|
|
@@ -187,7 +187,6 @@ function ssrSelectValue(value, children) {
|
|
|
187
187
|
function markSelectedOptions(value, html) {
|
|
188
188
|
return markOptions(html, wantedValues(value));
|
|
189
189
|
}
|
|
190
|
-
//#endregion
|
|
191
190
|
export { markSelectedOptions, ssrSelectValue, ssrTextArea, textareaContent };
|
|
192
191
|
|
|
193
192
|
//# sourceMappingURL=form-controls.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ssrRaw } from "./element.js";
|
|
2
2
|
import { DEFAULT_EARLY_EVENTS, captureScriptBody } from "../internal/early-events.js";
|
|
3
|
-
|
|
3
|
+
// src/server/hydration-script.ts
|
|
4
4
|
const NONCE = /^[A-Za-z0-9+/=_-]+$/;
|
|
5
5
|
/**
|
|
6
6
|
* Returns the inline `<script>` that records the events a user makes before the app has hydrated, so
|
|
@@ -53,7 +53,6 @@ function generateHydrationScript(options = {}) {
|
|
|
53
53
|
function HydrationScript(props = {}) {
|
|
54
54
|
return ssrRaw(generateHydrationScript(props));
|
|
55
55
|
}
|
|
56
|
-
//#endregion
|
|
57
56
|
export { HydrationScript, generateHydrationScript };
|
|
58
57
|
|
|
59
58
|
//# sourceMappingURL=hydration-script.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/server/node.ts
|
|
2
2
|
/**
|
|
3
3
|
* Markup that is already safe to insert: the only value `escape` writes without encoding.
|
|
4
4
|
* A class instance, not a `{ t }` shape, so a plain object parsed from user input can never be
|
|
@@ -15,7 +15,6 @@ var SsrNode = class {
|
|
|
15
15
|
function isSsrNode(value) {
|
|
16
16
|
return value instanceof SsrNode;
|
|
17
17
|
}
|
|
18
|
-
//#endregion
|
|
19
18
|
export { SsrNode, isSsrNode };
|
|
20
19
|
|
|
21
20
|
//# sourceMappingURL=node.js.map
|
|
@@ -93,7 +93,6 @@ function portalCollectorFor(portals) {
|
|
|
93
93
|
collector.clear();
|
|
94
94
|
return collector;
|
|
95
95
|
}
|
|
96
|
-
//#endregion
|
|
97
96
|
export { PortalCollector, collectorOf, createServerPortals, portalCollectorFor, renderServerPortal, withPortalSink };
|
|
98
97
|
|
|
99
98
|
//# sourceMappingURL=portals.js.map
|
|
@@ -5,7 +5,7 @@ import { attachRootErrors } from "../control-flow/root-errors.js";
|
|
|
5
5
|
import { portalCollectorFor, withPortalSink } from "./portals.js";
|
|
6
6
|
import { runWithServerHead } from "../head/server-head.js";
|
|
7
7
|
import { ResourceCacheContext, createRoot } from "@shadow-js/core";
|
|
8
|
-
|
|
8
|
+
// src/server/render.ts
|
|
9
9
|
const DEFAULT_TIMEOUT_MS = 1e4;
|
|
10
10
|
const DEFAULT_MAX_PASSES = 10;
|
|
11
11
|
const RENDER_ID = /^[A-Za-z0-9_-]+$/;
|
|
@@ -250,7 +250,6 @@ async function renderToStringAsync(code, options) {
|
|
|
250
250
|
for (const dispose of job.roots.splice(0)) dispose();
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
|
-
//#endregion
|
|
254
253
|
export { renderToString, renderToStringAsync };
|
|
255
254
|
|
|
256
255
|
//# sourceMappingURL=render.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { invalid } from "./errors.js";
|
|
2
|
-
|
|
2
|
+
// src/server/serialize.ts
|
|
3
3
|
/** Characters that may not appear raw in the output: they would end a script element or a line. */
|
|
4
4
|
const UNSAFE_TEXT = /[<>&\u2028\u2029]/g;
|
|
5
5
|
/** Escapes text for `<script type="application/json">`: the JSON stays valid, the markup cannot close. */
|
|
@@ -309,7 +309,6 @@ function deserialize(text) {
|
|
|
309
309
|
}
|
|
310
310
|
return decodeValue(own(payload, "r"), made);
|
|
311
311
|
}
|
|
312
|
-
//#endregion
|
|
313
312
|
export { deserialize, serialize };
|
|
314
313
|
|
|
315
314
|
//# sourceMappingURL=serialize.js.map
|
|
@@ -7,7 +7,7 @@ import { portalCollectorFor, withPortalSink } from "./portals.js";
|
|
|
7
7
|
import { runWithServerHead } from "../head/server-head.js";
|
|
8
8
|
import { serialize } from "./serialize.js";
|
|
9
9
|
import { ResourceCacheContext, createRoot, untrack } from "@shadow-js/core";
|
|
10
|
-
|
|
10
|
+
// src/server/stream.ts
|
|
11
11
|
const RENDER_ID = /^[A-Za-z0-9_-]+$/;
|
|
12
12
|
const DEFAULT_TIMEOUT_MS = 3e4;
|
|
13
13
|
/**
|
|
@@ -229,7 +229,6 @@ function renderToStream(code, options = {}) {
|
|
|
229
229
|
}
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
|
-
//#endregion
|
|
233
232
|
export { renderToStream };
|
|
234
233
|
|
|
235
234
|
//# sourceMappingURL=stream.js.map
|
|
@@ -7,7 +7,7 @@ import { IGNORED_KEYS, attributeName, eventPlan } from "./internal/react-names.j
|
|
|
7
7
|
import { bindEvent } from "./events.js";
|
|
8
8
|
import { selectShows, setSelectValue } from "./select-value.js";
|
|
9
9
|
import { onCleanup, untrack, useRenderEffect } from "@shadow-js/core";
|
|
10
|
-
|
|
10
|
+
// src/spread.ts
|
|
11
11
|
/** The namespace of `xlink:` attributes (SVG's legacy links). */
|
|
12
12
|
const XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
13
13
|
/** The HTML of a `dangerouslySetInnerHTML` value (`{ __html }`); null and undefined mean empty. */
|
|
@@ -290,7 +290,6 @@ function spread(el, props, isSVG = false, skipChildren = false) {
|
|
|
290
290
|
applyEntries(el, entries, state, isSVG);
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
|
-
//#endregion
|
|
294
293
|
export { spread };
|
|
295
294
|
|
|
296
295
|
//# sourceMappingURL=spread.js.map
|
|
@@ -3,7 +3,7 @@ import { MATHML_NS } from "./internal/names.js";
|
|
|
3
3
|
import { nextKey } from "./internal/hydration-scope.js";
|
|
4
4
|
import { checkClaimedTag } from "./internal/claim.js";
|
|
5
5
|
import { claims } from "./internal/hydration-hooks.js";
|
|
6
|
-
|
|
6
|
+
// src/template.ts
|
|
7
7
|
/** One start tag: its name, then its attribute text (group 1). */
|
|
8
8
|
const START_TAG = /<[a-zA-Z][^\s/>]*((?:\s+[^\s"'>/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'>]+))?)*)\s*\/?>/g;
|
|
9
9
|
/** One attribute inside the attribute text of a start tag: its name (group 1). */
|
|
@@ -114,7 +114,6 @@ function template(html, flags = 0) {
|
|
|
114
114
|
return fragment;
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
//#endregion
|
|
118
117
|
export { template };
|
|
119
118
|
|
|
120
119
|
//# sourceMappingURL=template.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { flushSync } from "@shadow-js/core";
|
|
2
|
-
|
|
2
|
+
// src/view-transition.ts
|
|
3
3
|
/**
|
|
4
4
|
* Runs `update` inside a browser view transition, so the change animates from the old screen to the
|
|
5
5
|
* new one, and resolves when the animation has finished. Without the API (older browsers, or a
|
|
@@ -84,7 +84,6 @@ function startViewTransition(update, options) {
|
|
|
84
84
|
function ViewTransition(props) {
|
|
85
85
|
return () => props.children;
|
|
86
86
|
}
|
|
87
|
-
//#endregion
|
|
88
87
|
export { ViewTransition, startViewTransition };
|
|
89
88
|
|
|
90
89
|
//# sourceMappingURL=view-transition.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shadow-js/web",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A DOM renderer with no virtual DOM, plus control flow, server rendering and hydration",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"typecheck": "tsc -p tsconfig.json"
|
|
110
110
|
},
|
|
111
111
|
"peerDependencies": {
|
|
112
|
-
"@shadow-js/core": "^1.0.
|
|
112
|
+
"@shadow-js/core": "^1.0.1"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
115
|
"@biomejs/biome": "2.5.15",
|