@bleedingdev/tanstack-redact 0.2.2 → 0.3.2

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.
Files changed (118) hide show
  1. package/dist/bundler-core/resolution.d.ts +31 -0
  2. package/dist/bundler-core/resolution.js +80 -0
  3. package/dist/bundler-core/resolution.js.map +7 -0
  4. package/dist/bundler-core/selection.d.ts +89 -0
  5. package/dist/bundler-core/selection.js +103 -0
  6. package/dist/bundler-core/selection.js.map +7 -0
  7. package/dist/core/devtools.d.ts +1 -1
  8. package/dist/core/devtools.js +1 -0
  9. package/dist/core/devtools.js.map +2 -2
  10. package/dist/core/functions.js +1 -0
  11. package/dist/core/functions.js.map +2 -2
  12. package/dist/core/internal.d.ts +5 -4
  13. package/dist/core/internal.js +4 -3
  14. package/dist/core/internal.js.map +2 -2
  15. package/dist/core/types.d.ts +2 -2
  16. package/dist/core/types.js +1 -0
  17. package/dist/core/types.js.map +1 -1
  18. package/dist/dom/devtools.d.ts +5 -5
  19. package/dist/dom/devtools.js +1 -0
  20. package/dist/dom/devtools.js.map +2 -2
  21. package/dist/dom/dispatcher.d.ts +1 -1
  22. package/dist/dom/dispatcher.js +1 -0
  23. package/dist/dom/dispatcher.js.map +3 -3
  24. package/dist/dom/document-metadata.d.ts +1 -1
  25. package/dist/dom/document-metadata.js +3 -1
  26. package/dist/dom/document-metadata.js.map +2 -2
  27. package/dist/dom/dom.js +1 -1
  28. package/dist/dom/dom.js.map +2 -2
  29. package/dist/dom/features/class/full.js +25 -32
  30. package/dist/dom/features/class/full.js.map +2 -2
  31. package/dist/dom/features/class/stub.js +1 -0
  32. package/dist/dom/features/class/stub.js.map +2 -2
  33. package/dist/dom/features/hydration/full.d.ts +6 -6
  34. package/dist/dom/features/hydration/full.js +20 -29
  35. package/dist/dom/features/hydration/full.js.map +2 -2
  36. package/dist/dom/features/hydration/stub.d.ts +7 -2
  37. package/dist/dom/features/hydration/stub.js +1 -0
  38. package/dist/dom/features/hydration/stub.js.map +2 -2
  39. package/dist/dom/features/lazy/full.js +1 -0
  40. package/dist/dom/features/lazy/full.js.map +2 -2
  41. package/dist/dom/features/suspense/full.d.ts +4 -1
  42. package/dist/dom/features/suspense/full.js +22 -161
  43. package/dist/dom/features/suspense/full.js.map +2 -2
  44. package/dist/dom/features/suspense-hydration/full.d.ts +8 -0
  45. package/dist/dom/features/suspense-hydration/full.js +147 -0
  46. package/dist/dom/features/suspense-hydration/full.js.map +7 -0
  47. package/dist/dom/features/suspense-hydration/index.d.ts +1 -0
  48. package/dist/dom/features/suspense-hydration/index.js +2 -0
  49. package/dist/dom/features/suspense-hydration/index.js.map +7 -0
  50. package/dist/dom/features/suspense-hydration/stub.d.ts +2 -0
  51. package/dist/dom/features/suspense-hydration/stub.js +9 -0
  52. package/dist/dom/features/suspense-hydration/stub.js.map +7 -0
  53. package/dist/dom/features/suspense-runtime/stub.js +1 -0
  54. package/dist/dom/features/suspense-runtime/stub.js.map +2 -2
  55. package/dist/dom/profiling.d.ts +36 -0
  56. package/dist/dom/profiling.js +9 -0
  57. package/dist/dom/profiling.js.map +7 -0
  58. package/dist/dom/react-ids.js +1 -0
  59. package/dist/dom/react-ids.js.map +2 -2
  60. package/dist/dom/reconcile.d.ts +4 -5
  61. package/dist/dom/reconcile.js +102 -144
  62. package/dist/dom/reconcile.js.map +2 -2
  63. package/dist/dom/resources.js +1 -0
  64. package/dist/dom/resources.js.map +2 -2
  65. package/dist/dom/root-internal.d.ts +1 -1
  66. package/dist/dom/root-internal.js +4 -3
  67. package/dist/dom/root-internal.js.map +2 -2
  68. package/dist/dom/root.d.ts +2 -2
  69. package/dist/dom/root.js +1 -0
  70. package/dist/dom/root.js.map +2 -2
  71. package/dist/dom/synthetic-event.js.map +2 -2
  72. package/dist/dom/transitions.d.ts +1 -1
  73. package/dist/dom/transitions.js +1 -0
  74. package/dist/dom/transitions.js.map +2 -2
  75. package/dist/react/action-scope.d.ts +1 -1
  76. package/dist/react/action-scope.js +1 -0
  77. package/dist/react/action-scope.js.map +2 -2
  78. package/dist/rspack/index.d.ts +2 -0
  79. package/dist/rspack/index.js +6 -0
  80. package/dist/rspack/index.js.map +7 -0
  81. package/dist/server/bootstrap-script.js +1 -0
  82. package/dist/server/bootstrap-script.js.map +2 -2
  83. package/dist/server/dispatcher.js +11 -20
  84. package/dist/server/dispatcher.js.map +2 -2
  85. package/dist/server/insertion-context.js +9 -16
  86. package/dist/server/insertion-context.js.map +7 -0
  87. package/dist/server/stream-ids.js +1 -0
  88. package/dist/server/stream-ids.js.map +7 -0
  89. package/dist/server/stream.d.ts +1 -2
  90. package/dist/server/stream.js +106 -122
  91. package/dist/server/stream.js.map +2 -2
  92. package/dist/server/walk.js +69 -72
  93. package/dist/server/walk.js.map +3 -3
  94. package/dist/vite/index.d.ts +5 -99
  95. package/dist/vite/index.js +56 -179
  96. package/dist/vite/index.js.map +2 -2
  97. package/dist/webpack/index.d.ts +46 -0
  98. package/dist/webpack/index.js +102 -0
  99. package/dist/webpack/index.js.map +7 -0
  100. package/dist/webpack/react18-loader.cjs +25 -0
  101. package/package.json +17 -3
  102. package/src/bundler-core/resolution.ts +131 -0
  103. package/src/bundler-core/selection.ts +192 -0
  104. package/src/core/internal.ts +2 -1
  105. package/src/core/types.ts +3 -2
  106. package/src/dom/dom.ts +1 -1
  107. package/src/dom/features/class/full.ts +26 -34
  108. package/src/dom/features/suspense/full.ts +7 -165
  109. package/src/dom/features/suspense-hydration/full.ts +166 -0
  110. package/src/dom/features/suspense-hydration/index.ts +1 -0
  111. package/src/dom/features/suspense-hydration/stub.ts +2 -0
  112. package/src/dom/profiling.ts +6 -0
  113. package/src/dom/reconcile.ts +16 -6
  114. package/src/rspack/index.ts +2 -0
  115. package/src/server/stream.ts +15 -14
  116. package/src/vite/index.ts +55 -317
  117. package/src/webpack/index.ts +108 -0
  118. package/src/webpack/react18-loader.cjs +25 -0
