@powerlines/plugin-react 0.1.134 → 0.1.135

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 (203) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  2. package/dist/components/index.cjs +2 -3
  3. package/dist/components/index.d.cts +1 -3
  4. package/dist/components/index.d.mts +1 -4
  5. package/dist/components/index.mjs +1 -2
  6. package/dist/components/react-optimized.cjs +48 -2
  7. package/dist/components/react-optimized.d.cts +13 -2
  8. package/dist/components/react-optimized.d.mts +13 -3
  9. package/dist/components/react-optimized.mjs +45 -1
  10. package/dist/deepkit/schemas/reflection.cjs +3940 -0
  11. package/dist/{plugin-CJdK9GYW.d.cts → deepkit/schemas/reflection.d.cts} +1 -331
  12. package/dist/{plugin-Noy_HIP5.d.mts → deepkit/schemas/reflection.d.mts} +59 -389
  13. package/dist/deepkit/schemas/reflection.mjs +3938 -0
  14. package/dist/deepkit/schemas/reflection2.cjs +4112 -0
  15. package/dist/deepkit/schemas/reflection2.mjs +4110 -0
  16. package/dist/deepkit/src/capnp.cjs +913 -0
  17. package/dist/deepkit/src/capnp.mjs +911 -0
  18. package/dist/deepkit/src/esbuild-plugin.cjs +47 -0
  19. package/dist/deepkit/src/esbuild-plugin.mjs +46 -0
  20. package/dist/deepkit/src/reflect-type.cjs +22 -0
  21. package/dist/deepkit/src/reflect-type.mjs +20 -0
  22. package/dist/deepkit/src/resolve-reflections.cjs +16 -0
  23. package/dist/deepkit/src/resolve-reflections.mjs +15 -0
  24. package/dist/deepkit/src/transformer.cjs +52 -0
  25. package/dist/deepkit/src/transformer.mjs +49 -0
  26. package/dist/deepkit/src/transpile.cjs +29 -0
  27. package/dist/deepkit/src/transpile.mjs +27 -0
  28. package/dist/deepkit/src/types.d.cts +10 -0
  29. package/dist/deepkit/src/types.d.mts +10 -0
  30. package/dist/deepkit/src/utilities.cjs +66 -0
  31. package/dist/deepkit/src/utilities.mjs +65 -0
  32. package/dist/index.cjs +16 -11295
  33. package/dist/index.d.cts +5 -7
  34. package/dist/index.d.mts +6 -8
  35. package/dist/index.mjs +7 -11280
  36. package/dist/plugin-alloy/src/core/components/output.cjs +45 -0
  37. package/dist/plugin-alloy/src/core/components/output.mjs +44 -0
  38. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +22 -0
  39. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +21 -0
  40. package/dist/plugin-alloy/src/core/components/source-file.cjs +64 -0
  41. package/dist/plugin-alloy/src/core/components/source-file.d.cts +23 -0
  42. package/dist/plugin-alloy/src/core/components/source-file.d.mts +23 -0
  43. package/dist/plugin-alloy/src/core/components/source-file.mjs +62 -0
  44. package/dist/plugin-alloy/src/core/contexts/context.cjs +60 -0
  45. package/dist/plugin-alloy/src/core/contexts/context.mjs +54 -0
  46. package/dist/plugin-alloy/src/core/contexts/index.cjs +2 -0
  47. package/dist/plugin-alloy/src/core/contexts/index.mjs +4 -0
  48. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +46 -0
  49. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +42 -0
  50. package/dist/plugin-alloy/src/helpers/refkey.cjs +16 -0
  51. package/dist/plugin-alloy/src/helpers/refkey.mjs +15 -0
  52. package/dist/plugin-alloy/src/index.cjs +93 -0
  53. package/dist/plugin-alloy/src/index.mjs +91 -0
  54. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +7 -0
  55. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +9 -0
  56. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +5 -0
  57. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +7 -0
  58. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +17 -0
  59. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +17 -0
  60. package/dist/plugin-alloy/src/types/components.d.cts +22 -0
  61. package/dist/{components-Bs3-ohmM.d.mts → plugin-alloy/src/types/components.d.mts} +2 -1
  62. package/dist/plugin-alloy/src/types/index.d.mts +2 -0
  63. package/dist/plugin-alloy/src/types/plugin.d.cts +37 -0
  64. package/dist/plugin-alloy/src/types/plugin.d.mts +37 -0
  65. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +57 -0
  66. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +25 -0
  67. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +26 -0
  68. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +56 -0
  69. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +126 -0
  70. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +124 -0
  71. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +442 -0
  72. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +27 -0
  73. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +28 -0
  74. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +433 -0
  75. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +194 -0
  76. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +14 -0
  77. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +15 -0
  78. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +191 -0
  79. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +68 -0
  80. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +67 -0
  81. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +124 -0
  82. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +123 -0
  83. package/dist/plugin-automd/src/index.cjs +101 -0
  84. package/dist/plugin-automd/src/index.mjs +98 -0
  85. package/dist/plugin-automd/src/types/plugin.d.cts +38 -0
  86. package/dist/plugin-automd/src/types/plugin.d.mts +40 -0
  87. package/dist/plugin-automd/src/types/toc.d.cts +33 -0
  88. package/dist/plugin-automd/src/types/toc.d.mts +33 -0
  89. package/dist/plugin-babel/src/helpers/ast-utils.cjs +10 -0
  90. package/dist/plugin-babel/src/helpers/ast-utils.mjs +9 -0
  91. package/dist/plugin-babel/src/helpers/create-plugin.cjs +41 -0
  92. package/dist/plugin-babel/src/helpers/create-plugin.mjs +39 -0
  93. package/dist/plugin-babel/src/helpers/filters.cjs +23 -0
  94. package/dist/plugin-babel/src/helpers/filters.mjs +21 -0
  95. package/dist/plugin-babel/src/helpers/index.cjs +5 -0
  96. package/dist/plugin-babel/src/helpers/index.mjs +7 -0
  97. package/dist/plugin-babel/src/helpers/module-helpers.cjs +38 -0
  98. package/dist/plugin-babel/src/helpers/module-helpers.mjs +35 -0
  99. package/dist/plugin-babel/src/helpers/options.cjs +50 -0
  100. package/dist/plugin-babel/src/helpers/options.mjs +47 -0
  101. package/dist/plugin-babel/src/index.cjs +91 -0
  102. package/dist/plugin-babel/src/index.mjs +89 -0
  103. package/dist/plugin-babel/src/types/index.d.mts +1 -0
  104. package/dist/plugin-babel/src/types/plugin.d.cts +15 -0
  105. package/dist/plugin-babel/src/types/plugin.d.mts +15 -0
  106. package/dist/plugin-env/src/babel/index.cjs +1 -0
  107. package/dist/plugin-env/src/babel/index.mjs +3 -0
  108. package/dist/plugin-env/src/babel/plugin.cjs +121 -0
  109. package/dist/plugin-env/src/babel/plugin.mjs +119 -0
  110. package/dist/plugin-env/src/components/docs.cjs +9 -0
  111. package/dist/plugin-env/src/components/docs.mjs +11 -0
  112. package/dist/plugin-env/src/components/env.cjs +575 -0
  113. package/dist/plugin-env/src/components/env.mjs +572 -0
  114. package/dist/plugin-env/src/components/index.cjs +2 -0
  115. package/dist/plugin-env/src/components/index.mjs +4 -0
  116. package/dist/plugin-env/src/helpers/automd-generator.cjs +22 -0
  117. package/dist/plugin-env/src/helpers/automd-generator.mjs +21 -0
  118. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +55 -0
  119. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +54 -0
  120. package/dist/plugin-env/src/helpers/index.cjs +6 -0
  121. package/dist/plugin-env/src/helpers/index.mjs +8 -0
  122. package/dist/plugin-env/src/helpers/load.cjs +83 -0
  123. package/dist/plugin-env/src/helpers/load.mjs +80 -0
  124. package/dist/plugin-env/src/helpers/persistence.cjs +199 -0
  125. package/dist/plugin-env/src/helpers/persistence.mjs +188 -0
  126. package/dist/plugin-env/src/helpers/reflect.cjs +111 -0
  127. package/dist/plugin-env/src/helpers/reflect.mjs +103 -0
  128. package/dist/plugin-env/src/helpers/source-file-env.cjs +24 -0
  129. package/dist/plugin-env/src/helpers/source-file-env.mjs +23 -0
  130. package/dist/plugin-env/src/helpers/template-helpers.cjs +2 -0
  131. package/dist/plugin-env/src/helpers/template-helpers.mjs +4 -0
  132. package/dist/plugin-env/src/index.cjs +175 -0
  133. package/dist/plugin-env/src/index.mjs +173 -0
  134. package/dist/plugin-env/src/types/plugin.d.cts +151 -0
  135. package/dist/plugin-env/src/types/plugin.d.mts +153 -0
  136. package/dist/{runtime-B8Zgz0Kb.d.cts → plugin-env/src/types/runtime.d.cts} +2 -2
  137. package/dist/{runtime-BFnA_zZ8.d.mts → plugin-env/src/types/runtime.d.mts} +2 -2
  138. package/dist/powerlines/src/lib/build/esbuild.cjs +102 -0
  139. package/dist/powerlines/src/lib/build/esbuild.mjs +100 -0
  140. package/dist/powerlines/src/lib/entry.cjs +12 -0
  141. package/dist/powerlines/src/lib/entry.mjs +14 -0
  142. package/dist/powerlines/src/lib/logger.cjs +41 -0
  143. package/dist/powerlines/src/lib/logger.mjs +39 -0
  144. package/dist/powerlines/src/lib/typescript/tsconfig.cjs +38 -0
  145. package/dist/powerlines/src/lib/typescript/tsconfig.mjs +35 -0
  146. package/dist/powerlines/src/lib/utilities/bundle.cjs +35 -0
  147. package/dist/powerlines/src/lib/utilities/bundle.mjs +34 -0
  148. package/dist/powerlines/src/lib/utilities/resolve.cjs +30 -0
  149. package/dist/powerlines/src/lib/utilities/resolve.mjs +29 -0
  150. package/dist/powerlines/src/plugin-utils/paths.cjs +1 -0
  151. package/dist/powerlines/src/plugin-utils/paths.mjs +3 -0
  152. package/dist/powerlines/src/types/babel.d.cts +22 -0
  153. package/dist/powerlines/src/types/babel.d.mts +22 -0
  154. package/dist/powerlines/src/types/build.d.cts +145 -0
  155. package/dist/powerlines/src/types/build.d.mts +145 -0
  156. package/dist/powerlines/src/types/commands.d.cts +8 -0
  157. package/dist/powerlines/src/types/commands.d.mts +9 -0
  158. package/dist/powerlines/src/types/config.d.cts +387 -0
  159. package/dist/powerlines/src/types/config.d.mts +388 -0
  160. package/dist/powerlines/src/types/context.d.cts +414 -0
  161. package/dist/powerlines/src/types/context.d.mts +416 -0
  162. package/dist/powerlines/src/types/fs.d.cts +486 -0
  163. package/dist/powerlines/src/types/fs.d.mts +486 -0
  164. package/dist/powerlines/src/types/hooks.d.mts +2 -0
  165. package/dist/powerlines/src/types/plugin.d.cts +231 -0
  166. package/dist/powerlines/src/types/plugin.d.mts +231 -0
  167. package/dist/powerlines/src/types/resolved.d.cts +82 -0
  168. package/dist/powerlines/src/types/resolved.d.mts +82 -0
  169. package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
  170. package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
  171. package/dist/types/index.cjs +0 -3
  172. package/dist/types/index.d.cts +2 -5
  173. package/dist/types/index.d.mts +2 -6
  174. package/dist/types/index.mjs +0 -4
  175. package/dist/types/plugin.cjs +0 -1
  176. package/dist/types/plugin.d.cts +72 -3
  177. package/dist/types/plugin.d.mts +72 -4
  178. package/dist/types/plugin.mjs +0 -2
  179. package/dist/types/runtime.cjs +0 -1
  180. package/dist/types/runtime.d.cts +14 -3
  181. package/dist/types/runtime.d.mts +14 -3
  182. package/dist/types/runtime.mjs +0 -2
  183. package/package.json +6 -6
  184. package/dist/components-BWLXb7a2.cjs +0 -0
  185. package/dist/components-D-mbfYAe.mjs +0 -1
  186. package/dist/index-B8OHl-c_.d.mts +0 -1
  187. package/dist/index-CFG0_wK4.d.cts +0 -1
  188. package/dist/index-DNLi60D-.d.mts +0 -1
  189. package/dist/index-_wQ5ClJU.d.cts +0 -1
  190. package/dist/plugin-jZ9N9Mz-.mjs +0 -1
  191. package/dist/plugin-pBKbb5K9.cjs +0 -0
  192. package/dist/react-optimized-BpFTLlx0.mjs +0 -937
  193. package/dist/react-optimized-CVXQfO40.d.mts +0 -88
  194. package/dist/react-optimized-Kv14o38g.cjs +0 -1078
  195. package/dist/react-optimized-NGRcJkqA.d.cts +0 -105
  196. package/dist/resolved-CTt23qfE.d.cts +0 -1795
  197. package/dist/resolved-Nive48eM.d.mts +0 -1796
  198. package/dist/runtime-B-KyPHeI.d.mts +0 -15
  199. package/dist/runtime-BKY6WvHV.mjs +0 -1
  200. package/dist/runtime-Bp9G0scd.cjs +0 -0
  201. package/dist/runtime-Dm--tkdO.d.cts +0 -15
  202. package/dist/types--fVOUYBq.mjs +0 -1
  203. package/dist/types-a8gm_IaQ.cjs +0 -0
