@powerlines/plugin-react 0.1.289 → 0.1.291

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 (61) 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 -2
  4. package/dist/components/index.d.mts +1 -2
  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 +15 -2
  8. package/dist/components/react-optimized.d.cts.map +1 -0
  9. package/dist/components/react-optimized.d.mts +15 -2
  10. package/dist/components/react-optimized.d.mts.map +1 -0
  11. package/dist/components/react-optimized.mjs +47 -2
  12. package/dist/components/react-optimized.mjs.map +1 -0
  13. package/dist/index.cjs +9 -11
  14. package/dist/index.d.cts +5 -5
  15. package/dist/index.d.mts +5 -5
  16. package/dist/index.mjs +2 -5
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/types/index.cjs +0 -3
  19. package/dist/types/index.d.cts +2 -3
  20. package/dist/types/index.d.mts +2 -3
  21. package/dist/types/index.mjs +0 -4
  22. package/dist/types/plugin.cjs +0 -1
  23. package/dist/types/plugin.d.cts +74 -2
  24. package/dist/types/plugin.d.cts.map +1 -0
  25. package/dist/types/plugin.d.mts +74 -2
  26. package/dist/types/plugin.d.mts.map +1 -0
  27. package/dist/types/plugin.mjs +0 -2
  28. package/dist/types/runtime.cjs +0 -1
  29. package/dist/types/runtime.d.cts +16 -2
  30. package/dist/types/runtime.d.cts.map +1 -0
  31. package/dist/types/runtime.d.mts +16 -2
  32. package/dist/types/runtime.d.mts.map +1 -0
  33. package/dist/types/runtime.mjs +0 -2
  34. package/package.json +7 -7
  35. package/dist/components-BWLXb7a2.cjs +0 -0
  36. package/dist/components-D-mbfYAe.mjs +0 -1
  37. package/dist/index-BL32-cvv.d.cts +0 -1
  38. package/dist/index-Bk0eNZmQ.d.mts +0 -1
  39. package/dist/index-CmCelmEL.d.cts +0 -1
  40. package/dist/index-vkGVyY9v.d.mts +0 -1
  41. package/dist/plugin-DVsOZIzd.d.cts +0 -74
  42. package/dist/plugin-DVsOZIzd.d.cts.map +0 -1
  43. package/dist/plugin-DhNM9Rg6.d.mts +0 -74
  44. package/dist/plugin-DhNM9Rg6.d.mts.map +0 -1
  45. package/dist/plugin-jZ9N9Mz-.mjs +0 -1
  46. package/dist/plugin-pBKbb5K9.cjs +0 -0
  47. package/dist/react-optimized-CTa8f7Os.d.mts +0 -15
  48. package/dist/react-optimized-CTa8f7Os.d.mts.map +0 -1
  49. package/dist/react-optimized-D1ur_Vdk.d.cts +0 -15
  50. package/dist/react-optimized-D1ur_Vdk.d.cts.map +0 -1
  51. package/dist/react-optimized-DR69Ucl1.mjs +0 -48
  52. package/dist/react-optimized-DR69Ucl1.mjs.map +0 -1
  53. package/dist/react-optimized-Da8x1wtW.cjs +0 -86
  54. package/dist/runtime-BKY6WvHV.mjs +0 -1
  55. package/dist/runtime-Bj2UD25S.d.mts +0 -16
  56. package/dist/runtime-Bj2UD25S.d.mts.map +0 -1
  57. package/dist/runtime-Bp9G0scd.cjs +0 -0
  58. package/dist/runtime-Co2VNPJW.d.cts +0 -16
  59. package/dist/runtime-Co2VNPJW.d.cts.map +0 -1
  60. package/dist/types--fVOUYBq.mjs +0 -1
  61. 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-Da8x1wtW.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,3 +1,2 @@
1
- import { n as ReactOptimizedBuiltinProps, r as __ΩReactOptimizedBuiltinProps, t as ReactOptimizedBuiltin } from "../react-optimized-D1ur_Vdk.cjs";
2
- import "../index-CmCelmEL.cjs";
1
+ import { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps } from "./react-optimized.cjs";
3
2
  export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps };
@@ -1,3 +1,2 @@
1
- import { n as ReactOptimizedBuiltinProps, r as __ΩReactOptimizedBuiltinProps, t as ReactOptimizedBuiltin } from "../react-optimized-CTa8f7Os.mjs";
2
- import "../index-vkGVyY9v.mjs";
1
+ import { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps } from "./react-optimized.mjs";
3
2
  export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps };
@@ -1,4 +1,3 @@
1
- import { t as ReactOptimizedBuiltin } from "../react-optimized-DR69Ucl1.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-Da8x1wtW.cjs');
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
+ let defu = require("defu");
4
+ defu = require_rolldown_runtime.__toESM(defu);
5
+ let __alloy_js_core = require("@alloy-js/core");
6
+ let __alloy_js_typescript = require("@alloy-js/typescript");
7
+ let __powerlines_plugin_alloy_helpers_refkey = require("@powerlines/plugin-alloy/helpers/refkey");
8
+ let __powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
9
+ let __powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
2
10
 
3
- exports.ReactOptimizedBuiltin = require_react_optimized.ReactOptimizedBuiltin;
11
+ //#region src/components/react-optimized.tsx
12
+ const isOptimizationEnabledRefkey = (0, __powerlines_plugin_alloy_helpers_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)(__powerlines_plugin_alloy_typescript_components_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 builtinImports() {
22
+ return (0, defu.default)({ env: ["env", "isDevelopment"] }, rest.builtinImports ?? {});
23
+ },
24
+ get children() {
25
+ return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_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)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://react.dev/reference/react-compiler/gating` }), (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_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,2 +1,15 @@
1
- import { n as ReactOptimizedBuiltinProps, r as __ΩReactOptimizedBuiltinProps, t as ReactOptimizedBuiltin } from "../react-optimized-D1ur_Vdk.cjs";
2
- export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps };
1
+ import * as _alloy_js_core0 from "@alloy-js/core";
2
+ import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
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
14
+ export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps };
15
+ //# sourceMappingURL=react-optimized.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-optimized.d.cts","names":[],"sources":["../../src/components/react-optimized.tsx"],"sourcesContent":[],"mappings":";;;;UAgCiB,0BAAA,SAAmC,KAClD;;;AADF;AAYA;;iBAAgB,qBAAA,QAA6B,6BAA0B,eAAA,CAAA"}
@@ -1,2 +1,15 @@
1
- import { n as ReactOptimizedBuiltinProps, r as __ΩReactOptimizedBuiltinProps, t as ReactOptimizedBuiltin } from "../react-optimized-CTa8f7Os.mjs";
2
- export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps };
1
+ import * as _alloy_js_core0 from "@alloy-js/core";
2
+ import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
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
14
+ export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps };
15
+ //# sourceMappingURL=react-optimized.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-optimized.d.mts","names":[],"sources":["../../src/components/react-optimized.tsx"],"sourcesContent":[],"mappings":";;;;UAgCiB,0BAAA,SAAmC,KAClD;;;AADF;AAYA;;iBAAgB,qBAAA,QAA6B,6BAA0B,eAAA,CAAA"}
@@ -1,3 +1,48 @@
1
- import { t as ReactOptimizedBuiltin } from "../react-optimized-DR69Ucl1.mjs";
1
+ import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
2
+ import defu from "defu";
3
+ import { Show, code, splitProps } from "@alloy-js/core";
4
+ import { FunctionDeclaration } from "@alloy-js/typescript";
5
+ import { refkey } from "@powerlines/plugin-alloy/helpers/refkey";
6
+ import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
7
+ import { TSDoc, TSDocLink, TSDocReturns } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
2
8
 