@@ -0,0 +1,31 @@
1
+ import type { RedactPreset, RedactFeatures } from "./selection.js";
2
+ export interface RedactOptions {
3
+ /** Skip aliasing specific specifiers, e.g. if a consumer wants real React somewhere. */
4
+ skip?: ReadonlyArray<string>;
5
+ /**
6
+ * Override package resolution root. Defaults to the build config root. Useful
7
+ * for monorepos where the plugin lives in a different workspace than the
8
+ * consumer app.
9
+ */
10
+ resolveFrom?: string;
11
+ /**
12
+ * Explicit package roots, bypassing node_modules lookup. Keys are package
13
+ * names (e.g. `@tanstack/redact`), values are absolute paths to the package
14
+ * directory. Handy for cross-workspace testing / bring-your-own-build setups.
15
+ */
16
+ packageRoots?: Record<string, string>;
17
+ /**
18
+ * Starting point for feature selection. `'full'` (default) turns every
19
+ * stable feature on, with view transitions off. Disable individual features via
20
+ * `features`. `'nano'` turns everything off, opt in to what you need.
21
+ */
22
+ preset?: RedactPreset;
23
+ /**
24
+ * Per-feature overrides merged on top of the preset's defaults. Enables
25
+ * fine-grained "preset minus X" or "preset plus Y" configurations.
26
+ */
27
+ features?: RedactFeatures;
28
+ }
29
+ export declare function findPackageDir(pkg: string, fromDir: string): string | null;
30
+ export declare function resolvePackageDir(pkg: string, fromDir: string, packageRoots: Record<string, string>, preferFrom?: boolean): string | null;
31
+ export declare function resolveSpecifier(specifier: string, fromDir: string, packageRoots: Record<string, string>, preferFrom?: boolean): string | null;
@@ -0,0 +1,80 @@
1
+ import { existsSync, readFileSync, realpathSync } from "node:fs";
2
+ import { dirname, resolve as resolvePath } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ function splitSpecifier(specifier) {
5
+ if (specifier.startsWith("@")) {
6
+ const slash1 = specifier.indexOf("/");
7
+ const slash2 = specifier.indexOf("/", slash1 + 1);
8
+ if (slash2 < 0)
9
+ return { pkg: specifier, sub: "" };
10
+ return { pkg: specifier.slice(0, slash2), sub: specifier.slice(slash2 + 1) };
11
+ }
12
+ const slash = specifier.indexOf("/");
13
+ if (slash < 0)
14
+ return { pkg: specifier, sub: "" };
15
+ return { pkg: specifier.slice(0, slash), sub: specifier.slice(slash + 1) };
16
+ }
17
+ function findPackageDir(pkg, fromDir) {
18
+ let dir = resolvePath(fromDir);
19
+ while (true) {
20
+ const candidate = resolvePath(dir, "node_modules", pkg);
21
+ if (existsSync(resolvePath(candidate, "package.json")))
22
+ return candidate;
23
+ const parent = dirname(dir);
24
+ if (parent === dir)
25
+ return null;
26
+ dir = parent;
27
+ }
28
+ }
29
+ function resolveExport(packageDir, sub) {
30
+ const pkgJsonPath = resolvePath(packageDir, "package.json");
31
+ let pkg;
32
+ try {
33
+ pkg = JSON.parse(readFileSync(pkgJsonPath, "utf8"));
34
+ } catch {
35
+ return null;
36
+ }
37
+ const key = sub ? "./" + sub : ".";
38
+ const exp = pkg.exports?.[key];
39
+ const pick = (v) => {
40
+ if (typeof v === "string")
41
+ return v;
42
+ if (v && typeof v === "object") {
43
+ return pick(v.import) ?? pick(v.module) ?? pick(v.source) ?? pick(v.default);
44
+ }
45
+ return null;
46
+ };
47
+ const target = pick(exp);
48
+ if (target)
49
+ return resolvePath(packageDir, target);
50
+ if (!sub) {
51
+ const main = pkg.module ?? pkg.main;
52
+ if (typeof main === "string")
53
+ return resolvePath(packageDir, main);
54
+ }
55
+ return null;
56
+ }
57
+ const pluginDir = dirname(fileURLToPath(import.meta.url));
58
+ function resolvePackageDir(pkg, fromDir, packageRoots, preferFrom = false) {
59
+ return packageRoots[pkg] ?? (preferFrom ? findPackageDir(pkg, fromDir) ?? findPackageDir(pkg, pluginDir) : findPackageDir(pkg, pluginDir) ?? findPackageDir(pkg, fromDir));
60
+ }
61
+ function resolveSpecifier(specifier, fromDir, packageRoots, preferFrom = false) {
62
+ const { pkg, sub } = splitSpecifier(specifier);
63
+ const packageDir = resolvePackageDir(pkg, fromDir, packageRoots, preferFrom);
64
+ if (!packageDir)
65
+ return null;
66
+ const target = resolveExport(packageDir, sub);
67
+ if (!target)
68
+ return null;
69
+ try {
70
+ return realpathSync(target);
71
+ } catch {
72
+ return target;
73
+ }
74
+ }
75
+ export {
76
+ findPackageDir,
77
+ resolvePackageDir,
78
+ resolveSpecifier
79
+ };
80
+ //# sourceMappingURL=resolution.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/bundler-core/resolution.ts"],
4
+ "sourcesContent": ["import { existsSync, readFileSync, realpathSync } from 'node:fs'\nimport { dirname, resolve as resolvePath } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport type { RedactPreset, RedactFeatures } from './selection'\n\nexport interface RedactOptions {\n /** Skip aliasing specific specifiers, e.g. if a consumer wants real React somewhere. */\n skip?: ReadonlyArray<string>\n /**\n * Override package resolution root. Defaults to the build config root. Useful\n * for monorepos where the plugin lives in a different workspace than the\n * consumer app.\n */\n resolveFrom?: string\n /**\n * Explicit package roots, bypassing node_modules lookup. Keys are package\n * names (e.g. `@tanstack/redact`), values are absolute paths to the package\n * directory. Handy for cross-workspace testing / bring-your-own-build setups.\n */\n packageRoots?: Record<string, string>\n /**\n * Starting point for feature selection. `'full'` (default) turns every\n * stable feature on, with view transitions off. Disable individual features via\n * `features`. `'nano'` turns everything off, opt in to what you need.\n */\n preset?: RedactPreset\n /**\n * Per-feature overrides merged on top of the preset's defaults. Enables\n * fine-grained \"preset minus X\" or \"preset plus Y\" configurations.\n */\n features?: RedactFeatures\n}\n\nfunction splitSpecifier(specifier: string): { pkg: string; sub: string } {\n if (specifier.startsWith('@')) {\n const slash1 = specifier.indexOf('/')\n const slash2 = specifier.indexOf('/', slash1 + 1)\n if (slash2 < 0) return { pkg: specifier, sub: '' }\n return { pkg: specifier.slice(0, slash2), sub: specifier.slice(slash2 + 1) }\n }\n const slash = specifier.indexOf('/')\n if (slash < 0) return { pkg: specifier, sub: '' }\n return { pkg: specifier.slice(0, slash), sub: specifier.slice(slash + 1) }\n}\n\nexport function findPackageDir(pkg: string, fromDir: string): string | null {\n let dir = resolvePath(fromDir)\n while (true) {\n const candidate = resolvePath(dir, 'node_modules', pkg)\n if (existsSync(resolvePath(candidate, 'package.json'))) return candidate\n const parent = dirname(dir)\n if (parent === dir) return null\n dir = parent\n }\n}\n\nfunction resolveExport(packageDir: string, sub: string): string | null {\n const pkgJsonPath = resolvePath(packageDir, 'package.json')\n let pkg: any\n try {\n pkg = JSON.parse(readFileSync(pkgJsonPath, 'utf8'))\n } catch {\n return null\n }\n const key = sub ? './' + sub : '.'\n const exp = pkg.exports?.[key]\n // Prefer published JavaScript over TypeScript sources. Dist preserves one\n // file per module, so subpath imports share state and feature boundaries.\n const pick = (v: any): string | null => {\n if (typeof v === 'string') return v\n if (v && typeof v === 'object') {\n return pick(v.import) ?? pick(v.module) ?? pick(v.source) ?? pick(v.default)\n }\n return null\n }\n const target = pick(exp)\n if (target) return resolvePath(packageDir, target)\n if (!sub) {\n const main = pkg.module ?? pkg.main\n if (typeof main === 'string') return resolvePath(packageDir, main)\n }\n return null\n}\n\n// When installed from npm, `@tanstack/redact` is declared as a `dependency`\n// of consumer apps. Under pnpm's strict mode it ends up nested under the\n// plugin's own `.pnpm/@tanstack+redact@.../node_modules/` rather than\n// hoisted to the consumer's root, so a `findPackageDir` walk starting at\n// the Vite project root won't always find it. Search from the plugin's own\n// directory first (which walks into its nested node_modules), then fall\n// back to the consumer root for hoisted installs.\nconst pluginDir = dirname(fileURLToPath(import.meta.url))\n\nexport function resolvePackageDir(\n pkg: string,\n fromDir: string,\n packageRoots: Record<string, string>,\n preferFrom = false,\n): string | null {\n return packageRoots[pkg] ?? (preferFrom\n ? findPackageDir(pkg, fromDir) ?? findPackageDir(pkg, pluginDir)\n : findPackageDir(pkg, pluginDir) ?? findPackageDir(pkg, fromDir))\n}\n\nexport function resolveSpecifier(\n specifier: string,\n fromDir: string,\n packageRoots: Record<string, string>,\n preferFrom = false,\n): string | null {\n const { pkg, sub } = splitSpecifier(specifier)\n const packageDir = resolvePackageDir(pkg, fromDir, packageRoots, preferFrom)\n if (!packageDir) return null\n const target = resolveExport(packageDir, sub)\n if (!target) return null\n // Canonicalize through pnpm symlinks. Under strict pnpm, the package may\n // live nested under `.pnpm/@tanstack+redact@.../node_modules/*`, but each\n // of those is itself a symlink to the flat `.pnpm/@tanstack+redact@.../`\n // entry. Vite's `fetchModule` (used by TanStack Start's server-fn\n // compiler) follows the realpath, so the id seen by the capture-transform\n // differs from the nested id we'd return. That leaves the compiler's\n // moduleCache keyed on the realpath while `getModuleInfo` looks up the\n // nested path → miss → \"could not load module info\". Returning the\n // canonical realpath here keeps the two sides in agreement.\n try {\n return realpathSync(target)\n } catch {\n return target\n }\n}\n\n"],
5
+ "mappings": "AAAA,SAAS,YAAY,cAAc,oBAAoB;AACvD,SAAS,SAAS,WAAW,mBAAmB;AAChD,SAAS,qBAAqB;AA+B9B,SAAS,eAAe,WAAiB;AACvC,MAAI,UAAU,WAAW,GAAG,GAAG;AAC7B,UAAM,SAAS,UAAU,QAAQ,GAAG;AACpC,UAAM,SAAS,UAAU,QAAQ,KAAK,SAAS,CAAC;AAChD,QAAI,SAAS;AAAG,aAAO,EAAE,KAAK,WAAW,KAAK,GAAE;AAChD,WAAO,EAAE,KAAK,UAAU,MAAM,GAAG,MAAM,GAAG,KAAK,UAAU,MAAM,SAAS,CAAC,EAAC;EAC5E;AACA,QAAM,QAAQ,UAAU,QAAQ,GAAG;AACnC,MAAI,QAAQ;AAAG,WAAO,EAAE,KAAK,WAAW,KAAK,GAAE;AAC/C,SAAO,EAAE,KAAK,UAAU,MAAM,GAAG,KAAK,GAAG,KAAK,UAAU,MAAM,QAAQ,CAAC,EAAC;AAC1E;AAEM,SAAU,eAAe,KAAa,SAAe;AACzD,MAAI,MAAM,YAAY,OAAO;AAC7B,SAAO,MAAM;AACX,UAAM,YAAY,YAAY,KAAK,gBAAgB,GAAG;AACtD,QAAI,WAAW,YAAY,WAAW,cAAc,CAAC;AAAG,aAAO;AAC/D,UAAM,SAAS,QAAQ,GAAG;AAC1B,QAAI,WAAW;AAAK,aAAO;AAC3B,UAAM;EACR;AACF;AAEA,SAAS,cAAc,YAAoB,KAAW;AACpD,QAAM,cAAc,YAAY,YAAY,cAAc;AAC1D,MAAI;AACJ,MAAI;AACF,UAAM,KAAK,MAAM,aAAa,aAAa,MAAM,CAAC;EACpD,QAAQ;AACN,WAAO;EACT;AACA,QAAM,MAAM,MAAM,OAAO,MAAM;AAC/B,QAAM,MAAM,IAAI,UAAU,GAAG;AAG7B,QAAM,OAAO,CAAC,MAAyB;AACrC,QAAI,OAAO,MAAM;AAAU,aAAO;AAClC,QAAI,KAAK,OAAO,MAAM,UAAU;AAC9B,aAAO,KAAK,EAAE,MAAM,KAAK,KAAK,EAAE,MAAM,KAAK,KAAK,EAAE,MAAM,KAAK,KAAK,EAAE,OAAO;IAC7E;AACA,WAAO;EACT;AACA,QAAM,SAAS,KAAK,GAAG;AACvB,MAAI;AAAQ,WAAO,YAAY,YAAY,MAAM;AACjD,MAAI,CAAC,KAAK;AACR,UAAM,OAAO,IAAI,UAAU,IAAI;AAC/B,QAAI,OAAO,SAAS;AAAU,aAAO,YAAY,YAAY,IAAI;EACnE;AACA,SAAO;AACT;AASA,MAAM,YAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AAElD,SAAU,kBACd,KACA,SACA,cACA,aAAa,OAAK;AAElB,SAAO,aAAa,GAAG,MAAM,aACzB,eAAe,KAAK,OAAO,KAAK,eAAe,KAAK,SAAS,IAC7D,eAAe,KAAK,SAAS,KAAK,eAAe,KAAK,OAAO;AACnE;AAEM,SAAU,iBACd,WACA,SACA,cACA,aAAa,OAAK;AAElB,QAAM,EAAE,KAAK,IAAG,IAAK,eAAe,SAAS;AAC7C,QAAM,aAAa,kBAAkB,KAAK,SAAS,cAAc,UAAU;AAC3E,MAAI,CAAC;AAAY,WAAO;AACxB,QAAM,SAAS,cAAc,YAAY,GAAG;AAC5C,MAAI,CAAC;AAAQ,WAAO;AAUpB,MAAI;AACF,WAAO,aAAa,MAAM;EAC5B,QAAQ;AACN,WAAO;EACT;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,89 @@
1
+ export type RedactPreset = 'nano' | 'full';
2
+ /**
3
+ * Opt-in feature set. Each flag toggles whether the feature's real
4
+ * implementation ships (`true`) or is swapped with a stub module that
5
+ * degrades gracefully (`false`). Missing keys fall back to the preset's
6
+ * default. Adding a feature to this interface propagates to consumer
7
+ * configs as autocompleted options.
8
+ */
9
+ export interface RedactFeatures {
10
+ /** Activity visibility, retained state and disconnected effects. */
11
+ activity?: boolean;
12
+ /** DOM instances, events, focus, layout and observers for Fragment refs. */
13
+ fragmentRefs?: boolean;
14
+ /** Experimental native ViewTransition animations. Opt-in until snapshot parity is complete. */
15
+ viewTransitions?: boolean;
16
+ /**
17
+ * `createPortal`. When `false`, portal elements render in place as a
18
+ * Fragment (the `container` prop is ignored). `renderPortal` and its
19
+ * deps are stripped from the bundle.
20
+ */
21
+ portal?: boolean;
22
+ /**
23
+ * `createContext` / `useContext` / `<Provider>` / `<Consumer>`. When
24
+ * `false`, Providers render as Fragments (value never propagates),
25
+ * Consumers invoke their function-children with the context's default
26
+ * value, and `useContext` returns the default. Provider-walk logic and
27
+ * `renderProvider` are stripped.
28
+ */
29
+ context?: boolean;
30
+ /**
31
+ * `<Suspense>` boundaries + streaming hydration. When `false`, Suspense
32
+ * elements render as Fragments (children mount inline, `fallback` is
33
+ * ignored). Thrown thenables still schedule a re-render on settle, so
34
+ * eventual consistency works, just no fallback UI during the pending
35
+ * window. Boundary-handler stack and hydration integration are stripped.
36
+ */
37
+ suspense?: boolean;
38
+ /**
39
+ * `React.memo`. When `false`, memoized components still render but without
40
+ * the prop-equality gate, every parent rerender passes through.
41
+ * `shallowEqual` and the force-rerender bypass are stripped.
42
+ */
43
+ memo?: boolean;
44
+ /**
45
+ * `React.forwardRef`. When `false`, forwardRef components still render but
46
+ * the ref prop isn't forwarded to the inner function. React 19+ treats
47
+ * refs as normal props on function components anyway, so most apps can
48
+ * drop this. The dispatcher save/restore machinery is stripped.
49
+ */
50
+ forwardRef?: boolean;
51
+ /**
52
+ * `React.lazy`. When `false`, lazy elements still resolve if their payload
53
+ * is already available synchronously (e.g. pre-awaited RSC Flight); async
54
+ * resolution throws a clear error. The hydration-deferred-reveal path and
55
+ * Suspense coordination are stripped.
56
+ */
57
+ lazy?: boolean;
58
+ /**
59
+ * Class components (`extends Component`). When `false`, class components
60
+ * still render but only honor the core contract: constructor + `render()`
61
+ * + `setState`. Dropped: `contextType`, `getDerivedStateFromProps`,
62
+ * `shouldComponentUpdate`, `componentDidMount`/`Update`/`WillUnmount`,
63
+ * `getDerivedStateFromError`/`componentDidCatch` (error boundaries).
64
+ */
65
+ classComponents?: boolean;
66
+ /**
67
+ * SSR hydration (`hydrateRoot`). When `false`, `hydrateRoot` throws
68
+ * (use `createRoot` for SPAs). The HydrationCursor / DOM adoption /
69
+ * streaming-boundary coordination / event-replay / scroll-guard
70
+ * machinery is stripped, the biggest single chunk of reducible code.
71
+ */
72
+ hydration?: boolean;
73
+ }
74
+ export interface ResolvedFeatures {
75
+ activity: boolean;
76
+ fragmentRefs: boolean;
77
+ viewTransitions: boolean;
78
+ portal: boolean;
79
+ context: boolean;
80
+ suspense: boolean;
81
+ memo: boolean;
82
+ forwardRef: boolean;
83
+ lazy: boolean;
84
+ classComponents: boolean;
85
+ hydration: boolean;
86
+ }
87
+ export declare function resolveFeatures(preset: RedactPreset, overrides: RedactFeatures): ResolvedFeatures;
88
+ export declare const ALIASES: Record<string, string>;
89
+ export declare function isOwnedRuntimeFeature(id: string, packageRoot: string): boolean;
@@ -0,0 +1,103 @@
1
+ const PRESET_DEFAULTS = {
2
+ // Opt-in: everything off. Turn individual features on via `features`.
3
+ nano: {
4
+ activity: false,
5
+ fragmentRefs: false,
6
+ viewTransitions: false,
7
+ portal: false,
8
+ context: false,
9
+ suspense: false,
10
+ memo: false,
11
+ forwardRef: false,
12
+ lazy: false,
13
+ classComponents: false,
14
+ hydration: false
15
+ },
16
+ // Opt-out: everything on (drop-in React parity). Turn features off via `features`.
17
+ full: {
18
+ activity: true,
19
+ fragmentRefs: true,
20
+ viewTransitions: false,
21
+ portal: true,
22
+ context: true,
23
+ suspense: true,
24
+ memo: true,
25
+ forwardRef: true,
26
+ lazy: true,
27
+ classComponents: true,
28
+ hydration: true
29
+ }
30
+ };
31
+ function resolveFeatures(preset, overrides) {
32
+ const p = PRESET_DEFAULTS[preset];
33
+ return {
34
+ activity: overrides.activity ?? p.activity,
35
+ fragmentRefs: overrides.fragmentRefs ?? p.fragmentRefs,
36
+ viewTransitions: overrides.viewTransitions ?? p.viewTransitions,
37
+ portal: overrides.portal ?? p.portal,
38
+ context: overrides.context ?? p.context,
39
+ suspense: overrides.suspense ?? p.suspense,
40
+ memo: overrides.memo ?? p.memo,
41
+ forwardRef: overrides.forwardRef ?? p.forwardRef,
42
+ lazy: overrides.lazy ?? p.lazy,
43
+ classComponents: overrides.classComponents ?? p.classComponents,
44
+ hydration: overrides.hydration ?? p.hydration
45
+ };
46
+ }
47
+ const ALIASES = {
48
+ // ---- most-specific first ----
49
+ "use-sync-external-store/shim/with-selector": "@tanstack/redact",
50
+ "use-sync-external-store/shim/with-selector.js": "@tanstack/redact",
51
+ "use-sync-external-store/with-selector": "@tanstack/redact",
52
+ "use-sync-external-store/with-selector.js": "@tanstack/redact",
53
+ // Explicit file subpaths (react-aria imports `shim/index.js`). Without these,
54
+ // dev resolves the raw CJS shim and its named ESM import fails.
55
+ "use-sync-external-store/shim/index.js": "@tanstack/redact",
56
+ "use-sync-external-store/index.js": "@tanstack/redact",
57
+ "use-sync-external-store/shim": "@tanstack/redact",
58
+ "use-sync-external-store": "@tanstack/redact",
59
+ // React drop-in shim targets. Subpaths first.
60
+ "react/jsx-runtime": "@tanstack/redact/jsx-runtime",
61
+ "react/jsx-dev-runtime": "@tanstack/redact/jsx-dev-runtime",
62
+ "react/compiler-runtime": "@tanstack/redact/compiler-runtime",
63
+ "react-dom/profiling": "@tanstack/redact/dom-profiling",
64
+ "react-dom/client": "@tanstack/redact/dom-client",
65
+ "react-dom/server.browser": "@tanstack/redact/server",
66
+ "react-dom/server.bun": "@tanstack/redact/server",
67
+ "react-dom/server.edge": "@tanstack/redact/server",
68
+ "react-dom/server.node": "@tanstack/redact/server",
69
+ "react-dom/static.edge": "@tanstack/redact/server",
70
+ "react-dom/server": "@tanstack/redact/server",
71
+ "react-dom/test-utils": "@tanstack/redact/dom-test-utils",
72
+ "react-dom": "@tanstack/redact/dom",
73
+ react: "@tanstack/redact",
74
+ scheduler: "@tanstack/redact/scheduler",
75
+ // Self-aliases so Vite resolves `@tanstack/redact/*` imports to the same
76
+ // canonical file path no matter where they originate (worker bundle vs
77
+ // deps_ssr pre-bundle vs source). Without these, Cloudflare's
78
+ // `noExternal: true` worker config inlines one copy while Vite's
79
+ // optimizeDeps pre-bundles another, ending up with two separate
80
+ // ReactSharedInternals instances and a null dispatcher in user hooks.
81
+ // Subpaths first here too.
82
+ "@tanstack/redact/jsx-runtime": "@tanstack/redact/jsx-runtime",
83
+ "@tanstack/redact/jsx-dev-runtime": "@tanstack/redact/jsx-dev-runtime",
84
+ "@tanstack/redact/compiler-runtime": "@tanstack/redact/compiler-runtime",
85
+ "@tanstack/redact/dom-profiling": "@tanstack/redact/dom-profiling",
86
+ "@tanstack/redact/dom-client": "@tanstack/redact/dom-client",
87
+ "@tanstack/redact/dom-test-utils": "@tanstack/redact/dom-test-utils",
88
+ "@tanstack/redact/server": "@tanstack/redact/server",
89
+ "@tanstack/redact/scheduler": "@tanstack/redact/scheduler",
90
+ "@tanstack/redact/dom": "@tanstack/redact/dom",
91
+ "@tanstack/redact": "@tanstack/redact"
92
+ };
93
+ function isOwnedRuntimeFeature(id, packageRoot) {
94
+ const path = id.replaceAll("\\", "/");
95
+ const root = packageRoot.replaceAll("\\", "/").replace(/\/$/, "");
96
+ return path.startsWith(root + "/src/dom/features/") || path.startsWith(root + "/dist/dom/features/");
97
+ }
98
+ export {
99
+ ALIASES,
100
+ isOwnedRuntimeFeature,
101
+ resolveFeatures
102
+ };
103
+ //# sourceMappingURL=selection.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/bundler-core/selection.ts"],
4
+ "sourcesContent": ["export type RedactPreset = 'nano' | 'full'\n\n/**\n * Opt-in feature set. Each flag toggles whether the feature's real\n * implementation ships (`true`) or is swapped with a stub module that\n * degrades gracefully (`false`). Missing keys fall back to the preset's\n * default. Adding a feature to this interface propagates to consumer\n * configs as autocompleted options.\n */\nexport interface RedactFeatures {\n /** Activity visibility, retained state and disconnected effects. */\n activity?: boolean\n /** DOM instances, events, focus, layout and observers for Fragment refs. */\n fragmentRefs?: boolean\n /** Experimental native ViewTransition animations. Opt-in until snapshot parity is complete. */\n viewTransitions?: boolean\n /**\n * `createPortal`. When `false`, portal elements render in place as a\n * Fragment (the `container` prop is ignored). `renderPortal` and its\n * deps are stripped from the bundle.\n */\n portal?: boolean\n /**\n * `createContext` / `useContext` / `<Provider>` / `<Consumer>`. When\n * `false`, Providers render as Fragments (value never propagates),\n * Consumers invoke their function-children with the context's default\n * value, and `useContext` returns the default. Provider-walk logic and\n * `renderProvider` are stripped.\n */\n context?: boolean\n /**\n * `<Suspense>` boundaries + streaming hydration. When `false`, Suspense\n * elements render as Fragments (children mount inline, `fallback` is\n * ignored). Thrown thenables still schedule a re-render on settle, so\n * eventual consistency works, just no fallback UI during the pending\n * window. Boundary-handler stack and hydration integration are stripped.\n */\n suspense?: boolean\n /**\n * `React.memo`. When `false`, memoized components still render but without\n * the prop-equality gate, every parent rerender passes through.\n * `shallowEqual` and the force-rerender bypass are stripped.\n */\n memo?: boolean\n /**\n * `React.forwardRef`. When `false`, forwardRef components still render but\n * the ref prop isn't forwarded to the inner function. React 19+ treats\n * refs as normal props on function components anyway, so most apps can\n * drop this. The dispatcher save/restore machinery is stripped.\n */\n forwardRef?: boolean\n /**\n * `React.lazy`. When `false`, lazy elements still resolve if their payload\n * is already available synchronously (e.g. pre-awaited RSC Flight); async\n * resolution throws a clear error. The hydration-deferred-reveal path and\n * Suspense coordination are stripped.\n */\n lazy?: boolean\n /**\n * Class components (`extends Component`). When `false`, class components\n * still render but only honor the core contract: constructor + `render()`\n * + `setState`. Dropped: `contextType`, `getDerivedStateFromProps`,\n * `shouldComponentUpdate`, `componentDidMount`/`Update`/`WillUnmount`,\n * `getDerivedStateFromError`/`componentDidCatch` (error boundaries).\n */\n classComponents?: boolean\n /**\n * SSR hydration (`hydrateRoot`). When `false`, `hydrateRoot` throws\n * (use `createRoot` for SPAs). The HydrationCursor / DOM adoption /\n * streaming-boundary coordination / event-replay / scroll-guard\n * machinery is stripped, the biggest single chunk of reducible code.\n */\n hydration?: boolean\n}\n\nexport interface ResolvedFeatures {\n activity: boolean\n fragmentRefs: boolean\n viewTransitions: boolean\n portal: boolean\n context: boolean\n suspense: boolean\n memo: boolean\n forwardRef: boolean\n lazy: boolean\n classComponents: boolean\n hydration: boolean\n}\n\nconst PRESET_DEFAULTS: Record<RedactPreset, ResolvedFeatures> = {\n // Opt-in: everything off. Turn individual features on via `features`.\n nano: {\n activity: false, fragmentRefs: false, viewTransitions: false,\n portal: false, context: false, suspense: false, memo: false,\n forwardRef: false, lazy: false, classComponents: false, hydration: false,\n },\n // Opt-out: everything on (drop-in React parity). Turn features off via `features`.\n full: {\n activity: true, fragmentRefs: true, viewTransitions: false,\n portal: true, context: true, suspense: true, memo: true,\n forwardRef: true, lazy: true, classComponents: true, hydration: true,\n },\n}\n\nexport function resolveFeatures(\n preset: RedactPreset,\n overrides: RedactFeatures,\n): ResolvedFeatures {\n const p = PRESET_DEFAULTS[preset]\n return {\n activity: overrides.activity ?? p.activity,\n fragmentRefs: overrides.fragmentRefs ?? p.fragmentRefs,\n viewTransitions: overrides.viewTransitions ?? p.viewTransitions,\n portal: overrides.portal ?? p.portal,\n context: overrides.context ?? p.context,\n suspense: overrides.suspense ?? p.suspense,\n memo: overrides.memo ?? p.memo,\n forwardRef: overrides.forwardRef ?? p.forwardRef,\n lazy: overrides.lazy ?? p.lazy,\n classComponents: overrides.classComponents ?? p.classComponents,\n hydration: overrides.hydration ?? p.hydration,\n }\n}\n\n// Alias map. ORDER MATTERS, Vite's alias matcher uses first-match against\n// prefix, so more-specific specifiers MUST come before less-specific ones.\n// Without this, `react-dom/server` would prefix-match `react-dom` first and\n// resolve to `@tanstack/redact/dom/server` (wrong) instead of\n// `@tanstack/redact/server`.\n//\n// `use-sync-external-store` aliases are here because its CJS-only React 17\n// compat shim does `var React = require('react')`. That survives Vite's\n// pre-bundling intact and explodes in Cloudflare Workers (no `require`).\n// Modern React has `useSyncExternalStore` built-in, and `@tanstack/redact`\n// additionally exports `useSyncExternalStoreWithSelector` so this alias\n// is safe everywhere.\nexport const ALIASES: Record<string, string> = {\n // ---- most-specific first ----\n 'use-sync-external-store/shim/with-selector': '@tanstack/redact',\n 'use-sync-external-store/shim/with-selector.js': '@tanstack/redact',\n 'use-sync-external-store/with-selector': '@tanstack/redact',\n 'use-sync-external-store/with-selector.js': '@tanstack/redact',\n // Explicit file subpaths (react-aria imports `shim/index.js`). Without these,\n // dev resolves the raw CJS shim and its named ESM import fails.\n 'use-sync-external-store/shim/index.js': '@tanstack/redact',\n 'use-sync-external-store/index.js': '@tanstack/redact',\n 'use-sync-external-store/shim': '@tanstack/redact',\n 'use-sync-external-store': '@tanstack/redact',\n\n // React drop-in shim targets. Subpaths first.\n 'react/jsx-runtime': '@tanstack/redact/jsx-runtime',\n 'react/jsx-dev-runtime': '@tanstack/redact/jsx-dev-runtime',\n 'react/compiler-runtime': '@tanstack/redact/compiler-runtime',\n 'react-dom/profiling': '@tanstack/redact/dom-profiling',\n 'react-dom/client': '@tanstack/redact/dom-client',\n 'react-dom/server.browser': '@tanstack/redact/server',\n 'react-dom/server.bun': '@tanstack/redact/server',\n 'react-dom/server.edge': '@tanstack/redact/server',\n 'react-dom/server.node': '@tanstack/redact/server',\n 'react-dom/static.edge': '@tanstack/redact/server',\n 'react-dom/server': '@tanstack/redact/server',\n 'react-dom/test-utils': '@tanstack/redact/dom-test-utils',\n 'react-dom': '@tanstack/redact/dom',\n react: '@tanstack/redact',\n scheduler: '@tanstack/redact/scheduler',\n\n // Self-aliases so Vite resolves `@tanstack/redact/*` imports to the same\n // canonical file path no matter where they originate (worker bundle vs\n // deps_ssr pre-bundle vs source). Without these, Cloudflare's\n // `noExternal: true` worker config inlines one copy while Vite's\n // optimizeDeps pre-bundles another, ending up with two separate\n // ReactSharedInternals instances and a null dispatcher in user hooks.\n // Subpaths first here too.\n '@tanstack/redact/jsx-runtime': '@tanstack/redact/jsx-runtime',\n '@tanstack/redact/jsx-dev-runtime': '@tanstack/redact/jsx-dev-runtime',\n '@tanstack/redact/compiler-runtime': '@tanstack/redact/compiler-runtime',\n '@tanstack/redact/dom-profiling': '@tanstack/redact/dom-profiling',\n '@tanstack/redact/dom-client': '@tanstack/redact/dom-client',\n '@tanstack/redact/dom-test-utils': '@tanstack/redact/dom-test-utils',\n '@tanstack/redact/server': '@tanstack/redact/server',\n '@tanstack/redact/scheduler': '@tanstack/redact/scheduler',\n '@tanstack/redact/dom': '@tanstack/redact/dom',\n '@tanstack/redact': '@tanstack/redact',\n}\n\n// The caller canonicalizes filesystem paths before making this pure ownership decision.\nexport function isOwnedRuntimeFeature(id: string, packageRoot: string): boolean {\n const path = id.replaceAll('\\\\', '/')\n const root = packageRoot.replaceAll('\\\\', '/').replace(/\\/$/, '')\n return path.startsWith(root + '/src/dom/features/') ||\n path.startsWith(root + '/dist/dom/features/')\n}\n"],
5
+ "mappings": "AAyFA,MAAM,kBAA0D;;EAE9D,MAAM;IACJ,UAAU;IAAO,cAAc;IAAO,iBAAiB;IACvD,QAAQ;IAAO,SAAS;IAAO,UAAU;IAAO,MAAM;IACtD,YAAY;IAAO,MAAM;IAAO,iBAAiB;IAAO,WAAW;;;EAGrE,MAAM;IACJ,UAAU;IAAM,cAAc;IAAM,iBAAiB;IACrD,QAAQ;IAAM,SAAS;IAAM,UAAU;IAAM,MAAM;IACnD,YAAY;IAAM,MAAM;IAAM,iBAAiB;IAAM,WAAW;;;AAI9D,SAAU,gBACd,QACA,WAAyB;AAEzB,QAAM,IAAI,gBAAgB,MAAM;AAChC,SAAO;IACL,UAAU,UAAU,YAAY,EAAE;IAClC,cAAc,UAAU,gBAAgB,EAAE;IAC1C,iBAAiB,UAAU,mBAAmB,EAAE;IAChD,QAAQ,UAAU,UAAU,EAAE;IAC9B,SAAS,UAAU,WAAW,EAAE;IAChC,UAAU,UAAU,YAAY,EAAE;IAClC,MAAM,UAAU,QAAQ,EAAE;IAC1B,YAAY,UAAU,cAAc,EAAE;IACtC,MAAM,UAAU,QAAQ,EAAE;IAC1B,iBAAiB,UAAU,mBAAmB,EAAE;IAChD,WAAW,UAAU,aAAa,EAAE;;AAExC;AAcO,MAAM,UAAkC;;EAE7C,8CAA8C;EAC9C,iDAAiD;EACjD,yCAAyC;EACzC,4CAA4C;;;EAG5C,yCAAyC;EACzC,oCAAoC;EACpC,gCAAgC;EAChC,2BAA2B;;EAG3B,qBAAqB;EACrB,yBAAyB;EACzB,0BAA0B;EAC1B,uBAAuB;EACvB,oBAAoB;EACpB,4BAA4B;EAC5B,wBAAwB;EACxB,yBAAyB;EACzB,yBAAyB;EACzB,yBAAyB;EACzB,oBAAoB;EACpB,wBAAwB;EACxB,aAAa;EACb,OAAO;EACP,WAAW;;;;;;;;EASX,gCAAgC;EAChC,oCAAoC;EACpC,qCAAqC;EACrC,kCAAkC;EAClC,+BAA+B;EAC/B,mCAAmC;EACnC,2BAA2B;EAC3B,8BAA8B;EAC9B,wBAAwB;EACxB,oBAAoB;;AAIhB,SAAU,sBAAsB,IAAY,aAAmB;AACnE,QAAM,OAAO,GAAG,WAAW,MAAM,GAAG;AACpC,QAAM,OAAO,YAAY,WAAW,MAAM,GAAG,EAAE,QAAQ,OAAO,EAAE;AAChE,SAAO,KAAK,WAAW,OAAO,oBAAoB,KAChD,KAAK,WAAW,OAAO,qBAAqB;AAChD;",
6
+ "names": []
7
+ }
@@ -1,4 +1,4 @@
1
- import type { Fiber, FiberRoot, ReactElement } from './index.js';
1
+ import type { Fiber, FiberRoot, ReactElement } from "./index.js";
2
2
  export declare const devToolsMetadata: {
3
3
  enabled: boolean;
4
4
  owner: Fiber | null;
@@ -68,3 +68,4 @@ export {
68
68
  rememberDevToolsElement,
69
69
  runWithOwnerStack
70
70
  };
71
+ //# sourceMappingURL=devtools.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/core/devtools.ts"],
4
- "sourcesContent": ["import type { Fiber, ReactElement } from './index'\n\n// Development metadata lives outside elements and fibers, so the production\n// object layouts stay unchanged. Owner metadata also supports captureOwnerStack\n// when no DevTools extension is attached.\nexport const devToolsMetadata = {\n enabled: false,\n owner: null as Fiber | null,\n current: null as Fiber | null,\n errorStack: undefined as string | null | undefined,\n stackBudget: 10000,\n stackResetTime: 0,\n hosts: /* @__PURE__ */ new WeakMap<Node, Fiber>(),\n elements: /* @__PURE__ */ new WeakMap<object, { owner: Fiber | null; stack: Error | null; source: any }>(),\n fibers: /* @__PURE__ */ new WeakMap<Fiber, { owner: Fiber | null; stack: Error | null; source: any }>(),\n}\n\nexport function rememberDevToolsElement(element: ReactElement, source?: any, original?: ReactElement): ReactElement {\n const previous = original && devToolsMetadata.elements.get(original)\n devToolsMetadata.elements.set(element, previous || {\n owner: devToolsMetadata.owner,\n // React also caps owner stack capture at 10,000 elements per second.\n // Keep owner relationships, but don't invent a source once the budget ends.\n stack: devToolsMetadata.stackBudget-- > 0 ? new Error('react-stack-top-frame') : null,\n source: source || null,\n })\n return element\n}\n\nexport function readOwnerStack(fiber: Fiber | null): string | null {\n if (!fiber) return null\n if (!fiber) return null\n let stack = ''\n const seen = new Set<typeof fiber>()\n while (fiber && !seen.has(fiber)) {\n seen.add(fiber)\n const metadata = devToolsMetadata.fibers.get(fiber)\n fiber = metadata?.owner || null\n if (!fiber) break\n let type = fiber.type\n while (type && typeof type === 'object') type = type.type || type.render\n const name = typeof type === 'function' ? type.displayName || type.name || 'Anonymous' : ''\n if (!name) continue\n const frame = metadata?.stack?.stack?.split('\\n').find(line =>\n line.includes('at ' + name + ' (') || line.startsWith(name + '@'))\n stack += '\\n' + (frame ? frame.startsWith(name + '@') ? ' at ' + name + ' (' + frame.slice(name.length + 1) + ')' : frame : ' at ' + name)\n }\n return stack\n}\n\nexport function runWithOwnerStack<T>(stack: string | null, callback: () => T): T {\n const previousCurrent = devToolsMetadata.current\n const previousStack = devToolsMetadata.errorStack\n devToolsMetadata.current = null\n devToolsMetadata.errorStack = stack\n try { return callback() } finally {\n devToolsMetadata.current = previousCurrent\n devToolsMetadata.errorStack = previousStack\n }\n}\n\n/** Development-only, like React's diagnostic export. */\nexport let captureOwnerStack: () => string | null\nif (process.env.NODE_ENV !== 'production') {\n captureOwnerStack = () => devToolsMetadata.current\n ? readOwnerStack(devToolsMetadata.current)\n : devToolsMetadata.errorStack ?? null\n}\n"],
5
- "mappings": "AAKO,MAAM,mBAAmB;EAC9B,SAAS;EACT,OAAO;EACP,SAAS;EACT,YAAY;EACZ,aAAa;EACb,gBAAgB;EAChB,OAAuB,oBAAI,QAAO;EAClC,UAA0B,oBAAI,QAAO;EACrC,QAAwB,oBAAI,QAAO;;AAG/B,SAAU,wBAAwB,SAAuB,QAAc,UAAuB;AAClG,QAAM,WAAW,YAAY,iBAAiB,SAAS,IAAI,QAAQ;AACnE,mBAAiB,SAAS,IAAI,SAAS,YAAY;IACjD,OAAO,iBAAiB;;;IAGxB,OAAO,iBAAiB,gBAAgB,IAAI,IAAI,MAAM,uBAAuB,IAAI;IACjF,QAAQ,UAAU;GACnB;AACD,SAAO;AACT;AAEM,SAAU,eAAe,OAAmB;AAChD,MAAI,CAAC;AAAO,WAAO;AACnB,MAAI,CAAC;AAAO,WAAO;AACnB,MAAI,QAAQ;AACZ,QAAM,OAAO,oBAAI,IAAG;AACpB,SAAO,SAAS,CAAC,KAAK,IAAI,KAAK,GAAG;AAChC,SAAK,IAAI,KAAK;AACd,UAAM,WAAW,iBAAiB,OAAO,IAAI,KAAK;AAClD,YAAQ,UAAU,SAAS;AAC3B,QAAI,CAAC;AAAO;AACZ,QAAI,OAAO,MAAM;AACjB,WAAO,QAAQ,OAAO,SAAS;AAAU,aAAO,KAAK,QAAQ,KAAK;AAClE,UAAM,OAAO,OAAO,SAAS,aAAa,KAAK,eAAe,KAAK,QAAQ,cAAc;AACzF,QAAI,CAAC;AAAM;AACX,UAAM,QAAQ,UAAU,OAAO,OAAO,MAAM,IAAI,EAAE,KAAK,UACrD,KAAK,SAAS,QAAQ,OAAO,IAAI,KAAK,KAAK,WAAW,OAAO,GAAG,CAAC;AACnE,aAAS,QAAQ,QAAQ,MAAM,WAAW,OAAO,GAAG,IAAI,YAAY,OAAO,OAAO,MAAM,MAAM,KAAK,SAAS,CAAC,IAAI,MAAM,QAAQ,YAAY;EAC7I;AACA,SAAO;AACT;AAEM,SAAU,kBAAqB,OAAsB,UAAiB;AAC1E,QAAM,kBAAkB,iBAAiB;AACzC,QAAM,gBAAgB,iBAAiB;AACvC,mBAAiB,UAAU;AAC3B,mBAAiB,aAAa;AAC9B,MAAI;AAAE,WAAO,SAAQ;EAAG;AACtB,qBAAiB,UAAU;AAC3B,qBAAiB,aAAa;EAChC;AACF;AAGO,IAAI;AACX,IAAI,yBAAyB,cAAc;AACzC,sBAAoB,MAAM,iBAAiB,UACvC,eAAe,iBAAiB,OAAO,IACvC,iBAAiB,cAAc;AACrC;",
4
+ "sourcesContent": ["import type { Fiber, FiberRoot, ReactElement } from './index'\n\n// Development metadata lives outside elements and fibers, so the production\n// object layouts stay unchanged. Owner metadata also supports captureOwnerStack\n// when no DevTools extension is attached.\nexport const devToolsMetadata = {\n enabled: false,\n owner: null as Fiber | null,\n current: null as Fiber | null,\n errorStack: undefined as string | null | undefined,\n stackBudget: 10000,\n stackResetTime: 0,\n hosts: /* @__PURE__ */ new WeakMap<Node, Fiber>(),\n hydratedRoots: /* @__PURE__ */ new WeakSet<FiberRoot>(),\n elements: /* @__PURE__ */ new WeakMap<object, { owner: Fiber | null; stack: Error | null; source: any }>(),\n fibers: /* @__PURE__ */ new WeakMap<Fiber, { owner: Fiber | null; stack: Error | null; source: any }>(),\n}\n\nexport function rememberDevToolsElement(element: ReactElement, source?: any, original?: ReactElement): ReactElement {\n const previous = original && devToolsMetadata.elements.get(original)\n devToolsMetadata.elements.set(element, previous || {\n owner: devToolsMetadata.owner,\n // React also caps owner stack capture at 10,000 elements per second.\n // Keep owner relationships, but don't invent a source once the budget ends.\n stack: devToolsMetadata.stackBudget-- > 0 ? new Error('react-stack-top-frame') : null,\n source: source || null,\n })\n return element\n}\n\nexport function readOwnerStack(fiber: Fiber | null): string | null {\n if (!fiber) return null\n if (!fiber) return null\n let stack = ''\n const seen = new Set<typeof fiber>()\n while (fiber && !seen.has(fiber)) {\n seen.add(fiber)\n const metadata = devToolsMetadata.fibers.get(fiber)\n fiber = metadata?.owner || null\n if (!fiber) break\n let type = fiber.type\n while (type && typeof type === 'object') type = type.type || type.render\n const name = typeof type === 'function' ? type.displayName || type.name || 'Anonymous' : ''\n if (!name) continue\n const frame = metadata?.stack?.stack?.split('\\n').find(line =>\n line.includes('at ' + name + ' (') || line.startsWith(name + '@'))\n stack += '\\n' + (frame ? frame.startsWith(name + '@') ? ' at ' + name + ' (' + frame.slice(name.length + 1) + ')' : frame : ' at ' + name)\n }\n return stack\n}\n\nexport function runWithOwnerStack<T>(stack: string | null, callback: () => T): T {\n const previousCurrent = devToolsMetadata.current\n const previousStack = devToolsMetadata.errorStack\n devToolsMetadata.current = null\n devToolsMetadata.errorStack = stack\n try { return callback() } finally {\n devToolsMetadata.current = previousCurrent\n devToolsMetadata.errorStack = previousStack\n }\n}\n\n/** Development-only, like React's diagnostic export. */\nexport let captureOwnerStack: () => string | null\nif (process.env.NODE_ENV !== 'production') {\n captureOwnerStack = () => devToolsMetadata.current\n ? readOwnerStack(devToolsMetadata.current)\n : devToolsMetadata.errorStack ?? null\n}\n"],
5
+ "mappings": "AAKO,MAAM,mBAAmB;EAC9B,SAAS;EACT,OAAO;EACP,SAAS;EACT,YAAY;EACZ,aAAa;EACb,gBAAgB;EAChB,OAAuB,oBAAI,QAAO;EAClC,eAA+B,oBAAI,QAAO;EAC1C,UAA0B,oBAAI,QAAO;EACrC,QAAwB,oBAAI,QAAO;;AAG/B,SAAU,wBAAwB,SAAuB,QAAc,UAAuB;AAClG,QAAM,WAAW,YAAY,iBAAiB,SAAS,IAAI,QAAQ;AACnE,mBAAiB,SAAS,IAAI,SAAS,YAAY;IACjD,OAAO,iBAAiB;;;IAGxB,OAAO,iBAAiB,gBAAgB,IAAI,IAAI,MAAM,uBAAuB,IAAI;IACjF,QAAQ,UAAU;GACnB;AACD,SAAO;AACT;AAEM,SAAU,eAAe,OAAmB;AAChD,MAAI,CAAC;AAAO,WAAO;AACnB,MAAI,CAAC;AAAO,WAAO;AACnB,MAAI,QAAQ;AACZ,QAAM,OAAO,oBAAI,IAAG;AACpB,SAAO,SAAS,CAAC,KAAK,IAAI,KAAK,GAAG;AAChC,SAAK,IAAI,KAAK;AACd,UAAM,WAAW,iBAAiB,OAAO,IAAI,KAAK;AAClD,YAAQ,UAAU,SAAS;AAC3B,QAAI,CAAC;AAAO;AACZ,QAAI,OAAO,MAAM;AACjB,WAAO,QAAQ,OAAO,SAAS;AAAU,aAAO,KAAK,QAAQ,KAAK;AAClE,UAAM,OAAO,OAAO,SAAS,aAAa,KAAK,eAAe,KAAK,QAAQ,cAAc;AACzF,QAAI,CAAC;AAAM;AACX,UAAM,QAAQ,UAAU,OAAO,OAAO,MAAM,IAAI,EAAE,KAAK,UACrD,KAAK,SAAS,QAAQ,OAAO,IAAI,KAAK,KAAK,WAAW,OAAO,GAAG,CAAC;AACnE,aAAS,QAAQ,QAAQ,MAAM,WAAW,OAAO,GAAG,IAAI,YAAY,OAAO,OAAO,MAAM,MAAM,KAAK,SAAS,CAAC,IAAI,MAAM,QAAQ,YAAY;EAC7I;AACA,SAAO;AACT;AAEM,SAAU,kBAAqB,OAAsB,UAAiB;AAC1E,QAAM,kBAAkB,iBAAiB;AACzC,QAAM,gBAAgB,iBAAiB;AACvC,mBAAiB,UAAU;AAC3B,mBAAiB,aAAa;AAC9B,MAAI;AAAE,WAAO,SAAQ;EAAG;AACtB,qBAAiB,UAAU;AAC3B,qBAAiB,aAAa;EAChC;AACF;AAGO,IAAI;AACX,IAAI,yBAAyB,cAAc;AACzC,sBAAoB,MAAM,iBAAiB,UACvC,eAAe,iBAAiB,OAAO,IACvC,iBAAiB,cAAc;AACrC;",
6
6
  "names": []
7
7
  }