@@ -0,0 +1,29 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ exports.__toESM = __toESM;
@@ -1,4 +1,3 @@
1
- const require_react_optimized = require('../react-optimized-Kv14o38g.cjs');
2
- require('../components-BWLXb7a2.cjs');
1
+ const require_components_react_optimized = require('./react-optimized.cjs');
3
2
 
4
- exports.ReactOptimizedBuiltin = require_react_optimized.ReactOptimizedBuiltin;
3
+ exports.ReactOptimizedBuiltin = require_components_react_optimized.ReactOptimizedBuiltin;
@@ -1,4 +1,2 @@
1
- import "../resolved-CTt23qfE.cjs";
2
- import { n as ReactOptimizedBuiltinProps, r as __ΩReactOptimizedBuiltinProps, t as ReactOptimizedBuiltin } from "../react-optimized-NGRcJkqA.cjs";
3
- import "../index-_wQ5ClJU.cjs";
1
+ import { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps } from "./react-optimized.cjs";
4
2
  export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps };
@@ -1,5 +1,2 @@
1
- import "../resolved-Nive48eM.mjs";
2
- import "../components-Bs3-ohmM.mjs";
3
- import { n as ReactOptimizedBuiltinProps, r as __ΩReactOptimizedBuiltinProps, t as ReactOptimizedBuiltin } from "../react-optimized-CVXQfO40.mjs";
4
- import "../index-DNLi60D-.mjs";
1
+ import { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps } from "./react-optimized.mjs";
5
2
  export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps };
@@ -1,4 +1,3 @@
1
- import { t as ReactOptimizedBuiltin } from "../react-optimized-BpFTLlx0.mjs";
2
- import "../components-D-mbfYAe.mjs";
1
+ import { ReactOptimizedBuiltin } from "./react-optimized.mjs";
3
2
 
4
3
  export { ReactOptimizedBuiltin };
@@ -1,3 +1,49 @@
1
- const require_react_optimized = require('../react-optimized-Kv14o38g.cjs');
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ const require_refkey = require('../plugin-alloy/src/helpers/refkey.cjs');
3
+ const require_tsdoc = require('../plugin-alloy/src/typescript/components/tsdoc.cjs');
4
+ const require_builtin_file = require('../plugin-alloy/src/typescript/components/builtin-file.cjs');
5
+ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
6
+ let defu = require("defu");
7
+ defu = require_rolldown_runtime.__toESM(defu);
8
+ let __alloy_js_core = require("@alloy-js/core");
9
+ let __alloy_js_typescript = require("@alloy-js/typescript");
2
10
 
3
- exports.ReactOptimizedBuiltin = require_react_optimized.ReactOptimizedBuiltin;
11
+ //#region src/components/react-optimized.tsx
12
+ const isOptimizationEnabledRefkey = require_refkey.refkey("isOptimizationEnabled");
13
+ /**
14
+ * Generates the `react/optimized` builtin module for the Powerlines project.
15
+ */
16
+ function ReactOptimizedBuiltin(props) {
17
+ const [{ override }, rest] = (0, __alloy_js_core.splitProps)(props, ["override"]);
18
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_builtin_file.BuiltinFile, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, {
19
+ id: "react/optimized",
20
+ description: "A built-in module to provide access to environment configuration to determine React optimizations.",
21
+ get imports() {
22
+ return (0, defu.default)({ $builtins: { env: ["env", "isDevelopment"] } }, rest.imports ?? {});
23
+ },
24
+ get children() {
25
+ return [(0, __alloy_js_core_jsx_runtime.createComponent)(require_tsdoc.TSDoc, {
26
+ heading: "A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.",
27
+ get children() {
28
+ return [(0, __alloy_js_core_jsx_runtime.createComponent)(require_tsdoc.TSDocLink, { children: `https://react.dev/reference/react-compiler/gating` }), (0, __alloy_js_core_jsx_runtime.createComponent)(require_tsdoc.TSDocReturns, { children: `A boolean indicating if the React compiler's optimizations should be used.` })];
29
+ }
30
+ }), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
31
+ refkey: isOptimizationEnabledRefkey,
32
+ async: false,
33
+ "export": true,
34
+ name: "isOptimizationEnabled",
35
+ returnType: "boolean",
36
+ get children() {
37
+ return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
38
+ when: override !== void 0,
39
+ fallback: __alloy_js_core.code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `,
40
+ children: __alloy_js_core.code`return ${override};`
41
+ }), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
42
+ }
43
+ })];
44
+ }
45
+ }));
46
+ }
47
+
48
+ //#endregion
49
+ exports.ReactOptimizedBuiltin = ReactOptimizedBuiltin;
@@ -1,3 +1,14 @@
1
- import "../resolved-CTt23qfE.cjs";
2
- import { n as ReactOptimizedBuiltinProps, r as __ΩReactOptimizedBuiltinProps, t as ReactOptimizedBuiltin } from "../react-optimized-NGRcJkqA.cjs";
1
+ import { BuiltinFileProps } from "../plugin-alloy/src/typescript/components/builtin-file.cjs";
2
+ import * as _alloy_js_core0 from "@alloy-js/core";
3
+
4
+ //#region src/components/react-optimized.d.ts
5
+ interface ReactOptimizedBuiltinProps extends Omit<BuiltinFileProps, "id"> {
6
+ override?: boolean;
7
+ }
8
+ /**
9
+ * Generates the `react/optimized` builtin module for the Powerlines project.
10
+ */
11
+ declare function ReactOptimizedBuiltin(props: ReactOptimizedBuiltinProps): _alloy_js_core0.Children;
12
+ declare type __ΩReactOptimizedBuiltinProps = any[];
13
+ //#endregion
3
14
  export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps };
@@ -1,4 +1,14 @@
1
- import "../resolved-Nive48eM.mjs";
2
- import "../components-Bs3-ohmM.mjs";
3
- import { n as ReactOptimizedBuiltinProps, r as __ΩReactOptimizedBuiltinProps, t as ReactOptimizedBuiltin } from "../react-optimized-CVXQfO40.mjs";
1
+ import { BuiltinFileProps } from "../plugin-alloy/src/typescript/components/builtin-file.mjs";
2
+ import * as _alloy_js_core0 from "@alloy-js/core";
3
+
4
+ //#region src/components/react-optimized.d.ts
5
+ interface ReactOptimizedBuiltinProps extends Omit<BuiltinFileProps, "id"> {
6
+ override?: boolean;
7
+ }
8
+ /**
9
+ * Generates the `react/optimized` builtin module for the Powerlines project.
10
+ */
11
+ declare function ReactOptimizedBuiltin(props: ReactOptimizedBuiltinProps): _alloy_js_core0.Children;
12
+ declare type __ΩReactOptimizedBuiltinProps = any[];
13
+ //#endregion
4
14
  export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps };
@@ -1,3 +1,47 @@
1
- import { t as ReactOptimizedBuiltin } from "../react-optimized-BpFTLlx0.mjs";
1
+ import { refkey as refkey$1 } from "../plugin-alloy/src/helpers/refkey.mjs";
2
+ import { TSDoc, TSDocLink, TSDocReturns } from "../plugin-alloy/src/typescript/components/tsdoc.mjs";
3
+ import { BuiltinFile } from "../plugin-alloy/src/typescript/components/builtin-file.mjs";
4
+ import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
5
+ import defu from "defu";
6
+ import { Show, code, splitProps } from "@alloy-js/core";
7
+ import { FunctionDeclaration } from "@alloy-js/typescript";
2
8
 
9
+ //#region src/components/react-optimized.tsx
10
+ const isOptimizationEnabledRefkey = refkey$1("isOptimizationEnabled");
11
+ /**
12
+ * Generates the `react/optimized` builtin module for the Powerlines project.
13
+ */
14
+ function ReactOptimizedBuiltin(props) {
15
+ const [{ override }, rest] = splitProps(props, ["override"]);
16
+ return createComponent(BuiltinFile, mergeProps(rest, {
17
+ id: "react/optimized",
18
+ description: "A built-in module to provide access to environment configuration to determine React optimizations.",
19
+ get imports() {
20
+ return defu({ $builtins: { env: ["env", "isDevelopment"] } }, rest.imports ?? {});
21
+ },
22
+ get children() {
23
+ return [createComponent(TSDoc, {
24
+ heading: "A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.",
25
+ get children() {
26
+ return [createComponent(TSDocLink, { children: `https://react.dev/reference/react-compiler/gating` }), createComponent(TSDocReturns, { children: `A boolean indicating if the React compiler's optimizations should be used.` })];
27
+ }
28
+ }), createComponent(FunctionDeclaration, {
29
+ refkey: isOptimizationEnabledRefkey,
30
+ async: false,
31
+ "export": true,
32
+ name: "isOptimizationEnabled",
33
+ returnType: "boolean",
34
+ get children() {
35
+ return [createComponent(Show, {
36
+ when: override !== void 0,
37
+ fallback: code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `,
38
+ children: code`return ${override};`
39
+ }), createIntrinsic("hbr", {})];
40
+ }
41
+ })];
42
+ }
43
+ }));
44
+ }
45
+
46
+ //#endregion
3
47
  export { ReactOptimizedBuiltin };