3
- export { ReactOptimizedBuiltin };
9
+ //#region src/components/react-optimized.tsx
10
+ const isOptimizationEnabledRefkey = refkey("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 builtinImports() {
20
+ return defu({ env: ["env", "isDevelopment"] }, rest.builtinImports ?? {});
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
47
+ export { ReactOptimizedBuiltin };
48
+ //# sourceMappingURL=react-optimized.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-optimized.mjs","names":["code","Show","splitProps","FunctionDeclaration","refkey","BuiltinFile","TSDoc","TSDocLink","TSDocReturns","defu","isOptimizationEnabledRefkey","ReactOptimizedBuiltin","props","override","rest","_$createComponent","_$mergeProps","id","description","builtinImports","env","children","heading","async","name","returnType","when","undefined","fallback","_$createIntrinsic"],"sources":["../../src/components/react-optimized.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport { FunctionDeclaration } from \"@alloy-js/typescript\";\nimport { refkey } from \"@powerlines/plugin-alloy/helpers/refkey\";\nimport {\n BuiltinFile,\n BuiltinFileProps\n} from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport {\n TSDoc,\n TSDocLink,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport defu from \"defu\";\n\nexport interface ReactOptimizedBuiltinProps extends Omit<\n BuiltinFileProps,\n \"id\"\n> {\n override?: boolean;\n}\n\nconst isOptimizationEnabledRefkey = refkey(\"isOptimizationEnabled\");\n\n/**\n * Generates the `react/optimized` builtin module for the Powerlines project.\n */\nexport function ReactOptimizedBuiltin(props: ReactOptimizedBuiltinProps) {\n const [{ override }, rest] = splitProps(props, [\"override\"]);\n\n return (\n <BuiltinFile\n {...rest}\n id=\"react/optimized\"\n description=\"A built-in module to provide access to environment configuration to determine React optimizations.\"\n builtinImports={defu(\n { env: [\"env\", \"isDevelopment\"] },\n rest.builtinImports ?? {}\n )}>\n <TSDoc heading=\"A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.\">\n <TSDocLink>\n {`https://react.dev/reference/react-compiler/gating`}\n </TSDocLink>\n <TSDocReturns>\n {`A boolean indicating if the React compiler's optimizations should be used.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n refkey={isOptimizationEnabledRefkey}\n async={false}\n export={true}\n name=\"isOptimizationEnabled\"\n returnType=\"boolean\">\n <Show\n when={override !== undefined}\n fallback={code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `}>{code`return ${override};`}</Show>\n <hbr />\n </FunctionDeclaration>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;AAuCA,MAAMU,8BAA8BN,OAAO,wBAAwB;;;;AAKnE,SAAgBO,sBAAsBC,OAAmC;CACvE,MAAM,CAAC,EAAEC,YAAYC,QAAQZ,WAAWU,OAAO,CAAC,WAAW,CAAC;AAE5D,QAAAG,gBACGV,aAAWW,WACNF,MAAI;EACRG,IAAE;EACFC,aAAW;EAAA,IACXC,iBAAc;AAAA,UAAEV,KACd,EAAEW,KAAK,CAAC,OAAO,gBAAe,EAAG,EACjCN,KAAKK,kBAAkB,EACzB,CAAC;;EAAA,IAAAE,WAAA;AAAA,UAAA,CAAAN,gBACAT,OAAK;IAACgB,SAAO;IAAA,IAAAD,WAAA;AAAA,YAAA,CAAAN,gBACXR,WAAS,EAAAc,UACP,qDAAmD,CAAA,EAAAN,gBAErDP,cAAY,EAAAa,UACV,8EAA4E,CAAA,CAAA;;IAAA,CAAA,EAAAN,gBAGhFZ,qBAAmB;IAClBC,QAAQM;IACRa,OAAO;IAAK,UACJ;IACRC,MAAI;IACJC,YAAU;IAAA,IAAAJ,WAAA;AAAA,YAAA,CAAAN,gBACTd,MAAI;MACHyB,MAAMb,aAAac;MACnBC,UAAU5B,IAAI;MAAwDqB,UAAGrB,IAAI,UAAUa,SAAQ;MAAG,CAAA,EAAAgB,gBAAA,OAAA,EAAA,CAAA,CAAA;;IAAA,CAAA,CAAA;;EAAA,CAAA,CAAA"}
package/dist/index.cjs CHANGED
@@ -1,21 +1,19 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_react_optimized = require('./react-optimized-Da8x1wtW.cjs');
3
- require('./components-BWLXb7a2.cjs');
4
- require('./plugin-pBKbb5K9.cjs');
5
- require('./runtime-Bp9G0scd.cjs');
6
- require('./types-a8gm_IaQ.cjs');
2
+ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
+ const require_components_react_optimized = require('./components/react-optimized.cjs');
4
+ require('./components/index.cjs');
7
5
  let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
8
6
  let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
9
7
  let __powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
10
8
  let __powerlines_plugin_babel = require("@powerlines/plugin-babel");
11
- __powerlines_plugin_babel = require_react_optimized.__toESM(__powerlines_plugin_babel);
9
+ __powerlines_plugin_babel = require_rolldown_runtime.__toESM(__powerlines_plugin_babel);
12
10
  let __powerlines_plugin_env = require("@powerlines/plugin-env");
13
- __powerlines_plugin_env = require_react_optimized.__toESM(__powerlines_plugin_env);
11
+ __powerlines_plugin_env = require_rolldown_runtime.__toESM(__powerlines_plugin_env);
14
12
  let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
15
13
  let __vitejs_plugin_react = require("@vitejs/plugin-react");
16
- __vitejs_plugin_react = require_react_optimized.__toESM(__vitejs_plugin_react);
14
+ __vitejs_plugin_react = require_rolldown_runtime.__toESM(__vitejs_plugin_react);
17
15
  let defu = require("defu");
18
- defu = require_react_optimized.__toESM(defu);
16
+ defu = require_rolldown_runtime.__toESM(defu);
19
17
  let powerlines_lib_typescript_tsconfig = require("powerlines/lib/typescript/tsconfig");
20
18
 
21
19
  //#region src/index.tsx
@@ -94,7 +92,7 @@ const plugin = (options = {}) => {
94
92
  },
95
93
  async prepare() {
96
94
  const _self$ = this;
97
- return (0, __powerlines_plugin_alloy_render.render)(this, (0, __alloy_js_core_jsx_runtime.createComponent)(require_react_optimized.ReactOptimizedBuiltin, { get override() {
95
+ return (0, __powerlines_plugin_alloy_render.render)(this, (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_react_optimized.ReactOptimizedBuiltin, { get override() {
98
96
  return _self$.config.react.compiler === false ? false : void 0;
99
97
  } }));
100
98
  }
@@ -104,6 +102,6 @@ const plugin = (options = {}) => {
104
102
  var src_default = plugin;
105
103
 
106
104
  //#endregion
107
- exports.ReactOptimizedBuiltin = require_react_optimized.ReactOptimizedBuiltin;
105
+ exports.ReactOptimizedBuiltin = require_components_react_optimized.ReactOptimizedBuiltin;
108
106
  exports.default = src_default;
109
107
  exports.plugin = plugin;
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
- import { n as ReactOptimizedBuiltinProps, r as __ΩReactOptimizedBuiltinProps, t as ReactOptimizedBuiltin } from "./react-optimized-D1ur_Vdk.cjs";
2
- import "./index-CmCelmEL.cjs";
3
- import { a as ReactPluginUserConfig, c as __ΩReactPluginOptions, i as ReactPluginResolvedConfig, l as __ΩReactPluginResolvedConfig, n as ReactPluginContext, o as __ΩReactCompilerOptions, r as ReactPluginOptions, s as __ΩReactPluginContext, t as ReactCompilerOptions, u as __ΩReactPluginUserConfig } from "./plugin-DVsOZIzd.cjs";
4
- import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "./runtime-Co2VNPJW.cjs";
5
- import "./index-BL32-cvv.cjs";
1
+ import { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps } from "./components/react-optimized.cjs";
2
+ import "./components/index.cjs";
3
+ import { ReactCompilerOptions, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig } from "./types/plugin.cjs";
4
+ import { ReactEnvInterface, __ΩReactEnvInterface } from "./types/runtime.cjs";
5
+ import "./types/index.cjs";
6
6
  import { Plugin } from "powerlines/types/plugin";
7
7
 
8
8
  //#region src/index.d.ts
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { n as ReactOptimizedBuiltinProps, r as __ΩReactOptimizedBuiltinProps, t as ReactOptimizedBuiltin } from "./react-optimized-CTa8f7Os.mjs";
2
- import "./index-vkGVyY9v.mjs";
3
- import { a as ReactPluginUserConfig, c as __ΩReactPluginOptions, i as ReactPluginResolvedConfig, l as __ΩReactPluginResolvedConfig, n as ReactPluginContext, o as __ΩReactCompilerOptions, r as ReactPluginOptions, s as __ΩReactPluginContext, t as ReactCompilerOptions, u as __ΩReactPluginUserConfig } from "./plugin-DhNM9Rg6.mjs";
4
- import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "./runtime-Bj2UD25S.mjs";
5
- import "./index-Bk0eNZmQ.mjs";
1
+ import { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps } from "./components/react-optimized.mjs";
2
+ import "./components/index.mjs";
3
+ import { ReactCompilerOptions, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig } from "./types/plugin.mjs";
4
+ import { ReactEnvInterface, __ΩReactEnvInterface } from "./types/runtime.mjs";
5
+ import "./types/index.mjs";
6
6
  import { Plugin } from "powerlines/types/plugin";
7
7
 
8
8
  //#region src/index.d.ts
package/dist/index.mjs CHANGED
@@ -1,8 +1,5 @@
1
- import { t as ReactOptimizedBuiltin } from "./react-optimized-DR69Ucl1.mjs";
2
- import "./components-D-mbfYAe.mjs";
3
- import "./plugin-jZ9N9Mz-.mjs";
4
- import "./runtime-BKY6WvHV.mjs";
5
- import "./types--fVOUYBq.mjs";
1
+ import { ReactOptimizedBuiltin } from "./components/react-optimized.mjs";
2
+ import "./components/index.mjs";
6
3
  import { createComponent } from "@alloy-js/core/jsx-runtime";
7
4
  import { ReflectionKind, ReflectionVisibility } from "@powerlines/deepkit/vendor/type";
8
5
  import { render } from "@powerlines/plugin-alloy/render";
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["ReflectionKind","ReflectionVisibility","render","babel","env","LogLevelLabel","viteReactPlugin","defu","isMatchFound","ReactOptimizedBuiltin","plugin","options","name","config","react","jsxImportSource","tsconfig","tsconfigJson","compilerOptions","jsxRuntime","compiler","target","compilationMode","gating","source","framework","importSpecifierName","enableReanimatedCheck","logger","logEvent","filename","event","log","kind","SUCCESS","INFO","DEBUG","TRACE","ERROR","depArrayLoc","identifierName","decorations","filter","dec","map","join","reason","detail","category","description","measurement","entryType","duration","fnLoc","configResolved","dependencies","devDependencies","transform","plugins","push","lib","module","jsx","environment","consumer","resolveJsonModule","build","variant","types","viteBuildConfig","unshift","reactRefreshHost","hasProperty","addProperty","optional","readonly","visibility","public","type","boolean","default","prepare","_self$","_$createComponent","override","undefined"],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n ReflectionKind,\n ReflectionVisibility\n} from \"@powerlines/deepkit/vendor/type\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport babel from \"@powerlines/plugin-babel\";\nimport env from \"@powerlines/plugin-env\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport viteReactPlugin from \"@vitejs/plugin-react\";\nimport type { LoggerEvent } from \"babel-plugin-react-compiler\";\nimport defu from \"defu\";\nimport { isMatchFound } from \"powerlines/lib/typescript/tsconfig\";\nimport type { ViteResolvedBuildConfig } from \"powerlines/types/build\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport type { BabelResolvedConfig } from \"powerlines/types/resolved\";\nimport { ReactOptimizedBuiltin } from \"./components/react-optimized\";\nimport type { ReactPluginContext, ReactPluginOptions } from \"./types/plugin\";\n\nexport * from \"./components\";\nexport * from \"./types\";\n\n/**\n * A package containing a Powerlines plugin for building a React application.\n */\nexport const plugin = <\n TContext extends ReactPluginContext = ReactPluginContext\n>(\n options: ReactPluginOptions = {}\n) => {\n return [\n babel(options.babel),\n env(options.env),\n {\n name: \"react\",\n config() {\n return defu(\n {\n react: options\n },\n {\n react: {\n jsxImportSource: this.tsconfig.tsconfigJson.compilerOptions\n ?.jsxImportSource as string\n }\n },\n {\n react: {\n jsxRuntime: \"automatic\",\n jsxImportSource: \"react\",\n compiler: {\n target: \"19\",\n compilationMode: \"infer\",\n gating: {\n source: `${this.config.framework}:react/optimized`,\n importSpecifierName: \"isOptimizationEnabled\"\n },\n enableReanimatedCheck: true,\n logger: {\n logEvent: (filename: string | null, event: LoggerEvent) => {\n this.log(\n event.kind === \"CompileSuccess\"\n ? LogLevelLabel.SUCCESS\n : event.kind === \"AutoDepsEligible\" ||\n event.kind === \"AutoDepsDecorations\"\n ? LogLevelLabel.INFO\n : event.kind === \"CompileSkip\" ||\n event.kind === \"CompileDiagnostic\"\n ? LogLevelLabel.DEBUG\n : event.kind === \"Timing\"\n ? LogLevelLabel.TRACE\n : LogLevelLabel.ERROR,\n `(${filename}) ${\n event.kind === \"CompileSuccess\"\n ? `React Compiler Success`\n : event.kind === \"AutoDepsEligible\"\n ? `React AutoDeps Eligible - ${\n event.depArrayLoc.identifierName ||\n \"No identifier\"\n }`\n : event.kind === \"AutoDepsDecorations\"\n ? `React AutoDeps Decorations - ${event.decorations\n .filter(dec => dec.identifierName)\n .map(dec => dec.identifierName)\n .join(\", \")}`\n : event.kind === \"CompileSkip\"\n ? `React Compile Skip - ${event.reason}`\n : event.kind === \"CompileDiagnostic\"\n ? `React Compile Diagnostic - (Category: ${\n event.detail.category\n }) ${event.detail.reason}${\n event.detail.description\n ? `\\n${event.detail.description}`\n : \"\"\n }`\n : event.kind === \"Timing\"\n ? `React ${event.measurement.entryType} Timing (${event.measurement.name}) - ${event.measurement.duration}ms`\n : `React Compiler Error - ${event.fnLoc?.identifierName || \"unknown location\"}`\n }`\n );\n }\n }\n }\n } as ReactPluginOptions\n }\n );\n },\n configResolved() {\n this.dependencies.react = \"^19.2.3\";\n this.dependencies[\"react-dom\"] = \"^19.2.3\";\n\n this.devDependencies[\"@types/react\"] = \"^19.2.3\";\n this.devDependencies[\"@types/react-dom\"] = \"^19.2.3\";\n\n if (this.config.react.compiler !== false) {\n this.config.transform.babel ??= {} as BabelResolvedConfig;\n\n this.config.transform.babel.plugins ??= [];\n this.config.transform.babel.plugins.push([\n \"babel-plugin-react-compiler\",\n this.config.react.compiler\n ]);\n }\n\n this.tsconfig.tsconfigJson.compilerOptions ??= {};\n this.tsconfig.tsconfigJson.compilerOptions.lib ??= [];\n this.tsconfig.tsconfigJson.compilerOptions.module ??= \"esnext\";\n this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource =\n this.config.react.jsxImportSource;\n\n if (this.tsconfig.options.jsxImportSource === \"react\") {\n this.tsconfig.tsconfigJson.compilerOptions.jsx ??= \"react-jsx\";\n } else {\n this.tsconfig.tsconfigJson.compilerOptions.jsx ??= \"preserve\";\n }\n\n // Client platform\n if (this.environment.consumer === \"client\") {\n if (\n !isMatchFound(\"dom\", this.tsconfig.tsconfigJson.compilerOptions.lib)\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.lib.push(\"DOM\");\n }\n\n if (\n !isMatchFound(\n \"dom.iterable\",\n this.tsconfig.tsconfigJson.compilerOptions.lib\n )\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.lib.push(\"DOM.Iterable\");\n }\n }\n\n if (\n !isMatchFound(\n \"esnext\",\n this.tsconfig.tsconfigJson.compilerOptions.lib\n )\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.lib.push(\"ESNext\");\n }\n\n if (this.tsconfig.options.resolveJsonModule !== true) {\n this.tsconfig.tsconfigJson.compilerOptions.resolveJsonModule = true;\n }\n\n if (this.config.build.variant === \"vite\") {\n this.tsconfig.tsconfigJson.compilerOptions.types ??= [];\n\n if (\n !isMatchFound(\n \"vite/client\",\n this.tsconfig.tsconfigJson.compilerOptions.types\n )\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.types.push(\n \"vite/client\"\n );\n }\n\n const viteBuildConfig = this.config.build as ViteResolvedBuildConfig;\n viteBuildConfig.build ??= {};\n viteBuildConfig.build.target = \"chrome95\";\n\n viteBuildConfig.plugins ??= [];\n viteBuildConfig.plugins.unshift(\n viteReactPlugin({\n babel: this.config.transform.babel,\n jsxImportSource: this.config.react.jsxImportSource,\n jsxRuntime: this.config.react.jsxRuntime,\n reactRefreshHost: this.config.react.reactRefreshHost\n })\n );\n }\n\n if (\n this.env?.types?.env &&\n !this.env.types.env.hasProperty(\"DISABLE_REACT_COMPILER\")\n ) {\n this.env.types.env.addProperty({\n name: \"DISABLE_REACT_COMPILER\",\n optional: true,\n readonly: true,\n description: \"Disables the React compiler optimizations.\",\n visibility: ReflectionVisibility.public,\n type: {\n kind: ReflectionKind.boolean\n },\n default: false\n });\n }\n },\n async prepare() {\n return render(\n this,\n <ReactOptimizedBuiltin\n override={this.config.react.compiler === false ? false : undefined}\n />\n );\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.mjs","names":["ReflectionKind","ReflectionVisibility","render","babel","env","LogLevelLabel","viteReactPlugin","defu","isMatchFound","ReactOptimizedBuiltin","plugin","options","name","config","react","jsxImportSource","tsconfig","tsconfigJson","compilerOptions","jsxRuntime","compiler","target","compilationMode","gating","source","framework","importSpecifierName","enableReanimatedCheck","logger","logEvent","filename","event","log","kind","SUCCESS","INFO","DEBUG","TRACE","ERROR","depArrayLoc","identifierName","decorations","filter","dec","map","join","reason","detail","category","description","measurement","entryType","duration","fnLoc","configResolved","dependencies","devDependencies","transform","plugins","push","lib","module","jsx","environment","consumer","resolveJsonModule","build","variant","types","viteBuildConfig","unshift","reactRefreshHost","hasProperty","addProperty","optional","readonly","visibility","public","type","boolean","default","prepare","_self$","_$createComponent","override","undefined"],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n ReflectionKind,\n ReflectionVisibility\n} from \"@powerlines/deepkit/vendor/type\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport babel from \"@powerlines/plugin-babel\";\nimport env from \"@powerlines/plugin-env\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport viteReactPlugin from \"@vitejs/plugin-react\";\nimport type { LoggerEvent } from \"babel-plugin-react-compiler\";\nimport defu from \"defu\";\nimport { isMatchFound } from \"powerlines/lib/typescript/tsconfig\";\nimport type { ViteResolvedBuildConfig } from \"powerlines/types/build\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport type { BabelResolvedConfig } from \"powerlines/types/resolved\";\nimport { ReactOptimizedBuiltin } from \"./components/react-optimized\";\nimport type { ReactPluginContext, ReactPluginOptions } from \"./types/plugin\";\n\nexport * from \"./components\";\nexport * from \"./types\";\n\n/**\n * A package containing a Powerlines plugin for building a React application.\n */\nexport const plugin = <\n TContext extends ReactPluginContext = ReactPluginContext\n>(\n options: ReactPluginOptions = {}\n) => {\n return [\n babel(options.babel),\n env(options.env),\n {\n name: \"react\",\n config() {\n return defu(\n {\n react: options\n },\n {\n react: {\n jsxImportSource: this.tsconfig.tsconfigJson.compilerOptions\n ?.jsxImportSource as string\n }\n },\n {\n react: {\n jsxRuntime: \"automatic\",\n jsxImportSource: \"react\",\n compiler: {\n target: \"19\",\n compilationMode: \"infer\",\n gating: {\n source: `${this.config.framework}:react/optimized`,\n importSpecifierName: \"isOptimizationEnabled\"\n },\n enableReanimatedCheck: true,\n logger: {\n logEvent: (filename: string | null, event: LoggerEvent) => {\n this.log(\n event.kind === \"CompileSuccess\"\n ? LogLevelLabel.SUCCESS\n : event.kind === \"AutoDepsEligible\" ||\n event.kind === \"AutoDepsDecorations\"\n ? LogLevelLabel.INFO\n : event.kind === \"CompileSkip\" ||\n event.kind === \"CompileDiagnostic\"\n ? LogLevelLabel.DEBUG\n : event.kind === \"Timing\"\n ? LogLevelLabel.TRACE\n : LogLevelLabel.ERROR,\n `(${filename}) ${\n event.kind === \"CompileSuccess\"\n ? `React Compiler Success`\n : event.kind === \"AutoDepsEligible\"\n ? `React AutoDeps Eligible - ${\n event.depArrayLoc.identifierName ||\n \"No identifier\"\n }`\n : event.kind === \"AutoDepsDecorations\"\n ? `React AutoDeps Decorations - ${event.decorations\n .filter(dec => dec.identifierName)\n .map(dec => dec.identifierName)\n .join(\", \")}`\n : event.kind === \"CompileSkip\"\n ? `React Compile Skip - ${event.reason}`\n : event.kind === \"CompileDiagnostic\"\n ? `React Compile Diagnostic - (Category: ${\n event.detail.category\n }) ${event.detail.reason}${\n event.detail.description\n ? `\\n${event.detail.description}`\n : \"\"\n }`\n : event.kind === \"Timing\"\n ? `React ${event.measurement.entryType} Timing (${event.measurement.name}) - ${event.measurement.duration}ms`\n : `React Compiler Error - ${event.fnLoc?.identifierName || \"unknown location\"}`\n }`\n );\n }\n }\n }\n } as ReactPluginOptions\n }\n );\n },\n configResolved() {\n this.dependencies.react = \"^19.2.3\";\n this.dependencies[\"react-dom\"] = \"^19.2.3\";\n\n this.devDependencies[\"@types/react\"] = \"^19.2.3\";\n this.devDependencies[\"@types/react-dom\"] = \"^19.2.3\";\n\n if (this.config.react.compiler !== false) {\n this.config.transform.babel ??= {} as BabelResolvedConfig;\n\n this.config.transform.babel.plugins ??= [];\n this.config.transform.babel.plugins.push([\n \"babel-plugin-react-compiler\",\n this.config.react.compiler\n ]);\n }\n\n this.tsconfig.tsconfigJson.compilerOptions ??= {};\n this.tsconfig.tsconfigJson.compilerOptions.lib ??= [];\n this.tsconfig.tsconfigJson.compilerOptions.module ??= \"esnext\";\n this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource =\n this.config.react.jsxImportSource;\n\n if (this.tsconfig.options.jsxImportSource === \"react\") {\n this.tsconfig.tsconfigJson.compilerOptions.jsx ??= \"react-jsx\";\n } else {\n this.tsconfig.tsconfigJson.compilerOptions.jsx ??= \"preserve\";\n }\n\n // Client platform\n if (this.environment.consumer === \"client\") {\n if (\n !isMatchFound(\"dom\", this.tsconfig.tsconfigJson.compilerOptions.lib)\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.lib.push(\"DOM\");\n }\n\n if (\n !isMatchFound(\n \"dom.iterable\",\n this.tsconfig.tsconfigJson.compilerOptions.lib\n )\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.lib.push(\"DOM.Iterable\");\n }\n }\n\n if (\n !isMatchFound(\n \"esnext\",\n this.tsconfig.tsconfigJson.compilerOptions.lib\n )\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.lib.push(\"ESNext\");\n }\n\n if (this.tsconfig.options.resolveJsonModule !== true) {\n this.tsconfig.tsconfigJson.compilerOptions.resolveJsonModule = true;\n }\n\n if (this.config.build.variant === \"vite\") {\n this.tsconfig.tsconfigJson.compilerOptions.types ??= [];\n\n if (\n !isMatchFound(\n \"vite/client\",\n this.tsconfig.tsconfigJson.compilerOptions.types\n )\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.types.push(\n \"vite/client\"\n );\n }\n\n const viteBuildConfig = this.config.build as ViteResolvedBuildConfig;\n viteBuildConfig.build ??= {};\n viteBuildConfig.build.target = \"chrome95\";\n\n viteBuildConfig.plugins ??= [];\n viteBuildConfig.plugins.unshift(\n viteReactPlugin({\n babel: this.config.transform.babel,\n jsxImportSource: this.config.react.jsxImportSource,\n jsxRuntime: this.config.react.jsxRuntime,\n reactRefreshHost: this.config.react.reactRefreshHost\n })\n );\n }\n\n if (\n this.env?.types?.env &&\n !this.env.types.env.hasProperty(\"DISABLE_REACT_COMPILER\")\n ) {\n this.env.types.env.addProperty({\n name: \"DISABLE_REACT_COMPILER\",\n optional: true,\n readonly: true,\n description: \"Disables the React compiler optimizations.\",\n visibility: ReflectionVisibility.public,\n type: {\n kind: ReflectionKind.boolean\n },\n default: false\n });\n }\n },\n async prepare() {\n return render(\n this,\n <ReactOptimizedBuiltin\n override={this.config.react.compiler === false ? false : undefined}\n />\n );\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;AA0CA,MAAaU,UAGXC,UAA8B,EAAE,KAC7B;AACH,QAAO;EACLR,MAAMQ,QAAQR,MAAM;EACpBC,IAAIO,QAAQP,IAAI;EAChB;GACEQ,MAAM;GACNC,SAAS;AACP,WAAON,KACL,EACEO,OAAOH,SACR,EACD,EACEG,OAAO,EACLC,iBAAiB,KAAKC,SAASC,aAAaC,iBACxCH,iBACN,EACD,EACD,EACED,OAAO;KACLK,YAAY;KACZJ,iBAAiB;KACjBK,UAAU;MACRC,QAAQ;MACRC,iBAAiB;MACjBC,QAAQ;OACNC,QAAQ,GAAG,KAAKX,OAAOY,UAAS;OAChCC,qBAAqB;OACtB;MACDC,uBAAuB;MACvBC,QAAQ,EACNC,WAAWC,UAAyBC,UAAuB;AACzD,YAAKC,IACHD,MAAME,SAAS,mBACX5B,cAAc6B,UACdH,MAAME,SAAS,sBACbF,MAAME,SAAS,wBACf5B,cAAc8B,OACdJ,MAAME,SAAS,iBACbF,MAAME,SAAS,sBACf5B,cAAc+B,QACdL,MAAME,SAAS,WACb5B,cAAcgC,QACdhC,cAAciC,OACxB,IAAIR,SAAQ,IACVC,MAAME,SAAS,mBACX,2BACAF,MAAME,SAAS,qBACb,6BACEF,MAAMQ,YAAYC,kBAClB,oBAEFT,MAAME,SAAS,wBACb,gCAAgCF,MAAMU,YACnCC,QAAOC,QAAOA,IAAIH,eAAe,CACjCI,KAAID,QAAOA,IAAIH,eAAe,CAC9BK,KAAK,KAAK,KACbd,MAAME,SAAS,gBACb,wBAAwBF,MAAMe,WAC9Bf,MAAME,SAAS,sBACb,yCACEF,MAAMgB,OAAOC,SAAQ,IAClBjB,MAAMgB,OAAOD,SAChBf,MAAMgB,OAAOE,cACT,KAAKlB,MAAMgB,OAAOE,gBAClB,OAENlB,MAAME,SAAS,WACb,SAASF,MAAMmB,YAAYC,UAAS,WAAYpB,MAAMmB,YAAYtC,KAAI,MAAOmB,MAAMmB,YAAYE,SAAQ,MACvG,0BAA0BrB,MAAMsB,OAAOb,kBAAkB,uBAE1E;SAEL;MACF;KACF,EAEJ,CAAC;;GAEHc,iBAAiB;AACf,SAAKC,aAAazC,QAAQ;AAC1B,SAAKyC,aAAa,eAAe;AAEjC,SAAKC,gBAAgB,kBAAkB;AACvC,SAAKA,gBAAgB,sBAAsB;AAE3C,QAAI,KAAK3C,OAAOC,MAAMM,aAAa,OAAO;AACxC,UAAKP,OAAO4C,UAAUtD,UAAU,EAAyB;AAEzD,UAAKU,OAAO4C,UAAUtD,MAAMuD,YAAY,EAAE;AAC1C,UAAK7C,OAAO4C,UAAUtD,MAAMuD,QAAQC,KAAK,CACvC,+BACA,KAAK9C,OAAOC,MAAMM,SACnB,CAAC;;AAGJ,SAAKJ,SAASC,aAAaC,oBAAoB,EAAE;AACjD,SAAKF,SAASC,aAAaC,gBAAgB0C,QAAQ,EAAE;AACrD,SAAK5C,SAASC,aAAaC,gBAAgB2C,WAAW;AACtD,SAAK7C,SAASC,aAAaC,gBAAgBH,kBACzC,KAAKF,OAAOC,MAAMC;AAEpB,QAAI,KAAKC,SAASL,QAAQI,oBAAoB,QAC5C,MAAKC,SAASC,aAAaC,gBAAgB4C,QAAQ;QAEnD,MAAK9C,SAASC,aAAaC,gBAAgB4C,QAAQ;AAIrD,QAAI,KAAKC,YAAYC,aAAa,UAAU;AAC1C,SACE,CAACxD,aAAa,OAAO,KAAKQ,SAASC,aAAaC,gBAAgB0C,IAAI,CAEpE,MAAK5C,SAASC,aAAaC,gBAAgB0C,IAAID,KAAK,MAAM;AAG5D,SACE,CAACnD,aACC,gBACA,KAAKQ,SAASC,aAAaC,gBAAgB0C,IAC5C,CAED,MAAK5C,SAASC,aAAaC,gBAAgB0C,IAAID,KAAK,eAAe;;AAIvE,QACE,CAACnD,aACC,UACA,KAAKQ,SAASC,aAAaC,gBAAgB0C,IAC5C,CAED,MAAK5C,SAASC,aAAaC,gBAAgB0C,IAAID,KAAK,SAAS;AAG/D,QAAI,KAAK3C,SAASL,QAAQsD,sBAAsB,KAC9C,MAAKjD,SAASC,aAAaC,gBAAgB+C,oBAAoB;AAGjE,QAAI,KAAKpD,OAAOqD,MAAMC,YAAY,QAAQ;AACxC,UAAKnD,SAASC,aAAaC,gBAAgBkD,UAAU,EAAE;AAEvD,SACE,CAAC5D,aACC,eACA,KAAKQ,SAASC,aAAaC,gBAAgBkD,MAC5C,CAED,MAAKpD,SAASC,aAAaC,gBAAgBkD,MAAMT,KAC/C,cACD;KAGH,MAAMU,kBAAkB,KAAKxD,OAAOqD;AACpCG,qBAAgBH,UAAU,EAAE;AAC5BG,qBAAgBH,MAAM7C,SAAS;AAE/BgD,qBAAgBX,YAAY,EAAE;AAC9BW,qBAAgBX,QAAQY,QACtBhE,gBAAgB;MACdH,OAAO,KAAKU,OAAO4C,UAAUtD;MAC7BY,iBAAiB,KAAKF,OAAOC,MAAMC;MACnCI,YAAY,KAAKN,OAAOC,MAAMK;MAC9BoD,kBAAkB,KAAK1D,OAAOC,MAAMyD;MACrC,CACH,CAAC;;AAGH,QACE,KAAKnE,KAAKgE,OAAOhE,OACjB,CAAC,KAAKA,IAAIgE,MAAMhE,IAAIoE,YAAY,yBAAyB,CAEzD,MAAKpE,IAAIgE,MAAMhE,IAAIqE,YAAY;KAC7B7D,MAAM;KACN8D,UAAU;KACVC,UAAU;KACV1B,aAAa;KACb2B,YAAY3E,qBAAqB4E;KACjCC,MAAM,EACJ7C,MAAMjC,eAAe+E,SACtB;KACDC,SAAS;KACV,CAAC;;GAGN,MAAMC,UAAU;IAAA,MAAAC,SAAA;AACd,WAAOhF,OACL,MAAIiF,gBACH1E,uBAAqB,EAAA,IACpB2E,WAAQ;AAAA,YAAEF,OAAKrE,OAAOC,MAAMM,aAAa,QAAQ,QAAQiE;OAAS,CAEtE,CAAC;;GAEJ;EACF;;AAGH,kBAAe3E"}
@@ -1,3 +0,0 @@
1
- require('../plugin-pBKbb5K9.cjs');
2
- require('../runtime-Bp9G0scd.cjs');
3
- require('../types-a8gm_IaQ.cjs');
@@ -1,4 +1,3 @@
1
- import { a as ReactPluginUserConfig, c as __ΩReactPluginOptions, i as ReactPluginResolvedConfig, l as __ΩReactPluginResolvedConfig, n as ReactPluginContext, o as __ΩReactCompilerOptions, r as ReactPluginOptions, s as __ΩReactPluginContext, t as ReactCompilerOptions, u as __ΩReactPluginUserConfig } from "../plugin-DVsOZIzd.cjs";
2
- import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "../runtime-Co2VNPJW.cjs";
3
- import "../index-BL32-cvv.cjs";
1
+ import { ReactCompilerOptions, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig } from "./plugin.cjs";
2
+ import { ReactEnvInterface, __ΩReactEnvInterface } from "./runtime.cjs";
4
3
  export { ReactCompilerOptions, ReactEnvInterface, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactEnvInterface, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig };
@@ -1,4 +1,3 @@
1
- import { a as ReactPluginUserConfig, c as __ΩReactPluginOptions, i as ReactPluginResolvedConfig, l as __ΩReactPluginResolvedConfig, n as ReactPluginContext, o as __ΩReactCompilerOptions, r as ReactPluginOptions, s as __ΩReactPluginContext, t as ReactCompilerOptions, u as __ΩReactPluginUserConfig } from "../plugin-DhNM9Rg6.mjs";
2
- import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "../runtime-Bj2UD25S.mjs";
3
- import "../index-Bk0eNZmQ.mjs";
1
+ import { ReactCompilerOptions, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig } from "./plugin.mjs";
2
+ import { ReactEnvInterface, __ΩReactEnvInterface } from "./runtime.mjs";
4
3
  export { ReactCompilerOptions, ReactEnvInterface, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactEnvInterface, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig };
@@ -1,5 +1 @@
1
- import "../plugin-jZ9N9Mz-.mjs";
2
- import "../runtime-BKY6WvHV.mjs";
3
- import "../types--fVOUYBq.mjs";
4
-
5
1
  export { };
@@ -1 +0,0 @@
1
- require('../plugin-pBKbb5K9.cjs');
@@ -1,2 +1,74 @@
1
- import { a as ReactPluginUserConfig, c as __ΩReactPluginOptions, i as ReactPluginResolvedConfig, l as __ΩReactPluginResolvedConfig, n as ReactPluginContext, o as __ΩReactCompilerOptions, r as ReactPluginOptions, s as __ΩReactPluginContext, t as ReactCompilerOptions, u as __ΩReactPluginUserConfig } from "../plugin-DVsOZIzd.cjs";
2
- export { ReactCompilerOptions, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig };
1
+ import { BabelPluginOptions } from "@powerlines/plugin-babel/types/plugin";
2
+ import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "@powerlines/plugin-env/types/plugin";
3
+ import { PluginOptions } from "babel-plugin-react-compiler";
4
+
5
+ //#region src/types/plugin.d.ts
6
+ type ReactCompilerOptions = Omit<PluginOptions, "logger">;
7
+ interface ReactPluginOptions {
8
+ /**
9
+ * Control where the JSX factory is imported from.
10
+ *
11
+ * @see https://esbuild.github.io/api/#jsx-import-source
12
+ *
13
+ * @defaultValue "react"
14
+ */
15
+ jsxImportSource?: string;
16
+ /**
17
+ * Control how JSX is transformed.
18
+ *
19
+ * @remarks
20
+ * Skipping React import with classic runtime is not supported from v4
21
+ *
22
+ * @defaultValue "automatic"
23
+ */
24
+ jsxRuntime?: "classic" | "automatic";
25
+ /**
26
+ * Options provided to the [React Compiler](https://npmjs.com/package/babel-plugin-react-compiler).
27
+ *
28
+ * @see https://github.com/facebook/react/blob/main/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts#L55
29
+ * @see https://react.dev/blog/2025/04/21/react-compiler-rc
30
+ *
31
+ * @remarks
32
+ * Set to `false` to disable the React Compiler. By default, the React Compiler is enabled and target is set to React 19.
33
+ */
34
+ compiler?: ReactCompilerOptions | false;
35
+ /**
36
+ * React Fast Refresh runtime URL prefix.
37
+ *
38
+ * @remarks
39
+ * Useful in a module federation context to enable HMR by specifying the host application URL in the Vite config of a remote application.
40
+ *
41
+ * @example
42
+ * reactRefreshHost: 'http://localhost:3000'
43
+ */
44
+ reactRefreshHost?: string;
45
+ /**
46
+ * Options to pass to the [Babel plugin](https://npmjs.com/package/\@powerlines/plugin-babel).
47
+ */
48
+ babel?: Partial<BabelPluginOptions>;
49
+ /**
50
+ * Options to pass to the [Env plugin](https://npmjs.com/package/\@powerlines/plugin-env).
51
+ */
52
+ env?: Partial<Omit<EnvPluginOptions, "babel">>;
53
+ }
54
+ type ReactPluginUserConfig = EnvPluginUserConfig & {
55
+ /**
56
+ * Options for the React plugin.
57
+ */
58
+ react?: ReactPluginOptions;
59
+ };
60
+ type ReactPluginResolvedConfig = EnvPluginResolvedConfig & {
61
+ /**
62
+ * Options for the React plugin.
63
+ */
64
+ react: ReactPluginOptions;
65
+ };
66
+ interface ReactPluginContext<TResolvedConfig extends ReactPluginResolvedConfig = ReactPluginResolvedConfig> extends EnvPluginContext<TResolvedConfig> {}
67
+ declare type __ΩReactCompilerOptions = any[];
68
+ declare type __ΩReactPluginOptions = any[];
69
+ declare type __ΩReactPluginUserConfig = any[];
70
+ declare type __ΩReactPluginResolvedConfig = any[];
71
+ declare type __ΩReactPluginContext = any[];
72
+ //#endregion
73
+ export { ReactCompilerOptions, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig };
74
+ //# sourceMappingURL=plugin.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;KA2BY,oBAAA,GAAuB,KAAK;UAEvB,kBAAA;EAFL;AAEZ;;;;;;EAkDQ,eAAA,CAAA,EAAA,MAAA;EAAO;AAGf;AAOA;AAOA;;;;;EAE0B,UAAA,CAAA,EAAA,SAAA,GAAA,WAAA;;;;;;;;;;aAxCb;;;;;;;;;;;;;;UAgBH,QAAQ;;;;QAKV,QAAQ,KAAK;;KAGT,qBAAA,GAAwB;;;;UAI1B;;KAGE,yBAAA,GAA4B;;;;SAI/B;;UAGQ,2CACS,4BAA4B,mCAC5C,iBAAiB"}
@@ -1,2 +1,74 @@
1
- import { a as ReactPluginUserConfig, c as __ΩReactPluginOptions, i as ReactPluginResolvedConfig, l as __ΩReactPluginResolvedConfig, n as ReactPluginContext, o as __ΩReactCompilerOptions, r as ReactPluginOptions, s as __ΩReactPluginContext, t as ReactCompilerOptions, u as __ΩReactPluginUserConfig } from "../plugin-DhNM9Rg6.mjs";
2
- export { ReactCompilerOptions, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig };
1
+ import { BabelPluginOptions } from "@powerlines/plugin-babel/types/plugin";
2
+ import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "@powerlines/plugin-env/types/plugin";
3
+ import { PluginOptions } from "babel-plugin-react-compiler";
4
+
5
+ //#region src/types/plugin.d.ts
6
+ type ReactCompilerOptions = Omit<PluginOptions, "logger">;
7
+ interface ReactPluginOptions {
8
+ /**
9
+ * Control where the JSX factory is imported from.
10
+ *
11
+ * @see https://esbuild.github.io/api/#jsx-import-source
12
+ *
13
+ * @defaultValue "react"
14
+ */
15
+ jsxImportSource?: string;
16
+ /**
17
+ * Control how JSX is transformed.
18
+ *
19
+ * @remarks
20
+ * Skipping React import with classic runtime is not supported from v4
21
+ *
22
+ * @defaultValue "automatic"
23
+ */
24
+ jsxRuntime?: "classic" | "automatic";
25
+ /**
26
+ * Options provided to the [React Compiler](https://npmjs.com/package/babel-plugin-react-compiler).
27
+ *
28
+ * @see https://github.com/facebook/react/blob/main/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts#L55
29
+ * @see https://react.dev/blog/2025/04/21/react-compiler-rc
30
+ *
31
+ * @remarks
32
+ * Set to `false` to disable the React Compiler. By default, the React Compiler is enabled and target is set to React 19.
33
+ */
34
+ compiler?: ReactCompilerOptions | false;
35
+ /**
36
+ * React Fast Refresh runtime URL prefix.
37
+ *
38
+ * @remarks
39
+ * Useful in a module federation context to enable HMR by specifying the host application URL in the Vite config of a remote application.
40
+ *
41
+ * @example
42
+ * reactRefreshHost: 'http://localhost:3000'
43
+ */
44
+ reactRefreshHost?: string;
45
+ /**
46
+ * Options to pass to the [Babel plugin](https://npmjs.com/package/\@powerlines/plugin-babel).
47
+ */
48
+ babel?: Partial<BabelPluginOptions>;
49
+ /**
50
+ * Options to pass to the [Env plugin](https://npmjs.com/package/\@powerlines/plugin-env).
51
+ */
52
+ env?: Partial<Omit<EnvPluginOptions, "babel">>;
53
+ }
54
+ type ReactPluginUserConfig = EnvPluginUserConfig & {
55
+ /**
56
+ * Options for the React plugin.
57
+ */
58
+ react?: ReactPluginOptions;
59
+ };
60
+ type ReactPluginResolvedConfig = EnvPluginResolvedConfig & {
61
+ /**
62
+ * Options for the React plugin.
63
+ */
64
+ react: ReactPluginOptions;
65
+ };
66
+ interface ReactPluginContext<TResolvedConfig extends ReactPluginResolvedConfig = ReactPluginResolvedConfig> extends EnvPluginContext<TResolvedConfig> {}
67
+ declare type __ΩReactCompilerOptions = any[];
68
+ declare type __ΩReactPluginOptions = any[];
69
+ declare type __ΩReactPluginUserConfig = any[];
70
+ declare type __ΩReactPluginResolvedConfig = any[];
71
+ declare type __ΩReactPluginContext = any[];
72
+ //#endregion
73
+ export { ReactCompilerOptions, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig, __ΩReactCompilerOptions, __ΩReactPluginContext, __ΩReactPluginOptions, __ΩReactPluginResolvedConfig, __ΩReactPluginUserConfig };
74
+ //# sourceMappingURL=plugin.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;KA2BY,oBAAA,GAAuB,KAAK;UAEvB,kBAAA;EAFL;AAEZ;;;;;;EAkDQ,eAAA,CAAA,EAAA,MAAA;EAAO;AAGf;AAOA;AAOA;;;;;EAE0B,UAAA,CAAA,EAAA,SAAA,GAAA,WAAA;;;;;;;;;;aAxCb;;;;;;;;;;;;;;UAgBH,QAAQ;;;;QAKV,QAAQ,KAAK;;KAGT,qBAAA,GAAwB;;;;UAI1B;;KAGE,yBAAA,GAA4B;;;;SAI/B;;UAGQ,2CACS,4BAA4B,mCAC5C,iBAAiB"}
@@ -1,3 +1 @@
1
- import "../plugin-jZ9N9Mz-.mjs";
2
-
3
1
  export { };
@@ -1 +0,0 @@
1
- require('../runtime-Bp9G0scd.cjs');
@@ -1,2 +1,16 @@
1
- import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "../runtime-Co2VNPJW.cjs";
2
- export { ReactEnvInterface, __ΩReactEnvInterface };
1
+ import { EnvInterface } from "@powerlines/plugin-env/types/runtime";
2
+
3
+ //#region src/types/runtime.d.ts
4
+ interface ReactEnvInterface extends EnvInterface {
5
+ /**
6
+ * Disables the React compiler optimizations when set to true.
7
+ *
8
+ * @remarks
9
+ * This environment variable can be used to turn off the optimizations provided by the React compiler, which may be useful for debugging or development purposes.
10
+ */
11
+ DISABLE_REACT_COMPILER: boolean;
12
+ }
13
+ declare type __ΩReactEnvInterface = any[];
14
+ //#endregion
15
+ export { ReactEnvInterface, __ΩReactEnvInterface };
16
+ //# sourceMappingURL=runtime.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.cts","names":[],"sources":["../../src/types/runtime.ts"],"sourcesContent":[],"mappings":";;;UAoBiB,iBAAA,SAA0B;;AAA3C"}
@@ -1,2 +1,16 @@
1
- import { n as __ΩReactEnvInterface, t as ReactEnvInterface } from "../runtime-Bj2UD25S.mjs";
2
- export { ReactEnvInterface, __ΩReactEnvInterface };
1
+ import { EnvInterface } from "@powerlines/plugin-env/types/runtime";
2
+
3
+ //#region src/types/runtime.d.ts
4
+ interface ReactEnvInterface extends EnvInterface {
5
+ /**
6
+ * Disables the React compiler optimizations when set to true.
7
+ *
8
+ * @remarks
9
+ * This environment variable can be used to turn off the optimizations provided by the React compiler, which may be useful for debugging or development purposes.
10
+ */
11
+ DISABLE_REACT_COMPILER: boolean;
12
+ }
13
+ declare type __ΩReactEnvInterface = any[];
14
+ //#endregion
15
+ export { ReactEnvInterface, __ΩReactEnvInterface };
16
+ //# sourceMappingURL=runtime.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.mts","names":[],"sources":["../../src/types/runtime.ts"],"sourcesContent":[],"mappings":";;;UAoBiB,iBAAA,SAA0B;;AAA3C"}
@@ -1,3 +1 @@
1
- import "../runtime-BKY6WvHV.mjs";
2
-
3
1
  export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-react",
3
- "version": "0.1.289",
3
+ "version": "0.1.291",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin for building a React application.",
6
6
  "repository": {
@@ -141,9 +141,9 @@
141
141
  "@alloy-js/markdown": "^0.22.0",
142
142
  "@alloy-js/typescript": "^0.22.0",
143
143
  "@babel/core": "^7.28.6",
144
- "@powerlines/plugin-alloy": "^0.19.32",
145
- "@powerlines/plugin-babel": "^0.12.262",
146
- "@powerlines/plugin-env": "^0.15.160",
144
+ "@powerlines/plugin-alloy": "^0.19.34",
145
+ "@powerlines/plugin-babel": "^0.12.263",
146
+ "@powerlines/plugin-env": "^0.15.162",
147
147
  "@storm-software/config-tools": "^1.189.0",
148
148
  "@stryke/cli": "^0.13.12",
149
149
  "@stryke/convert": "^0.6.38",
@@ -152,15 +152,15 @@
152
152
  "@vitejs/plugin-react": "^5.1.2",
153
153
  "babel-plugin-react-compiler": "^1.0.0",
154
154
  "defu": "^6.1.4",
155
- "powerlines": "^0.38.20"
155
+ "powerlines": "^0.38.21"
156
156
  },
157
157
  "devDependencies": {
158
- "@powerlines/plugin-plugin": "^0.12.204",
158
+ "@powerlines/plugin-plugin": "^0.12.205",
159
159
  "@types/node": "^24.10.9",
160
160
  "@types/react": "^19.2.10",
161
161
  "@types/react-dom": "^19.2.3"
162
162
  },
163
163
  "publishConfig": { "access": "public" },
164
164
  "types": "./dist/index.d.cts",
165
- "gitHead": "e049a581a8652a74e908a98ae4e5309c1c41c02f"
165
+ "gitHead": "6000a15bf3fbc1b7eaaf967088c68eef9949786a"
166
166
  }
File without changes
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1,74 +0,0 @@
1
- import { BabelPluginOptions } from "@powerlines/plugin-babel/types/plugin";
2
- import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "@powerlines/plugin-env/types/plugin";
3
- import { PluginOptions } from "babel-plugin-react-compiler";
4
-
5
- //#region src/types/plugin.d.ts
6
- type ReactCompilerOptions = Omit<PluginOptions, "logger">;
7
- interface ReactPluginOptions {
8
- /**
9
- * Control where the JSX factory is imported from.
10
- *
11
- * @see https://esbuild.github.io/api/#jsx-import-source
12
- *
13
- * @defaultValue "react"
14
- */
15
- jsxImportSource?: string;
16
- /**
17
- * Control how JSX is transformed.
18
- *
19
- * @remarks
20
- * Skipping React import with classic runtime is not supported from v4
21
- *
22
- * @defaultValue "automatic"
23
- */
24
- jsxRuntime?: "classic" | "automatic";
25
- /**
26
- * Options provided to the [React Compiler](https://npmjs.com/package/babel-plugin-react-compiler).
27
- *
28
- * @see https://github.com/facebook/react/blob/main/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts#L55
29
- * @see https://react.dev/blog/2025/04/21/react-compiler-rc
30
- *
31
- * @remarks
32
- * Set to `false` to disable the React Compiler. By default, the React Compiler is enabled and target is set to React 19.
33
- */
34
- compiler?: ReactCompilerOptions | false;
35
- /**
36
- * React Fast Refresh runtime URL prefix.
37
- *
38
- * @remarks
39
- * Useful in a module federation context to enable HMR by specifying the host application URL in the Vite config of a remote application.
40
- *
41
- * @example
42
- * reactRefreshHost: 'http://localhost:3000'
43
- */
44
- reactRefreshHost?: string;
45
- /**
46
- * Options to pass to the [Babel plugin](https://npmjs.com/package/\@powerlines/plugin-babel).
47
- */
48
- babel?: Partial<BabelPluginOptions>;
49
- /**
50
- * Options to pass to the [Env plugin](https://npmjs.com/package/\@powerlines/plugin-env).
51
- */
52
- env?: Partial<Omit<EnvPluginOptions, "babel">>;
53
- }
54
- type ReactPluginUserConfig = EnvPluginUserConfig & {
55
- /**
56
- * Options for the React plugin.
57
- */
58
- react?: ReactPluginOptions;
59
- };
60
- type ReactPluginResolvedConfig = EnvPluginResolvedConfig & {
61
- /**
62
- * Options for the React plugin.
63
- */
64
- react: ReactPluginOptions;
65
- };
66
- interface ReactPluginContext<TResolvedConfig extends ReactPluginResolvedConfig = ReactPluginResolvedConfig> extends EnvPluginContext<TResolvedConfig> {}
67
- declare type __ΩReactCompilerOptions = any[];
68
- declare type __ΩReactPluginOptions = any[];
69
- declare type __ΩReactPluginUserConfig = any[];
70
- declare type __ΩReactPluginResolvedConfig = any[];
71
- declare type __ΩReactPluginContext = any[];
72
- //#endregion
73
- export { ReactPluginUserConfig as a, __ΩReactPluginOptions as c, ReactPluginResolvedConfig as i, __ΩReactPluginResolvedConfig as l, ReactPluginContext as n, __ΩReactCompilerOptions as o, ReactPluginOptions as r, __ΩReactPluginContext as s, ReactCompilerOptions as t, __ΩReactPluginUserConfig as u };
74
- //# sourceMappingURL=plugin-DVsOZIzd.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-DVsOZIzd.d.cts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;KA2BY,oBAAA,GAAuB,KAAK;UAEvB,kBAAA;EAFL;AAEZ;;;;;;EAkDQ,eAAA,CAAA,EAAA,MAAA;EAAO;AAGf;AAOA;AAOA;;;;;EAE0B,UAAA,CAAA,EAAA,SAAA,GAAA,WAAA;;;;;;;;;;aAxCb;;;;;;;;;;;;;;UAgBH,QAAQ;;;;QAKV,QAAQ,KAAK;;KAGT,qBAAA,GAAwB;;;;UAI1B;;KAGE,yBAAA,GAA4B;;;;SAI/B;;UAGQ,2CACS,4BAA4B,mCAC5C,iBAAiB"}
@@ -1,74 +0,0 @@
1
- import { BabelPluginOptions } from "@powerlines/plugin-babel/types/plugin";
2
- import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "@powerlines/plugin-env/types/plugin";
3
- import { PluginOptions } from "babel-plugin-react-compiler";
4
-
5
- //#region src/types/plugin.d.ts
6
- type ReactCompilerOptions = Omit<PluginOptions, "logger">;
7
- interface ReactPluginOptions {
8
- /**
9
- * Control where the JSX factory is imported from.
10
- *
11
- * @see https://esbuild.github.io/api/#jsx-import-source
12
- *
13
- * @defaultValue "react"
14
- */
15
- jsxImportSource?: string;
16
- /**
17
- * Control how JSX is transformed.
18
- *
19
- * @remarks
20
- * Skipping React import with classic runtime is not supported from v4
21
- *
22
- * @defaultValue "automatic"
23
- */
24
- jsxRuntime?: "classic" | "automatic";
25
- /**
26
- * Options provided to the [React Compiler](https://npmjs.com/package/babel-plugin-react-compiler).
27
- *
28
- * @see https://github.com/facebook/react/blob/main/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts#L55
29
- * @see https://react.dev/blog/2025/04/21/react-compiler-rc
30
- *
31
- * @remarks
32
- * Set to `false` to disable the React Compiler. By default, the React Compiler is enabled and target is set to React 19.
33
- */
34
- compiler?: ReactCompilerOptions | false;
35
- /**
36
- * React Fast Refresh runtime URL prefix.
37
- *
38
- * @remarks
39
- * Useful in a module federation context to enable HMR by specifying the host application URL in the Vite config of a remote application.
40
- *
41
- * @example
42
- * reactRefreshHost: 'http://localhost:3000'
43
- */
44
- reactRefreshHost?: string;
45
- /**
46
- * Options to pass to the [Babel plugin](https://npmjs.com/package/\@powerlines/plugin-babel).
47
- */
48
- babel?: Partial<BabelPluginOptions>;
49
- /**
50
- * Options to pass to the [Env plugin](https://npmjs.com/package/\@powerlines/plugin-env).
51
- */
52
- env?: Partial<Omit<EnvPluginOptions, "babel">>;
53
- }
54
- type ReactPluginUserConfig = EnvPluginUserConfig & {
55
- /**
56
- * Options for the React plugin.
57
- */
58
- react?: ReactPluginOptions;
59
- };
60
- type ReactPluginResolvedConfig = EnvPluginResolvedConfig & {
61
- /**
62
- * Options for the React plugin.
63
- */
64
- react: ReactPluginOptions;
65
- };
66
- interface ReactPluginContext<TResolvedConfig extends ReactPluginResolvedConfig = ReactPluginResolvedConfig> extends EnvPluginContext<TResolvedConfig> {}
67
- declare type __ΩReactCompilerOptions = any[];
68
- declare type __ΩReactPluginOptions = any[];
69
- declare type __ΩReactPluginUserConfig = any[];
70
- declare type __ΩReactPluginResolvedConfig = any[];
71
- declare type __ΩReactPluginContext = any[];
72
- //#endregion
73
- export { ReactPluginUserConfig as a, __ΩReactPluginOptions as c, ReactPluginResolvedConfig as i, __ΩReactPluginResolvedConfig as l, ReactPluginContext as n, __ΩReactCompilerOptions as o, ReactPluginOptions as r, __ΩReactPluginContext as s, ReactCompilerOptions as t, __ΩReactPluginUserConfig as u };
74
- //# sourceMappingURL=plugin-DhNM9Rg6.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-DhNM9Rg6.d.mts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;KA2BY,oBAAA,GAAuB,KAAK;UAEvB,kBAAA;EAFL;AAEZ;;;;;;EAkDQ,eAAA,CAAA,EAAA,MAAA;EAAO;AAGf;AAOA;AAOA;;;;;EAE0B,UAAA,CAAA,EAAA,SAAA,GAAA,WAAA;;;;;;;;;;aAxCb;;;;;;;;;;;;;;UAgBH,QAAQ;;;;QAKV,QAAQ,KAAK;;KAGT,qBAAA,GAAwB;;;;UAI1B;;KAGE,yBAAA,GAA4B;;;;SAI/B;;UAGQ,2CACS,4BAA4B,mCAC5C,iBAAiB"}
@@ -1 +0,0 @@
1
- export { };
File without changes
@@ -1,15 +0,0 @@
1
- import * as _alloy_js_core0 from "@alloy-js/core";
2
- import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
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
14
- export { ReactOptimizedBuiltinProps as n, __ΩReactOptimizedBuiltinProps as r, ReactOptimizedBuiltin as t };
15
- //# sourceMappingURL=react-optimized-CTa8f7Os.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-optimized-CTa8f7Os.d.mts","names":[],"sources":["../src/components/react-optimized.tsx"],"sourcesContent":[],"mappings":";;;;UAgCiB,0BAAA,SAAmC,KAClD;;;AADF;AAYA;;iBAAgB,qBAAA,QAA6B,6BAA0B,eAAA,CAAA"}
@@ -1,15 +0,0 @@
1
- import * as _alloy_js_core0 from "@alloy-js/core";
2
- import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
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
14
- export { ReactOptimizedBuiltinProps as n, __ΩReactOptimizedBuiltinProps as r, ReactOptimizedBuiltin as t };
15
- //# sourceMappingURL=react-optimized-D1ur_Vdk.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-optimized-D1ur_Vdk.d.cts","names":[],"sources":["../src/components/react-optimized.tsx"],"sourcesContent":[],"mappings":";;;;UAgCiB,0BAAA,SAAmC,KAClD;;;AADF;AAYA;;iBAAgB,qBAAA,QAA6B,6BAA0B,eAAA,CAAA"}
@@ -1,48 +0,0 @@
1
- import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
2
- import defu from "defu";
3
- import { Show, code, splitProps } from "@alloy-js/core";
4
- import { FunctionDeclaration } from "@alloy-js/typescript";
5
- import { refkey } from "@powerlines/plugin-alloy/helpers/refkey";
6
- import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
7
- import { TSDoc, TSDocLink, TSDocReturns } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
8
-
9
- //#region src/components/react-optimized.tsx
10
- const isOptimizationEnabledRefkey = refkey("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 builtinImports() {
20
- return defu({ env: ["env", "isDevelopment"] }, rest.builtinImports ?? {});
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
47
- export { ReactOptimizedBuiltin as t };
48
- //# sourceMappingURL=react-optimized-DR69Ucl1.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-optimized-DR69Ucl1.mjs","names":["code","Show","splitProps","FunctionDeclaration","refkey","BuiltinFile","TSDoc","TSDocLink","TSDocReturns","defu","isOptimizationEnabledRefkey","ReactOptimizedBuiltin","props","override","rest","_$createComponent","_$mergeProps","id","description","builtinImports","env","children","heading","async","name","returnType","when","undefined","fallback","_$createIntrinsic"],"sources":["../src/components/react-optimized.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport { FunctionDeclaration } from \"@alloy-js/typescript\";\nimport { refkey } from \"@powerlines/plugin-alloy/helpers/refkey\";\nimport {\n BuiltinFile,\n BuiltinFileProps\n} from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport {\n TSDoc,\n TSDocLink,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport defu from \"defu\";\n\nexport interface ReactOptimizedBuiltinProps extends Omit<\n BuiltinFileProps,\n \"id\"\n> {\n override?: boolean;\n}\n\nconst isOptimizationEnabledRefkey = refkey(\"isOptimizationEnabled\");\n\n/**\n * Generates the `react/optimized` builtin module for the Powerlines project.\n */\nexport function ReactOptimizedBuiltin(props: ReactOptimizedBuiltinProps) {\n const [{ override }, rest] = splitProps(props, [\"override\"]);\n\n return (\n <BuiltinFile\n {...rest}\n id=\"react/optimized\"\n description=\"A built-in module to provide access to environment configuration to determine React optimizations.\"\n builtinImports={defu(\n { env: [\"env\", \"isDevelopment\"] },\n rest.builtinImports ?? {}\n )}>\n <TSDoc heading=\"A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.\">\n <TSDocLink>\n {`https://react.dev/reference/react-compiler/gating`}\n </TSDocLink>\n <TSDocReturns>\n {`A boolean indicating if the React compiler's optimizations should be used.`}\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n refkey={isOptimizationEnabledRefkey}\n async={false}\n export={true}\n name=\"isOptimizationEnabled\"\n returnType=\"boolean\">\n <Show\n when={override !== undefined}\n fallback={code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `}>{code`return ${override};`}</Show>\n <hbr />\n </FunctionDeclaration>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;AAuCA,MAAMU,8BAA8BN,OAAO,wBAAwB;;;;AAKnE,SAAgBO,sBAAsBC,OAAmC;CACvE,MAAM,CAAC,EAAEC,YAAYC,QAAQZ,WAAWU,OAAO,CAAC,WAAW,CAAC;AAE5D,QAAAG,gBACGV,aAAWW,WACNF,MAAI;EACRG,IAAE;EACFC,aAAW;EAAA,IACXC,iBAAc;AAAA,UAAEV,KACd,EAAEW,KAAK,CAAC,OAAO,gBAAe,EAAG,EACjCN,KAAKK,kBAAkB,EACzB,CAAC;;EAAA,IAAAE,WAAA;AAAA,UAAA,CAAAN,gBACAT,OAAK;IAACgB,SAAO;IAAA,IAAAD,WAAA;AAAA,YAAA,CAAAN,gBACXR,WAAS,EAAAc,UACP,qDAAmD,CAAA,EAAAN,gBAErDP,cAAY,EAAAa,UACV,8EAA4E,CAAA,CAAA;;IAAA,CAAA,EAAAN,gBAGhFZ,qBAAmB;IAClBC,QAAQM;IACRa,OAAO;IAAK,UACJ;IACRC,MAAI;IACJC,YAAU;IAAA,IAAAJ,WAAA;AAAA,YAAA,CAAAN,gBACTd,MAAI;MACHyB,MAAMb,aAAac;MACnBC,UAAU5B,IAAI;MAAwDqB,UAAGrB,IAAI,UAAUa,SAAQ;MAAG,CAAA,EAAAgB,gBAAA,OAAA,EAAA,CAAA,CAAA;;IAAA,CAAA,CAAA;;EAAA,CAAA,CAAA"}
@@ -1,86 +0,0 @@
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
- let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
29
- let defu = require("defu");
30
- defu = __toESM(defu);
31
- let __alloy_js_core = require("@alloy-js/core");
32
- let __alloy_js_typescript = require("@alloy-js/typescript");
33
- let __powerlines_plugin_alloy_helpers_refkey = require("@powerlines/plugin-alloy/helpers/refkey");
34
- let __powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
35
- let __powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
36
-
37
- //#region src/components/react-optimized.tsx
38
- const isOptimizationEnabledRefkey = (0, __powerlines_plugin_alloy_helpers_refkey.refkey)("isOptimizationEnabled");
39
- /**
40
- * Generates the `react/optimized` builtin module for the Powerlines project.
41
- */
42
- function ReactOptimizedBuiltin(props) {
43
- const [{ override }, rest] = (0, __alloy_js_core.splitProps)(props, ["override"]);
44
- return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, {
45
- id: "react/optimized",
46
- description: "A built-in module to provide access to environment configuration to determine React optimizations.",
47
- get builtinImports() {
48
- return (0, defu.default)({ env: ["env", "isDevelopment"] }, rest.builtinImports ?? {});
49
- },
50
- get children() {
51
- return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
52
- heading: "A gating function to determine if the optimized [React compiler](https://react.dev/reference/react-compiler) source code should be used.",
53
- get children() {
54
- return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: `https://react.dev/reference/react-compiler/gating` }), (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `A boolean indicating if the React compiler's optimizations should be used.` })];
55
- }
56
- }), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
57
- refkey: isOptimizationEnabledRefkey,
58
- async: false,
59
- "export": true,
60
- name: "isOptimizationEnabled",
61
- returnType: "boolean",
62
- get children() {
63
- return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
64
- when: override !== void 0,
65
- fallback: __alloy_js_core.code`return !env.DISABLE_REACT_COMPILER && !isDevelopment; `,
66
- children: __alloy_js_core.code`return ${override};`
67
- }), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
68
- }
69
- })];
70
- }
71
- }));
72
- }
73
-
74
- //#endregion
75
- Object.defineProperty(exports, 'ReactOptimizedBuiltin', {
76
- enumerable: true,
77
- get: function () {
78
- return ReactOptimizedBuiltin;
79
- }
80
- });
81
- Object.defineProperty(exports, '__toESM', {
82
- enumerable: true,
83
- get: function () {
84
- return __toESM;
85
- }
86
- });
@@ -1 +0,0 @@
1
- export { };
@@ -1,16 +0,0 @@
1
- import { EnvInterface } from "@powerlines/plugin-env/types/runtime";
2
-
3
- //#region src/types/runtime.d.ts
4
- interface ReactEnvInterface extends EnvInterface {
5
- /**
6
- * Disables the React compiler optimizations when set to true.
7
- *
8
- * @remarks
9
- * This environment variable can be used to turn off the optimizations provided by the React compiler, which may be useful for debugging or development purposes.
10
- */
11
- DISABLE_REACT_COMPILER: boolean;
12
- }
13
- declare type __ΩReactEnvInterface = any[];
14
- //#endregion
15
- export { __ΩReactEnvInterface as n, ReactEnvInterface as t };
16
- //# sourceMappingURL=runtime-Bj2UD25S.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-Bj2UD25S.d.mts","names":[],"sources":["../src/types/runtime.ts"],"sourcesContent":[],"mappings":";;;UAoBiB,iBAAA,SAA0B;;AAA3C"}
File without changes
@@ -1,16 +0,0 @@
1
- import { EnvInterface } from "@powerlines/plugin-env/types/runtime";
2
-
3
- //#region src/types/runtime.d.ts
4
- interface ReactEnvInterface extends EnvInterface {
5
- /**
6
- * Disables the React compiler optimizations when set to true.
7
- *
8
- * @remarks
9
- * This environment variable can be used to turn off the optimizations provided by the React compiler, which may be useful for debugging or development purposes.
10
- */
11
- DISABLE_REACT_COMPILER: boolean;
12
- }
13
- declare type __ΩReactEnvInterface = any[];
14
- //#endregion
15
- export { __ΩReactEnvInterface as n, ReactEnvInterface as t };
16
- //# sourceMappingURL=runtime-Co2VNPJW.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-Co2VNPJW.d.cts","names":[],"sources":["../src/types/runtime.ts"],"sourcesContent":[],"mappings":";;;UAoBiB,iBAAA,SAA0B;;AAA3C"}
@@ -1 +0,0 @@
1
- export { };
File without changes