@@ -12,3 +12,4 @@ export {
12
12
  isTextContent,
13
13
  isThenable
14
14
  };
15
+ //# sourceMappingURL=functions.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/core/functions.ts"],
4
- "sourcesContent": ["export const isFunction = (value: any): value is ((...args: any[]) => any) & Record<string, any> => (typeof value === 'function')\n\nexport const isReservedProp = (name: string): boolean => (name === 'children' || name === 'ref' || name === 'key')\n\nexport const isThenable = (x: any): x is Promise<any> => (x != null && isFunction(x.then))\n\nexport const isString = (value: any): value is string => typeof value === 'string'\n\nexport const isObject = (value: any): boolean => typeof value === 'object'\n"],
5
- "mappings": "AAAO,MAAM,aAAa,CAAC,UAA0E,OAAO,UAAU;AAE/G,MAAM,iBAAiB,CAAC,SAA2B,SAAS,cAAc,SAAS,SAAS,SAAS;AAErG,MAAM,aAAa,CAAC,MAA+B,KAAK,QAAQ,WAAW,EAAE,IAAI;AAEjF,MAAM,WAAW,CAAC,UAAgC,OAAO,UAAU;AAEnE,MAAM,WAAW,CAAC,UAAwB,OAAO,UAAU;",
4
+ "sourcesContent": ["export const isFunction = (value: any): value is ((...args: any[]) => any) & Record<string, any> => (typeof value === 'function')\n\nexport const isReservedProp = (name: string): boolean => (name === 'children' || name === 'ref' || name === 'key')\n\nexport const isThenable = (x: any): x is Promise<any> => (x != null && isFunction(x.then))\n\nexport const isString = (value: any): value is string => typeof value === 'string'\n\nexport const isObject = (value: any): boolean => typeof value === 'object'\n\nexport const isTextContent = (value: unknown): value is string | number | bigint => typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint'\n"],
5
+ "mappings": "AAAO,MAAM,aAAa,CAAC,UAA0E,OAAO,UAAU;AAE/G,MAAM,iBAAiB,CAAC,SAA2B,SAAS,cAAc,SAAS,SAAS,SAAS;AAErG,MAAM,aAAa,CAAC,MAA+B,KAAK,QAAQ,WAAW,EAAE,IAAI;AAEjF,MAAM,WAAW,CAAC,UAAgC,OAAO,UAAU;AAEnE,MAAM,WAAW,CAAC,UAAwB,OAAO,UAAU;AAE3D,MAAM,gBAAgB,CAAC,UAAsD,OAAO,UAAU,YAAY,OAAO,UAAU,YAAY,OAAO,UAAU;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import type { ReactElement, ReactNode, Ref } from './types.js';
1
+ import type { ReactElement, ReactNode, Ref } from "./types.js";
2
2
  export declare const enum FiberTag {
3
3
  Host = 0,
4
4
  Text = 1,
@@ -30,6 +30,7 @@ export interface Effect {
30
30
  s?: boolean | undefined;
31
31
  }
32
32
  export interface Fiber {
33
+ br?: boolean;
33
34
  ix?: number;
34
35
  t: FiberTag;
35
36
  type: any;
@@ -56,7 +57,7 @@ export interface Fiber {
56
57
  ad?: boolean;
57
58
  ah?: boolean;
58
59
  ef?: Map<Hook, Effect> | undefined;
59
- hc?: import('../dom/features/hydration/full.js').HydrationCursor | undefined;
60
+ hc?: import("../dom/features/hydration/full.js").HydrationCursor | undefined;
60
61
  it?: bigint;
61
62
  il?: number;
62
63
  im?: boolean;
@@ -71,7 +72,7 @@ export type RecoverableErrorHandler = (error: unknown, info: {
71
72
  }) => void;
72
73
  export interface FiberRoot {
73
74
  tr?: Set<Fiber> & {
74
- s: Set<import('../react/action-scope.js').ActionScope>;
75
+ s: Set<import("../react/action-scope.js").ActionScope>;
75
76
  w?: PromiseLike<unknown>;
76
77
  u?: (() => void) | undefined;
77
78
  };
@@ -80,7 +81,7 @@ export interface FiberRoot {
80
81
  c: Element | DocumentFragment;
81
82
  r: Fiber;
82
83
  p: Set<Fiber>;
83
- s: boolean;
84
+ s: boolean | (() => void);
84
85
  u?: (() => void) | undefined;
85
86
  er?: Array<{
86
87
  error: unknown;
@@ -1,5 +1,4 @@
1
- var FiberTag;
2
- (function(FiberTag2) {
1
+ var FiberTag = /* @__PURE__ */ ((FiberTag2) => {
3
2
  FiberTag2[FiberTag2["Host"] = 0] = "Host";
4
3
  FiberTag2[FiberTag2["Text"] = 1] = "Text";
5
4
  FiberTag2[FiberTag2["Function"] = 2] = "Function";
@@ -15,7 +14,8 @@ var FiberTag;
15
14
  FiberTag2[FiberTag2["Root"] = 12] = "Root";
16
15
  FiberTag2[FiberTag2["Activity"] = 13] = "Activity";
17
16
  FiberTag2[FiberTag2["Resource"] = 14] = "Resource";
18
- })(FiberTag || (FiberTag = {}));
17
+ return FiberTag2;
18
+ })(FiberTag || {});
19
19
  function createFiber(tag, type, key) {
20
20
  return {
21
21
  t: tag,
@@ -41,3 +41,4 @@ export {
41
41
  FiberTag,
42
42
  createFiber
43
43
  };
44
+ //# sourceMappingURL=internal.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/core/internal.ts"],
4
- "sourcesContent": ["import type { ReactElement, ReactNode, Ref } from './types';\nexport const enum FiberTag {\n Host = 0,\n Text = 1,\n Function = 2,\n Class = 3,\n Fragment = 4,\n Portal = 5,\n Provider = 6,\n Consumer = 7,\n ForwardRef = 8,\n Memo = 9,\n Lazy = 10,\n Suspense = 11,\n Root = 12,\n Activity = 13,\n Resource = 14\n}\nexport interface Hook {\n t?: any[] | undefined;\n s: any;\n q: any;\n d: any;\n c: any;\n}\nexport interface Effect {\n t: 0 | 1 | 2;\n c: () => any;\n d?: () => void;\n s?: boolean | undefined; // Store subscriptions run in layout but stay connected in Suspense.\n}\nexport interface Fiber {\n ix?: number; // Logical child position, including empty slots.\n t: FiberTag; // Tag.\n type: any;\n key: string | null;\n ref: Ref<any> | null;\n v: any; // Pending props.\n m: any; // Committed props.\n b: any; // Renderer state.\n i: any; // Class instance or resource node.\n n: Node | null; // Host node.\n p: Fiber | null; // Parent.\n c: Fiber | null; // First child.\n s: Fiber | null; // Next sibling.\n h: Hook[] | null;\n e: Array<() => void> | null; // Cleanups.\n g: boolean; // Has pending work.\n u: boolean; // Unmounted.\n pd?: boolean;\n su?: Fiber | null; // Retained Suspense primary update target.\n bs?: boolean; // This component suspended without a boundary.\n bt?: boolean; // Pending updates belong only to transitions.\n ld?: boolean; // Layout effects and refs are disconnected, not passive effects.\n r: FiberRoot | null;\n ad?: boolean; // Activity has disconnected this fiber.\n ah?: boolean; // Activity owns its hidden host DOM.\n ef?: Map<Hook, Effect> | undefined; // Retained effect descriptions.\n hc?: import('../dom/features/hydration/full').HydrationCursor | undefined;\n it?: bigint; // React hydration tree ID.\n il?: number; // Local useId calls in this render.\n im?: boolean; // This fiber materialized a React tree ID.\n d?: number; // Cached depth.\n cx?: Map<any, any> | null;\n cr?: Ref<any> | null;\n rc?: (() => void) | null;\n}\nexport type RecoverableErrorHandler = (error: unknown, info: {\n componentStack: string | null;\n errorBoundary?: unknown;\n}) => void;\nexport interface FiberRoot {\n tr?: Set<Fiber> & {\n s: Set<import('../react/action-scope').ActionScope>;\n w?: PromiseLike<unknown>;\n };\n hr?: Node | undefined; // Hydration recovery container.\n ri?: boolean; // React-compatible hydration IDs.\n c: Element | DocumentFragment;\n r: Fiber;\n p: Set<Fiber>;\n s: boolean;\n u?: (() => void) | undefined;\n er?: Array<{\n error: unknown;\n stack: string;\n ownerStack?: string | null;\n }> | undefined;\n eb?: boolean;\n sp?: boolean;\n re?: RecoverableErrorHandler | undefined;\n ce?: RecoverableErrorHandler | undefined;\n ue?: RecoverableErrorHandler | undefined;\n i: string | undefined;\n ic: number;\n h: boolean;\n a?: boolean;\n fr?: boolean;\n}\nexport function createFiber(tag: FiberTag, type: any, key: string | null): Fiber {\n return {\n t: tag,\n type,\n key,\n ref: null,\n v: null,\n m: null,\n b: null,\n i: null,\n n: null,\n p: null,\n c: null,\n s: null,\n h: null,\n e: null,\n g: false,\n u: false,\n r: null,\n };\n}\nexport type ChildNode = ReactElement | string | number | boolean | null | undefined | ChildNode[];\nexport type { ReactElement, ReactNode };\n"],
5
- "mappings": "AACO,IAAW,WAAX,kBAAWA,cAAX;AACH,EAAAA,oBAAA,UAAO,KAAP;AACA,EAAAA,oBAAA,UAAO,KAAP;AACA,EAAAA,oBAAA,cAAW,KAAX;AACA,EAAAA,oBAAA,WAAQ,KAAR;AACA,EAAAA,oBAAA,cAAW,KAAX;AACA,EAAAA,oBAAA,YAAS,KAAT;AACA,EAAAA,oBAAA,cAAW,KAAX;AACA,EAAAA,oBAAA,cAAW,KAAX;AACA,EAAAA,oBAAA,gBAAa,KAAb;AACA,EAAAA,oBAAA,UAAO,KAAP;AACA,EAAAA,oBAAA,UAAO,MAAP;AACA,EAAAA,oBAAA,cAAW,MAAX;AACA,EAAAA,oBAAA,UAAO,MAAP;AACA,EAAAA,oBAAA,cAAW,MAAX;AACA,EAAAA,oBAAA,cAAW,MAAX;AAfc,SAAAA;AAAA,GAAA;AAkGX,SAAS,YAAY,KAAe,MAAW,KAA2B;AAC7E,SAAO;AAAA,IACH,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,EACP;AACJ;",
4
+ "sourcesContent": ["import type { ReactElement, ReactNode, Ref } from './types';\nexport const enum FiberTag {\n Host = 0,\n Text = 1,\n Function = 2,\n Class = 3,\n Fragment = 4,\n Portal = 5,\n Provider = 6,\n Consumer = 7,\n ForwardRef = 8,\n Memo = 9,\n Lazy = 10,\n Suspense = 11,\n Root = 12,\n Activity = 13,\n Resource = 14\n}\nexport interface Hook {\n t?: any[] | undefined;\n s: any;\n q: any;\n d: any;\n c: any;\n}\nexport interface Effect {\n t: 0 | 1 | 2;\n c: () => any;\n d?: () => void;\n s?: boolean | undefined; // Store subscriptions run in layout but stay connected in Suspense.\n}\nexport interface Fiber {\n br?: boolean; // This boundary is rendering its error recovery tree.\n ix?: number; // Logical child position, including empty slots.\n t: FiberTag; // Tag.\n type: any;\n key: string | null;\n ref: Ref<any> | null;\n v: any; // Pending props.\n m: any; // Committed props.\n b: any; // Renderer state.\n i: any; // Class instance or resource node.\n n: Node | null; // Host node.\n p: Fiber | null; // Parent.\n c: Fiber | null; // First child.\n s: Fiber | null; // Next sibling.\n h: Hook[] | null;\n e: Array<() => void> | null; // Cleanups.\n g: boolean; // Has pending work.\n u: boolean; // Unmounted.\n pd?: boolean;\n su?: Fiber | null; // Retained Suspense primary update target.\n bs?: boolean; // This component suspended without a boundary.\n bt?: boolean; // Pending updates belong only to transitions.\n ld?: boolean; // Layout effects and refs are disconnected, not passive effects.\n r: FiberRoot | null;\n ad?: boolean; // Activity has disconnected this fiber.\n ah?: boolean; // Activity owns its hidden host DOM.\n ef?: Map<Hook, Effect> | undefined; // Retained effect descriptions.\n hc?: import('../dom/features/hydration/full').HydrationCursor | undefined;\n it?: bigint; // React hydration tree ID.\n il?: number; // Local useId calls in this render.\n im?: boolean; // This fiber materialized a React tree ID.\n d?: number; // Cached depth.\n cx?: Map<any, any> | null;\n cr?: Ref<any> | null;\n rc?: (() => void) | null;\n}\nexport type RecoverableErrorHandler = (error: unknown, info: {\n componentStack: string | null;\n errorBoundary?: unknown;\n}) => void;\nexport interface FiberRoot {\n tr?: Set<Fiber> & {\n s: Set<import('../react/action-scope').ActionScope>;\n w?: PromiseLike<unknown>;\n u?: (() => void) | undefined;\n };\n hr?: Node | undefined; // Hydration recovery container.\n ri?: boolean; // React-compatible hydration IDs.\n c: Element | DocumentFragment;\n r: Fiber;\n p: Set<Fiber>;\n s: boolean | (() => void); // Development host callbacks carry their own identity.\n u?: (() => void) | undefined;\n er?: Array<{\n error: unknown;\n stack: string;\n ownerStack?: string | null;\n }> | undefined;\n eb?: boolean;\n sp?: boolean;\n re?: RecoverableErrorHandler | undefined;\n ce?: RecoverableErrorHandler | undefined;\n ue?: RecoverableErrorHandler | undefined;\n i: string | undefined;\n ic: number;\n h: boolean;\n a?: boolean;\n fr?: boolean;\n}\nexport function createFiber(tag: FiberTag, type: any, key: string | null): Fiber {\n return {\n t: tag,\n type,\n key,\n ref: null,\n v: null,\n m: null,\n b: null,\n i: null,\n n: null,\n p: null,\n c: null,\n s: null,\n h: null,\n e: null,\n g: false,\n u: false,\n r: null,\n };\n}\nexport type ChildNode = ReactElement | string | number | boolean | null | undefined | ChildNode[];\nexport type { ReactElement, ReactNode };\n"],
5
+ "mappings": "AACO,IAAW,WAAX,kBAAWA,cAAX;AACH,EAAAA,oBAAA,UAAO,KAAP;AACA,EAAAA,oBAAA,UAAO,KAAP;AACA,EAAAA,oBAAA,cAAW,KAAX;AACA,EAAAA,oBAAA,WAAQ,KAAR;AACA,EAAAA,oBAAA,cAAW,KAAX;AACA,EAAAA,oBAAA,YAAS,KAAT;AACA,EAAAA,oBAAA,cAAW,KAAX;AACA,EAAAA,oBAAA,cAAW,KAAX;AACA,EAAAA,oBAAA,gBAAa,KAAb;AACA,EAAAA,oBAAA,UAAO,KAAP;AACA,EAAAA,oBAAA,UAAO,MAAP;AACA,EAAAA,oBAAA,cAAW,MAAX;AACA,EAAAA,oBAAA,UAAO,MAAP;AACA,EAAAA,oBAAA,cAAW,MAAX;AACA,EAAAA,oBAAA,cAAW,MAAX;AAfc,SAAAA;AAAA,GAAA;AAoGX,SAAS,YAAY,KAAe,MAAW,KAA2B;AAC7E,SAAO;AAAA,IACH,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,EACP;AACJ;",
6
6
  "names": ["FiberTag"]
7
7
  }
@@ -3,10 +3,10 @@ export declare const REACT_LEGACY_ELEMENT_TYPE: unique symbol;
3
3
  export declare const REACT_FRAGMENT_TYPE: unique symbol;
4
4
  export type Key = string | number | null | undefined;
5
5
  export interface ReactElement<P = any, T = any> {
6
- $$typeof: typeof REACT_ELEMENT_TYPE;
6
+ $$typeof?: typeof REACT_ELEMENT_TYPE;
7
7
  type: T;
8
8
  key: string | null;
9
- ref: any;
9
+ ref?: any;
10
10
  props: P;
11
11
  }
12
12
  type ReactNodeValue = ReactElement | string | number | bigint | boolean | null | undefined | Iterable<ReactNode>;
@@ -6,3 +6,4 @@ export {
6
6
  REACT_FRAGMENT_TYPE,
7
7
  REACT_LEGACY_ELEMENT_TYPE
8
8
  };
9
+ //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/core/types.ts"],
4
- "sourcesContent": ["// React 19+ uses the transitional element symbol. When our shim's elements\n// are passed to react-dom (e.g. Start routing through real react-dom/server\n// somewhere), they must carry the symbol that React's isValidElement checks.\nexport const REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element')\nexport const REACT_LEGACY_ELEMENT_TYPE = Symbol.for('react.element')\nexport const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment')\n\nexport type Key = string | number | null | undefined\n\nexport interface ReactElement<P = any, T = any> {\n $$typeof: typeof REACT_ELEMENT_TYPE\n type: T\n key: string | null\n ref: any\n props: P\n}\n\ntype ReactNodeValue =\n | ReactElement\n | string\n | number\n | boolean\n | null\n | undefined\n | Iterable<ReactNode>\n\nexport type ReactNode = ReactNodeValue | Promise<ReactNodeValue>\n\nexport type RefObject<T> = { current: T | null }\nexport type RefCallback<T> = (instance: T | null) => void | (() => void)\nexport type Ref<T> = RefObject<T> | RefCallback<T> | null\n\nexport type Dispatch<A> = (value: A) => void\nexport type SetStateAction<S> = S | ((prev: S) => S)\n\nexport type EffectCallback = () => void | (() => void)\nexport type DependencyList = ReadonlyArray<unknown>\n\n"],
4
+ "sourcesContent": ["// React 19+ uses the transitional element symbol. When our shim's elements\n// are passed to react-dom (e.g. Start routing through real react-dom/server\n// somewhere), they must carry the symbol that React's isValidElement checks.\nexport const REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element')\nexport const REACT_LEGACY_ELEMENT_TYPE = Symbol.for('react.element')\nexport const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment')\n\nexport type Key = string | number | null | undefined\n\n// Native React declarations omit these runtime protocol fields and the legacy ref accessor.\nexport interface ReactElement<P = any, T = any> {\n $$typeof?: typeof REACT_ELEMENT_TYPE\n type: T\n key: string | null\n ref?: any\n props: P\n}\n\ntype ReactNodeValue =\n | ReactElement\n | string\n | number\n | bigint\n | boolean\n | null\n | undefined\n | Iterable<ReactNode>\n\nexport type ReactNode = ReactNodeValue | Promise<ReactNodeValue>\n\nexport type RefObject<T> = { current: T | null }\nexport type RefCallback<T> = (instance: T | null) => void | (() => void)\nexport type Ref<T> = RefObject<T> | RefCallback<T> | null\n\nexport type Dispatch<A> = (value: A) => void\nexport type SetStateAction<S> = S | ((prev: S) => S)\n\nexport type EffectCallback = () => void | (() => void)\nexport type DependencyList = ReadonlyArray<unknown>\n\n"],
5
5
  "mappings": "AAGO,MAAM,qBAAqB,uBAAO,IAAI,4BAA4B;AAClE,MAAM,4BAA4B,uBAAO,IAAI,eAAe;AAC5D,MAAM,sBAAsB,uBAAO,IAAI,gBAAgB;",
6
6
  "names": []
7
7
  }
@@ -1,9 +1,9 @@
1
- import { type Fiber, type FiberRoot } from '../core/index.js';
1
+ import { type Fiber, type FiberRoot } from "../core/index.js";
2
2
  interface DevToolsRuntime {
3
- shared: typeof import('../react/shared-internals.js').ReactSharedInternals;
4
- scheduleUpdate: typeof import('./reconcile.js').scheduleUpdate;
5
- flushSyncWork: typeof import('./reconcile.js').flushSyncWork;
6
- onCommitRollback: typeof import('./commit.js').onCommitRollback;
3
+ shared: typeof import("../react/shared-internals.js").ReactSharedInternals;
4
+ scheduleUpdate: typeof import("./reconcile.js").scheduleUpdate;
5
+ flushSyncWork: typeof import("./reconcile.js").flushSyncWork;
6
+ onCommitRollback: typeof import("./commit.js").onCommitRollback;
7
7
  }
8
8
  type Timing = {
9
9
  start: number;
@@ -633,3 +633,4 @@ export {
633
633
  renderWithDevTools,
634
634
  wrapDevToolsRender
635
635
  };
636
+ //# sourceMappingURL=devtools.js.map