@fluixi/dom 1.0.0-alpha.83 → 1.0.0-alpha.85
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/cdn/dom-client.cjs +1427 -1
- package/dist/cdn/dom-client.d.ts +2 -2
- package/dist/cdn/dom-client.global.js +2 -1
- package/dist/cdn/dom-client.js +3 -3
- package/dist/cdn/dom-client.mjs +1430 -1
- package/dist/cdn/dom.cjs +3127 -1
- package/dist/cdn/dom.d.ts +2 -2
- package/dist/cdn/dom.global.js +2 -1
- package/dist/cdn/dom.js +4 -4
- package/dist/cdn/dom.mjs +3133 -1
- package/dist/index.cjs +3155 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +3149 -1
- package/dist/lib/component/index.cjs +128 -1
- package/dist/lib/component/index.mjs +105 -1
- package/dist/lib/component/modifiers.cjs +126 -1
- package/dist/lib/component/modifiers.d.ts +12 -0
- package/dist/lib/component/modifiers.d.ts.map +1 -1
- package/dist/lib/component/modifiers.js +12 -84
- package/dist/lib/component/modifiers.mjs +105 -1
- package/dist/lib/dom/delegate.cjs +60 -1
- package/dist/lib/dom/delegate.js +1 -1
- package/dist/lib/dom/delegate.mjs +39 -1
- package/dist/lib/dom/dynamic-element.cjs +949 -1
- package/dist/lib/dom/dynamic-element.d.ts +3 -3
- package/dist/lib/dom/dynamic-element.js +2 -2
- package/dist/lib/dom/dynamic-element.mjs +928 -1
- package/dist/lib/dom/hydration-state.cjs +93 -1
- package/dist/lib/dom/hydration-state.d.ts +1 -1
- package/dist/lib/dom/hydration-state.js +1 -1
- package/dist/lib/dom/hydration-state.mjs +72 -1
- package/dist/lib/dom/hydration.cjs +685 -1
- package/dist/lib/dom/hydration.js +8 -8
- package/dist/lib/dom/hydration.mjs +664 -1
- package/dist/lib/dom/index.cjs +2040 -1
- package/dist/lib/dom/index.js +1 -1
- package/dist/lib/dom/index.mjs +2020 -1
- package/dist/lib/dom/integration.cjs +71 -1
- package/dist/lib/dom/integration.js +3 -3
- package/dist/lib/dom/integration.mjs +51 -1
- package/dist/lib/dom/island.cjs +790 -1
- package/dist/lib/dom/island.d.ts +1 -1
- package/dist/lib/dom/island.js +11 -11
- package/dist/lib/dom/island.mjs +769 -1
- package/dist/lib/dom/runtime.cjs +1432 -1
- package/dist/lib/dom/runtime.d.ts +60 -17
- package/dist/lib/dom/runtime.d.ts.map +1 -1
- package/dist/lib/dom/runtime.js +122 -79
- package/dist/lib/dom/runtime.mjs +1414 -1
- package/dist/lib/dom/server/fx-data.cjs +53 -1
- package/dist/lib/dom/server/fx-data.d.ts +5 -5
- package/dist/lib/dom/server/fx-data.js +6 -6
- package/dist/lib/dom/server/fx-data.mjs +32 -1
- package/dist/lib/dom/server/host.cjs +66 -1
- package/dist/lib/dom/server/host.d.ts +6 -0
- package/dist/lib/dom/server/host.d.ts.map +1 -1
- package/dist/lib/dom/server/host.js +7 -1
- package/dist/lib/dom/server/host.mjs +45 -1
- package/dist/lib/dom/server/index.cjs +759 -1
- package/dist/lib/dom/server/index.d.ts +1 -1
- package/dist/lib/dom/server/index.js +1 -1
- package/dist/lib/dom/server/index.mjs +743 -1
- package/dist/lib/dom/server/nodes.cjs +302 -1
- package/dist/lib/dom/server/nodes.d.ts +2 -2
- package/dist/lib/dom/server/nodes.d.ts.map +1 -1
- package/dist/lib/dom/server/nodes.js +4 -4
- package/dist/lib/dom/server/nodes.mjs +279 -1
- package/dist/lib/dom/server/parse-template.cjs +395 -1
- package/dist/lib/dom/server/parse-template.d.ts +1 -1
- package/dist/lib/dom/server/parse-template.js +4 -4
- package/dist/lib/dom/server/parse-template.mjs +372 -1
- package/dist/lib/dom/server/render.cjs +691 -1
- package/dist/lib/dom/server/render.d.ts +9 -1
- package/dist/lib/dom/server/render.d.ts.map +1 -1
- package/dist/lib/dom/server/render.js +23 -15
- package/dist/lib/dom/server/render.mjs +677 -1
- package/dist/lib/dom/server/request-context.cjs +110 -1
- package/dist/lib/dom/server/request-context.d.ts +29 -9
- package/dist/lib/dom/server/request-context.d.ts.map +1 -1
- package/dist/lib/dom/server/request-context.js +28 -8
- package/dist/lib/dom/server/request-context.mjs +89 -1
- package/dist/lib/dom/server/serialize.cjs +187 -1
- package/dist/lib/dom/server/serialize.js +3 -3
- package/dist/lib/dom/server/serialize.mjs +164 -1
- package/dist/lib/dom/server-renderer.cjs +760 -1
- package/dist/lib/dom/server-renderer.js +1 -1
- package/dist/lib/dom/server-renderer.mjs +745 -1
- package/dist/lib/dom/types.cjs +18 -1
- package/dist/lib/dom/utils.cjs +381 -1
- package/dist/lib/dom/utils.d.ts +1 -88
- package/dist/lib/dom/utils.d.ts.map +1 -1
- package/dist/lib/dom/utils.js +2 -99
- package/dist/lib/dom/utils.mjs +361 -1
- package/dist/lib/dom/versions.cjs +60 -1
- package/dist/lib/dom/versions.d.ts +3 -3
- package/dist/lib/dom/versions.d.ts.map +1 -1
- package/dist/lib/dom/versions.js +17 -5
- package/dist/lib/dom/versions.mjs +37 -1
- package/dist/lib/element/attributes.cjs +19 -1
- package/dist/lib/element/attributes.d.ts +7 -7
- package/dist/lib/element/attributes.js +1 -1
- package/dist/lib/element/attributes.mjs +1 -0
- package/dist/lib/element/index.cjs +19 -1
- package/dist/lib/element/index.mjs +1 -0
- package/dist/lib/element/types.cjs +18 -1
- package/dist/lib/element/types.d.ts +4 -5
- package/dist/lib/element/types.d.ts.map +1 -1
- package/dist/lib/element/types.js +0 -1
- package/dist/lib/flow/class-map.cjs +38 -1
- package/dist/lib/flow/class-map.d.ts +3 -3
- package/dist/lib/flow/class-map.js +2 -2
- package/dist/lib/flow/class-map.mjs +17 -1
- package/dist/lib/flow/client-only.cjs +57 -1
- package/dist/lib/flow/client-only.d.ts +4 -4
- package/dist/lib/flow/client-only.js +3 -3
- package/dist/lib/flow/client-only.mjs +36 -1
- package/dist/lib/flow/dynamic.cjs +53 -1
- package/dist/lib/flow/dynamic.d.ts +2 -2
- package/dist/lib/flow/dynamic.js +3 -3
- package/dist/lib/flow/dynamic.mjs +32 -1
- package/dist/lib/flow/error-boundary.cjs +43 -1
- package/dist/lib/flow/error-boundary.d.ts +2 -2
- package/dist/lib/flow/error-boundary.js +3 -3
- package/dist/lib/flow/error-boundary.mjs +22 -1
- package/dist/lib/flow/for.cjs +66 -1
- package/dist/lib/flow/for.d.ts +9 -9
- package/dist/lib/flow/for.d.ts.map +1 -1
- package/dist/lib/flow/for.js +2 -2
- package/dist/lib/flow/for.mjs +45 -1
- package/dist/lib/flow/index-flow.cjs +67 -1
- package/dist/lib/flow/index-flow.d.ts +5 -5
- package/dist/lib/flow/index-flow.js +4 -4
- package/dist/lib/flow/index-flow.mjs +46 -1
- package/dist/lib/flow/index.cjs +805 -1
- package/dist/lib/flow/index.mjs +792 -1
- package/dist/lib/flow/portal.cjs +538 -1
- package/dist/lib/flow/portal.mjs +519 -1
- package/dist/lib/flow/show.cjs +81 -1
- package/dist/lib/flow/show.d.ts +1 -1
- package/dist/lib/flow/show.d.ts.map +1 -1
- package/dist/lib/flow/show.js +4 -115
- package/dist/lib/flow/show.mjs +67 -1
- package/dist/lib/flow/style-map.cjs +43 -1
- package/dist/lib/flow/style-map.d.ts +3 -3
- package/dist/lib/flow/style-map.js +3 -3
- package/dist/lib/flow/style-map.mjs +22 -1
- package/dist/lib/flow/switch.cjs +91 -1
- package/dist/lib/flow/switch.d.ts +3 -3
- package/dist/lib/flow/switch.d.ts.map +1 -1
- package/dist/lib/flow/switch.js +6 -6
- package/dist/lib/flow/switch.mjs +70 -1
- package/dist/lib/flow/utils.cjs +44 -1
- package/dist/lib/flow/utils.d.ts +1 -1
- package/dist/lib/flow/utils.js +1 -1
- package/dist/lib/flow/utils.mjs +23 -1
- package/dist/lib/html.cjs +32 -1
- package/dist/lib/html.d.ts +6 -6
- package/dist/lib/html.js +5 -5
- package/dist/lib/html.mjs +11 -1
- package/dist/lib/index.cjs +3104 -1
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +2 -3
- package/dist/lib/index.mjs +3097 -1
- package/dist/lib/shared/types.cjs +18 -1
- package/dist/lib/shared/types.d.ts +8 -8
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/version.generated.cjs +26 -1
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +2 -2
- package/dist/version.generated.mjs +5 -1
- package/package.json +7 -6
- package/dist/lib/jsx/control-flow/flow.cjs +0 -1
- package/dist/lib/jsx/control-flow/flow.d.ts +0 -2
- package/dist/lib/jsx/control-flow/flow.d.ts.map +0 -1
- package/dist/lib/jsx/control-flow/flow.js +0 -627
- package/dist/lib/jsx/control-flow/flow.mjs +0 -0
- package/dist/lib/jsx/control-flow/for-flow.cjs +0 -1
- package/dist/lib/jsx/control-flow/for-flow.d.ts +0 -2
- package/dist/lib/jsx/control-flow/for-flow.d.ts.map +0 -1
- package/dist/lib/jsx/control-flow/for-flow.js +0 -1
- package/dist/lib/jsx/control-flow/for-flow.mjs +0 -0
|
@@ -1 +1,60 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/lib/dom/versions.ts
|
|
21
|
+
var versions_exports = {};
|
|
22
|
+
__export(versions_exports, {
|
|
23
|
+
registerCoreVersion: () => registerCoreVersion,
|
|
24
|
+
stampVersions: () => stampVersions,
|
|
25
|
+
versions: () => versions,
|
|
26
|
+
warnOnVersionSkew: () => warnOnVersionSkew
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(versions_exports);
|
|
29
|
+
|
|
30
|
+
// src/version.generated.ts
|
|
31
|
+
var VERSION = "1.0.0-alpha.85";
|
|
32
|
+
|
|
33
|
+
// src/lib/dom/versions.ts
|
|
34
|
+
var import_version = require("@fluixi/reactive/version");
|
|
35
|
+
var import_signal = require("@fluixi/reactive/signal");
|
|
36
|
+
var versions = { dom: VERSION, reactive: import_version.VERSION };
|
|
37
|
+
function registerCoreVersion(version) {
|
|
38
|
+
versions.core = version;
|
|
39
|
+
}
|
|
40
|
+
function stampVersions(container) {
|
|
41
|
+
if (versions.core) container.setAttribute("fluixi", versions.core);
|
|
42
|
+
container.setAttribute("fx-dom", versions.dom);
|
|
43
|
+
container.setAttribute("fx-reactive", versions.reactive);
|
|
44
|
+
if (typeof globalThis !== "undefined") globalThis.Fluixi = versions;
|
|
45
|
+
}
|
|
46
|
+
function warnOnVersionSkew() {
|
|
47
|
+
const builds = (0, import_signal.joinedVersions)();
|
|
48
|
+
if (builds.length > 1) {
|
|
49
|
+
console.warn(
|
|
50
|
+
`[fluixi] ${builds.length} builds of @fluixi/reactive are driving one reactive graph: ${builds.join(", ")}. They share it on purpose, so signals still cross between them, but the oldest one decided what the graph looks like. Build the components on one release, or load them as shared-runtime bundles.`
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
const present = [versions.core, versions.dom, versions.reactive].filter(
|
|
54
|
+
(v) => v !== void 0
|
|
55
|
+
);
|
|
56
|
+
if (new Set(present).size <= 1) return;
|
|
57
|
+
console.warn(
|
|
58
|
+
`[fluixi] package versions disagree: core ${versions.core ?? "(absent)"}, dom ${versions.dom}, reactive ${versions.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** The versions of the packages this app is running. */
|
|
2
2
|
export interface FluixiVersions {
|
|
3
|
-
/** Absent when the app does not use `@fluixi/core
|
|
3
|
+
/** Absent when the app does not use `@fluixi/core`: dom and reactive can run alone. */
|
|
4
4
|
core?: string;
|
|
5
5
|
dom: string;
|
|
6
6
|
reactive: string;
|
|
@@ -18,8 +18,8 @@ export declare function registerCoreVersion(version: string): void;
|
|
|
18
18
|
/**
|
|
19
19
|
* Stamp the versions onto the mount element and expose them as `window.Fluixi`.
|
|
20
20
|
*
|
|
21
|
-
* The attributes make it visible in the page source and in a screenshot of devtools
|
|
22
|
-
* usually all a bug report contains
|
|
21
|
+
* The attributes make it visible in the page source and in a screenshot of devtools,
|
|
22
|
+
* usually all a bug report contains, while the global is what you reach for in a console.
|
|
23
23
|
*/
|
|
24
24
|
export declare function stampVersions(container: Element): void;
|
|
25
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/versions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/versions.ts"],"names":[],"mappings":"AAoBA,wDAAwD;AACxD,MAAM,WAAW,cAAc;IAC7B,uFAAuF;IACvF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,QAAQ,EAAE,cAAiD,CAAC;AAEzE,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC;CACxC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAMtD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CA0BxC"}
|
package/dist/lib/dom/versions.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Which build of each package is actually running.
|
|
3
3
|
*
|
|
4
4
|
* This used to live in `@fluixi/core`, stamped only by *its* `render`. But an app can
|
|
5
|
-
* reach the DOM through either entry point
|
|
6
|
-
* `render`/`hydrate` by way of `startClient
|
|
5
|
+
* reach the DOM through either entry point: `@fluixi/core`'s `render`, or this package's
|
|
6
|
+
* `render`/`hydrate` by way of `startClient`, and only the first stamped anything. An app
|
|
7
7
|
* that hydrated (the docs site, every SSR app) therefore had no version attributes at all,
|
|
8
8
|
* which is exactly the case where a bug report needs them most.
|
|
9
9
|
*
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { VERSION as DOM } from '../../version.generated.js';
|
|
18
18
|
import { VERSION as REACTIVE } from '@fluixi/reactive/version';
|
|
19
|
+
import { joinedVersions } from '@fluixi/reactive/signal';
|
|
19
20
|
export const versions = { dom: DOM, reactive: REACTIVE };
|
|
20
21
|
/**
|
|
21
22
|
* Record the `@fluixi/core` version, called by core when it is loaded.
|
|
@@ -28,8 +29,8 @@ export function registerCoreVersion(version) {
|
|
|
28
29
|
/**
|
|
29
30
|
* Stamp the versions onto the mount element and expose them as `window.Fluixi`.
|
|
30
31
|
*
|
|
31
|
-
* The attributes make it visible in the page source and in a screenshot of devtools
|
|
32
|
-
* usually all a bug report contains
|
|
32
|
+
* The attributes make it visible in the page source and in a screenshot of devtools,
|
|
33
|
+
* usually all a bug report contains, while the global is what you reach for in a console.
|
|
33
34
|
*/
|
|
34
35
|
export function stampVersions(container) {
|
|
35
36
|
if (versions.core)
|
|
@@ -47,10 +48,21 @@ export function stampVersions(container) {
|
|
|
47
48
|
* surface later as a reactivity bug nobody can reproduce.
|
|
48
49
|
*/
|
|
49
50
|
export function warnOnVersionSkew() {
|
|
51
|
+
// Two or more builds of @fluixi/reactive sharing one graph. `versions` is module
|
|
52
|
+
// state, so it only ever describes the bundle it was compiled into and cannot see
|
|
53
|
+
// this; the graph itself keeps the list. Standalone web components are how it
|
|
54
|
+
// happens in practice, each carrying its own runtime onto the same page.
|
|
55
|
+
const builds = joinedVersions();
|
|
56
|
+
if (builds.length > 1) {
|
|
57
|
+
console.warn(`[fluixi] ${builds.length} builds of @fluixi/reactive are driving one reactive ` +
|
|
58
|
+
`graph: ${builds.join(', ')}. They share it on purpose, so signals still cross ` +
|
|
59
|
+
`between them, but the oldest one decided what the graph looks like. Build the ` +
|
|
60
|
+
`components on one release, or load them as shared-runtime bundles.`);
|
|
61
|
+
}
|
|
50
62
|
const present = [versions.core, versions.dom, versions.reactive].filter((v) => v !== undefined);
|
|
51
63
|
if (new Set(present).size <= 1)
|
|
52
64
|
return;
|
|
53
|
-
console.warn(`[fluixi] package versions disagree
|
|
65
|
+
console.warn(`[fluixi] package versions disagree: core ${versions.core ?? '(absent)'}, ` +
|
|
54
66
|
`dom ${versions.dom}, reactive ${versions.reactive}. These ship as one release, so a ` +
|
|
55
67
|
`mismatch usually means a stale lockfile or two copies resolved side by side. ` +
|
|
56
68
|
`Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`);
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
// src/version.generated.ts
|
|
2
|
+
var VERSION = "1.0.0-alpha.85";
|
|
3
|
+
|
|
4
|
+
// src/lib/dom/versions.ts
|
|
5
|
+
import { VERSION as REACTIVE } from "@fluixi/reactive/version";
|
|
6
|
+
import { joinedVersions } from "@fluixi/reactive/signal";
|
|
7
|
+
var versions = { dom: VERSION, reactive: REACTIVE };
|
|
8
|
+
function registerCoreVersion(version) {
|
|
9
|
+
versions.core = version;
|
|
10
|
+
}
|
|
11
|
+
function stampVersions(container) {
|
|
12
|
+
if (versions.core) container.setAttribute("fluixi", versions.core);
|
|
13
|
+
container.setAttribute("fx-dom", versions.dom);
|
|
14
|
+
container.setAttribute("fx-reactive", versions.reactive);
|
|
15
|
+
if (typeof globalThis !== "undefined") globalThis.Fluixi = versions;
|
|
16
|
+
}
|
|
17
|
+
function warnOnVersionSkew() {
|
|
18
|
+
const builds = joinedVersions();
|
|
19
|
+
if (builds.length > 1) {
|
|
20
|
+
console.warn(
|
|
21
|
+
`[fluixi] ${builds.length} builds of @fluixi/reactive are driving one reactive graph: ${builds.join(", ")}. They share it on purpose, so signals still cross between them, but the oldest one decided what the graph looks like. Build the components on one release, or load them as shared-runtime bundles.`
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
const present = [versions.core, versions.dom, versions.reactive].filter(
|
|
25
|
+
(v) => v !== void 0
|
|
26
|
+
);
|
|
27
|
+
if (new Set(present).size <= 1) return;
|
|
28
|
+
console.warn(
|
|
29
|
+
`[fluixi] package versions disagree: core ${versions.core ?? "(absent)"}, dom ${versions.dom}, reactive ${versions.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
registerCoreVersion,
|
|
34
|
+
stampVersions,
|
|
35
|
+
versions,
|
|
36
|
+
warnOnVersionSkew
|
|
37
|
+
};
|
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/*! @fluixi/dom v1.0.0-alpha.85 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
|
|
17
|
+
// src/lib/element/attributes.ts
|
|
18
|
+
var attributes_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(attributes_exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* DOM element attribute types
|
|
2
|
+
* DOM element attribute types, the props every element accepts, independent of
|
|
3
3
|
* how it was authored. `@fluixi/jsx` re-exports these into the `JSX` namespace
|
|
4
4
|
* for JSX consumers; html`` tooling reads them from here directly.
|
|
5
5
|
*
|
|
@@ -14,8 +14,8 @@ import type { ComponentChild } from '../shared/types.js';
|
|
|
14
14
|
* applies a function-valued prop as a reactive render effect, so any attribute typed with this
|
|
15
15
|
* accepts `() => value` without a cast.
|
|
16
16
|
*
|
|
17
|
-
* The accessor may return `undefined` to omit the attribute reactively
|
|
18
|
-
* removes the attr on `undefined`/`null`/`false
|
|
17
|
+
* The accessor may return `undefined` to omit the attribute reactively: `setAttribute`
|
|
18
|
+
* removes the attr on `undefined`/`null`/`false`, so `() => (cond ? 'true' : undefined)`
|
|
19
19
|
* type-checks without a cast.
|
|
20
20
|
*/
|
|
21
21
|
export type Reactive<T> = T | undefined | Accessor<T | undefined>;
|
|
@@ -36,7 +36,7 @@ export type HTMLReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrad
|
|
|
36
36
|
*
|
|
37
37
|
* Selecting the string-valued members keeps the properties and drops
|
|
38
38
|
* `CSSStyleDeclaration`'s methods, `length` and numeric index. There is
|
|
39
|
-
* deliberately no open `[key: string]` fallback
|
|
39
|
+
* deliberately no open `[key: string]` fallback, it would make every misspelled
|
|
40
40
|
* property type-check, and `--*` already covers custom properties. For a property
|
|
41
41
|
* newer than the TypeScript lib, set it as a custom property or widen at the call
|
|
42
42
|
* site.
|
|
@@ -1046,8 +1046,8 @@ export interface SVGAttributes<T = SVGElement> extends DOMAttributes<T> {
|
|
|
1046
1046
|
* Anything the renderer accepts as output. `JSX.Element` aliases this; html``
|
|
1047
1047
|
* templates produce the same values, so the type is shared rather than duplicated.
|
|
1048
1048
|
*
|
|
1049
|
-
* It is now literally the same type, not a parallel copy. The two had drifted
|
|
1050
|
-
* this one lacked `ComponentChild`'s recursive array and lazy child
|
|
1049
|
+
* It is now literally the same type, not a parallel copy. The two had drifted:
|
|
1050
|
+
* this one lacked `ComponentChild`'s recursive array and lazy child, so a
|
|
1051
1051
|
* component annotated with the shared `ComponentChild` was rejected as a JSX
|
|
1052
1052
|
* component. Both authoring modes compile to the same runtime calls, so
|
|
1053
1053
|
* "renderable" has to mean one thing.
|
|
@@ -1056,7 +1056,7 @@ export type FxElement = ComponentChild;
|
|
|
1056
1056
|
/**
|
|
1057
1057
|
* Every intrinsic tag mapped to the attributes it accepts. `JSX.IntrinsicElements`
|
|
1058
1058
|
* aliases this. It lives here because html`` tooling needs the same map to type
|
|
1059
|
-
* `<div class
|
|
1059
|
+
* `<div class=...>` inside a template, that has nothing to do with JSX.
|
|
1060
1060
|
*/
|
|
1061
1061
|
export interface IntrinsicElements {
|
|
1062
1062
|
a: AnchorHTMLAttributes;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* DOM element attribute types
|
|
2
|
+
* DOM element attribute types, the props every element accepts, independent of
|
|
3
3
|
* how it was authored. `@fluixi/jsx` re-exports these into the `JSX` namespace
|
|
4
4
|
* for JSX consumers; html`` tooling reads them from here directly.
|
|
5
5
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! @fluixi/dom v1.0.0-alpha.85 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/*! @fluixi/dom v1.0.0-alpha.85 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
|
|
17
|
+
// src/lib/element/index.ts
|
|
18
|
+
var index_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(index_exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! @fluixi/dom v1.0.0-alpha.85 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/lib/element/types.ts
|
|
17
|
+
var types_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Advanced types for @fluixi/element
|
|
3
2
|
* @module @fluixi/dom/element/types
|
|
4
3
|
*/
|
|
5
4
|
export type PropTypeConstructor = typeof String | typeof Number | typeof Boolean | typeof Object | typeof Array;
|
|
@@ -10,7 +9,7 @@ export interface PropDefinition<T = unknown> {
|
|
|
10
9
|
}
|
|
11
10
|
/** Resolve the TS type from a PropDefinition's `type` constructor */
|
|
12
11
|
export type InferPropType<D extends PropDefinition> = D extends PropDefinition<infer Def> ? D['type'] extends typeof String ? string : D['type'] extends typeof Number ? number : D['type'] extends typeof Boolean ? boolean : D['type'] extends typeof Array ? unknown[] : D['type'] extends typeof Object ? Record<string, unknown> : Def extends undefined ? unknown : Def : unknown;
|
|
13
|
-
/** Signal tuple: [accessor, setter]
|
|
12
|
+
/** Signal tuple: [accessor, setter]: matches createSignal return */
|
|
14
13
|
export type SignalTuple<T> = [
|
|
15
14
|
get: () => T,
|
|
16
15
|
set: (v: T | ((prev: T) => T)) => void
|
|
@@ -19,7 +18,7 @@ export type SignalTuple<T> = [
|
|
|
19
18
|
export type PropsSignals<T extends Record<string, PropDefinition>> = {
|
|
20
19
|
[K in keyof T]: SignalTuple<InferPropType<T[K]>>;
|
|
21
20
|
};
|
|
22
|
-
/** Render function for defineElement
|
|
21
|
+
/** Render function for defineElement: fully typed props and event context */
|
|
23
22
|
export type ElementRenderFn<T extends Record<string, PropDefinition>, E extends Record<string, EventDefinition> = Record<string, EventDefinition>> = (props: PropsSignals<T>, ctx: ElementRenderContext<E>) => unknown;
|
|
24
23
|
export interface EventDefinition<T = unknown> {
|
|
25
24
|
detail?: T;
|
|
@@ -59,7 +58,7 @@ export interface TypedFluixiElement<P extends Record<string, PropDefinition>> ex
|
|
|
59
58
|
setProp<K extends string & keyof P>(name: K, value: InferPropType<P[K]>): void;
|
|
60
59
|
getProp<K extends string & keyof P>(name: K): InferPropType<P[K]>;
|
|
61
60
|
}
|
|
62
|
-
/** Constructor type returned by defineElement
|
|
61
|
+
/** Constructor type returned by defineElement: carries tag name + prop types + event types */
|
|
63
62
|
export interface FluixiElementConstructor<Tag extends string = string, P extends Record<string, PropDefinition> = Record<string, PropDefinition>, E extends Record<string, EventDefinition> = Record<string, EventDefinition>> {
|
|
64
63
|
new (): TypedFluixiElement<P>;
|
|
65
64
|
observedAttributes: string[];
|
|
@@ -124,6 +123,6 @@ export type PropToAttribute<P extends Record<string, PropDefinition>> = {
|
|
|
124
123
|
attribute: infer A extends string;
|
|
125
124
|
} ? A : K extends string ? CamelToKebab<K> : never]?: InferPropType<P[K]>;
|
|
126
125
|
};
|
|
127
|
-
/** CamelCase
|
|
126
|
+
/** CamelCase -> kebab-case at the type level */
|
|
128
127
|
export type CamelToKebab<S extends string> = S extends `${infer C}${infer Rest}` ? C extends Uppercase<C> ? `-${Lowercase<C>}${CamelToKebab<Rest>}` : `${C}${CamelToKebab<Rest>}` : S;
|
|
129
128
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/element/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/element/types.ts"],"names":[],"mappings":"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eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,IAAI;KACrE,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;QAAE,SAAS,EAAE,KAAK,CAAA;KAAE,GAC9C,KAAK,GACL,CAAC,CAAC,CAAC,CAAC,SAAS;QAAE,SAAS,EAAE,MAAM,CAAC,SAAS,MAAM,CAAA;KAAE,GAClD,CAAC,GACD,CAAC,SAAS,MAAM,GAChB,YAAY,CAAC,CAAC,CAAC,GACf,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACjC,CAAC;AAEF,gDAAgD;AAChD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,MAAM,IAAI,EAAE,GAC5E,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,GACpB,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,EAAE,GACvC,GAAG,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,EAAE,GAC7B,CAAC,CAAC"}
|
|
@@ -1 +1,38 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/lib/flow/class-map.ts
|
|
21
|
+
var class_map_exports = {};
|
|
22
|
+
__export(class_map_exports, {
|
|
23
|
+
classMap: () => classMap
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(class_map_exports);
|
|
26
|
+
var import_signal = require("@fluixi/reactive/signal");
|
|
27
|
+
function classMap(input) {
|
|
28
|
+
return (0, import_signal.createMemo)(() => {
|
|
29
|
+
const map = typeof input === "function" ? input() : input;
|
|
30
|
+
const classes = [];
|
|
31
|
+
for (const [cls, cond] of Object.entries(map)) {
|
|
32
|
+
if (!cls) continue;
|
|
33
|
+
const active = typeof cond === "function" ? cond() : cond;
|
|
34
|
+
if (active) classes.push(cls);
|
|
35
|
+
}
|
|
36
|
+
return classes.join(" ");
|
|
37
|
+
}, void 0, { name: "ClassMap" });
|
|
38
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Accessor } from '@fluixi/reactive/signal';
|
|
2
2
|
/**
|
|
3
|
-
* A single class condition
|
|
3
|
+
* A single class condition: static boolean or a reactive function.
|
|
4
4
|
*/
|
|
5
5
|
export type ClassCondition = boolean | null | undefined | Accessor<boolean | null | undefined> | (() => boolean | null | undefined);
|
|
6
6
|
/**
|
|
@@ -22,7 +22,7 @@ export type ClassMapInput = Record<string, ClassCondition> | Accessor<Record<str
|
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* // Static
|
|
25
|
-
* classMap({ active: true, disabled: false }) //
|
|
25
|
+
* classMap({ active: true, disabled: false }) // -> "active"
|
|
26
26
|
*
|
|
27
27
|
* // Per-key reactive values
|
|
28
28
|
* classMap({ active: isActive, 'text-sm': () => size() === 'sm' })
|
|
@@ -30,7 +30,7 @@ export type ClassMapInput = Record<string, ClassCondition> | Accessor<Record<str
|
|
|
30
30
|
* // Whole map reactive
|
|
31
31
|
* classMap(() => ({ active: isActive(), error: hasError() }))
|
|
32
32
|
*
|
|
33
|
-
* // Mixed
|
|
33
|
+
* // Mixed: combine a static base class with reactive conditions
|
|
34
34
|
* classMap({ 'btn': true, 'btn-primary': isPrimary, 'btn-disabled': disabled })
|
|
35
35
|
*/
|
|
36
36
|
export declare function classMap(input: ClassMapInput): Accessor<string>;
|
|
@@ -12,7 +12,7 @@ import { createMemo } from '@fluixi/reactive/signal';
|
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* // Static
|
|
15
|
-
* classMap({ active: true, disabled: false }) //
|
|
15
|
+
* classMap({ active: true, disabled: false }) // -> "active"
|
|
16
16
|
*
|
|
17
17
|
* // Per-key reactive values
|
|
18
18
|
* classMap({ active: isActive, 'text-sm': () => size() === 'sm' })
|
|
@@ -20,7 +20,7 @@ import { createMemo } from '@fluixi/reactive/signal';
|
|
|
20
20
|
* // Whole map reactive
|
|
21
21
|
* classMap(() => ({ active: isActive(), error: hasError() }))
|
|
22
22
|
*
|
|
23
|
-
* // Mixed
|
|
23
|
+
* // Mixed: combine a static base class with reactive conditions
|
|
24
24
|
* classMap({ 'btn': true, 'btn-primary': isPrimary, 'btn-disabled': disabled })
|
|
25
25
|
*/
|
|
26
26
|
export function classMap(input) {
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lib/flow/class-map.ts
|
|
2
|
+
import { createMemo } from "@fluixi/reactive/signal";
|
|
3
|
+
function classMap(input) {
|
|
4
|
+
return createMemo(() => {
|
|
5
|
+
const map = typeof input === "function" ? input() : input;
|
|
6
|
+
const classes = [];
|
|
7
|
+
for (const [cls, cond] of Object.entries(map)) {
|
|
8
|
+
if (!cls) continue;
|
|
9
|
+
const active = typeof cond === "function" ? cond() : cond;
|
|
10
|
+
if (active) classes.push(cls);
|
|
11
|
+
}
|
|
12
|
+
return classes.join(" ");
|
|
13
|
+
}, void 0, { name: "ClassMap" });
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
classMap
|
|
17
|
+
};
|
|
@@ -1 +1,57 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/lib/flow/client-only.ts
|
|
21
|
+
var client_only_exports = {};
|
|
22
|
+
__export(client_only_exports, {
|
|
23
|
+
ClientOnly: () => ClientOnly,
|
|
24
|
+
NoSsr: () => NoSsr
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(client_only_exports);
|
|
27
|
+
var import_signal = require("@fluixi/reactive/signal");
|
|
28
|
+
|
|
29
|
+
// src/lib/dom/server/host.ts
|
|
30
|
+
var STATE = /* @__PURE__ */ Symbol.for("fluixi.dom.server-host");
|
|
31
|
+
var realm = globalThis;
|
|
32
|
+
var state = realm[STATE] ??= {
|
|
33
|
+
server: typeof document === "undefined",
|
|
34
|
+
nodes: null
|
|
35
|
+
};
|
|
36
|
+
function isServer() {
|
|
37
|
+
return state.server;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// src/lib/dom/hydration-state.ts
|
|
41
|
+
var hydration = {
|
|
42
|
+
active: false,
|
|
43
|
+
cursor: null,
|
|
44
|
+
parents: []
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// src/lib/flow/client-only.ts
|
|
48
|
+
function ClientOnly(props) {
|
|
49
|
+
if (isServer()) return props.fallback ?? null;
|
|
50
|
+
const hydrating = hydration.active;
|
|
51
|
+
const [ready, setReady] = (0, import_signal.createSignal)(!hydrating);
|
|
52
|
+
if (hydrating) queueMicrotask(() => setReady(true));
|
|
53
|
+
return (0, import_signal.createMemo)(() => ready() ? props.children : props.fallback ?? null, void 0, {
|
|
54
|
+
name: "client-only"
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
var NoSsr = ClientOnly;
|
|
@@ -3,7 +3,7 @@ export interface ClientOnlyProps {
|
|
|
3
3
|
/**
|
|
4
4
|
* Rendered instead of `children` on the server, and during hydration.
|
|
5
5
|
*
|
|
6
|
-
* When hydrating, this must produce the same markup the server emitted
|
|
6
|
+
* When hydrating, this must produce the same markup the server emitted,
|
|
7
7
|
* that is the whole point: the fallback is what both sides agree on.
|
|
8
8
|
*/
|
|
9
9
|
fallback?: ComponentChild;
|
|
@@ -13,13 +13,13 @@ export interface ClientOnlyProps {
|
|
|
13
13
|
/**
|
|
14
14
|
* Renders `children` only in the browser.
|
|
15
15
|
*
|
|
16
|
-
* For subtrees that cannot render on the server
|
|
16
|
+
* For subtrees that cannot render on the server, they read `window`,
|
|
17
17
|
* `localStorage`, a canvas, or produce time/locale-dependent output that would
|
|
18
18
|
* differ between the two passes and corrupt hydration.
|
|
19
19
|
*
|
|
20
20
|
* The swap is deferred to a microtask rather than done immediately, because
|
|
21
21
|
* rendering `children` mid-hydration would desync the hydration cursor from the
|
|
22
|
-
* server markup
|
|
22
|
+
* server markup, the exact bug this component exists to prevent. `hydrate()`
|
|
23
23
|
* runs synchronously and clears its flag in a `finally`, so a microtask is the
|
|
24
24
|
* first moment the pass is guaranteed to be over.
|
|
25
25
|
*
|
|
@@ -36,7 +36,7 @@ export interface ClientOnlyProps {
|
|
|
36
36
|
*/
|
|
37
37
|
export declare function ClientOnly(props: ClientOnlyProps): ComponentChild;
|
|
38
38
|
/**
|
|
39
|
-
* `NoSsr` is {@link ClientOnly}
|
|
39
|
+
* `NoSsr` is {@link ClientOnly}, the same component under the name used by
|
|
40
40
|
* other libraries, so the concept is findable either way.
|
|
41
41
|
*/
|
|
42
42
|
export declare const NoSsr: typeof ClientOnly;
|
|
@@ -4,13 +4,13 @@ import { hydration } from '../dom/hydration-state.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* Renders `children` only in the browser.
|
|
6
6
|
*
|
|
7
|
-
* For subtrees that cannot render on the server
|
|
7
|
+
* For subtrees that cannot render on the server, they read `window`,
|
|
8
8
|
* `localStorage`, a canvas, or produce time/locale-dependent output that would
|
|
9
9
|
* differ between the two passes and corrupt hydration.
|
|
10
10
|
*
|
|
11
11
|
* The swap is deferred to a microtask rather than done immediately, because
|
|
12
12
|
* rendering `children` mid-hydration would desync the hydration cursor from the
|
|
13
|
-
* server markup
|
|
13
|
+
* server markup, the exact bug this component exists to prevent. `hydrate()`
|
|
14
14
|
* runs synchronously and clears its flag in a `finally`, so a microtask is the
|
|
15
15
|
* first moment the pass is guaranteed to be over.
|
|
16
16
|
*
|
|
@@ -40,7 +40,7 @@ export function ClientOnly(props) {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
* `NoSsr` is {@link ClientOnly}
|
|
43
|
+
* `NoSsr` is {@link ClientOnly}, the same component under the name used by
|
|
44
44
|
* other libraries, so the concept is findable either way.
|
|
45
45
|
*/
|
|
46
46
|
export const NoSsr = ClientOnly;
|