@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.
- package/dist/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/components/index.cjs +2 -3
- package/dist/components/index.d.cts +1 -3
- package/dist/components/index.d.mts +1 -4
- package/dist/components/index.mjs +1 -2
- package/dist/components/react-optimized.cjs +48 -2
- package/dist/components/react-optimized.d.cts +13 -2
- package/dist/components/react-optimized.d.mts +13 -3
- package/dist/components/react-optimized.mjs +45 -1
- package/dist/deepkit/schemas/reflection.cjs +3940 -0
- package/dist/{plugin-CJdK9GYW.d.cts → deepkit/schemas/reflection.d.cts} +1 -331
- package/dist/{plugin-Noy_HIP5.d.mts → deepkit/schemas/reflection.d.mts} +59 -389
- package/dist/deepkit/schemas/reflection.mjs +3938 -0
- package/dist/deepkit/schemas/reflection2.cjs +4112 -0
- package/dist/deepkit/schemas/reflection2.mjs +4110 -0
- package/dist/deepkit/src/capnp.cjs +913 -0
- package/dist/deepkit/src/capnp.mjs +911 -0
- package/dist/deepkit/src/esbuild-plugin.cjs +47 -0
- package/dist/deepkit/src/esbuild-plugin.mjs +46 -0
- package/dist/deepkit/src/reflect-type.cjs +22 -0
- package/dist/deepkit/src/reflect-type.mjs +20 -0
- package/dist/deepkit/src/resolve-reflections.cjs +16 -0
- package/dist/deepkit/src/resolve-reflections.mjs +15 -0
- package/dist/deepkit/src/transformer.cjs +52 -0
- package/dist/deepkit/src/transformer.mjs +49 -0
- package/dist/deepkit/src/transpile.cjs +29 -0
- package/dist/deepkit/src/transpile.mjs +27 -0
- package/dist/deepkit/src/types.d.cts +10 -0
- package/dist/deepkit/src/types.d.mts +10 -0
- package/dist/deepkit/src/utilities.cjs +66 -0
- package/dist/deepkit/src/utilities.mjs +65 -0
- package/dist/index.cjs +16 -11295
- package/dist/index.d.cts +5 -7
- package/dist/index.d.mts +6 -8
- package/dist/index.mjs +7 -11280
- package/dist/plugin-alloy/src/core/components/output.cjs +45 -0
- package/dist/plugin-alloy/src/core/components/output.mjs +44 -0
- package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +22 -0
- package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +21 -0
- package/dist/plugin-alloy/src/core/components/source-file.cjs +64 -0
- package/dist/plugin-alloy/src/core/components/source-file.d.cts +23 -0
- package/dist/plugin-alloy/src/core/components/source-file.d.mts +23 -0
- package/dist/plugin-alloy/src/core/components/source-file.mjs +62 -0
- package/dist/plugin-alloy/src/core/contexts/context.cjs +60 -0
- package/dist/plugin-alloy/src/core/contexts/context.mjs +54 -0
- package/dist/plugin-alloy/src/core/contexts/index.cjs +2 -0
- package/dist/plugin-alloy/src/core/contexts/index.mjs +4 -0
- package/dist/plugin-alloy/src/core/contexts/reflection.cjs +46 -0
- package/dist/plugin-alloy/src/core/contexts/reflection.mjs +42 -0
- package/dist/plugin-alloy/src/helpers/refkey.cjs +16 -0
- package/dist/plugin-alloy/src/helpers/refkey.mjs +15 -0
- package/dist/plugin-alloy/src/index.cjs +93 -0
- package/dist/plugin-alloy/src/index.mjs +91 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +7 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +9 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +5 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +7 -0
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +17 -0
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +17 -0
- package/dist/plugin-alloy/src/types/components.d.cts +22 -0
- package/dist/{components-Bs3-ohmM.d.mts → plugin-alloy/src/types/components.d.mts} +2 -1
- package/dist/plugin-alloy/src/types/index.d.mts +2 -0
- package/dist/plugin-alloy/src/types/plugin.d.cts +37 -0
- package/dist/plugin-alloy/src/types/plugin.d.mts +37 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +57 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +25 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +26 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +56 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +126 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +124 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +442 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +27 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +28 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +433 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +194 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +14 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +15 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +191 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +68 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +67 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +124 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +123 -0
- package/dist/plugin-automd/src/index.cjs +101 -0
- package/dist/plugin-automd/src/index.mjs +98 -0
- package/dist/plugin-automd/src/types/plugin.d.cts +38 -0
- package/dist/plugin-automd/src/types/plugin.d.mts +40 -0
- package/dist/plugin-automd/src/types/toc.d.cts +33 -0
- package/dist/plugin-automd/src/types/toc.d.mts +33 -0
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +10 -0
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +9 -0
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +41 -0
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +39 -0
- package/dist/plugin-babel/src/helpers/filters.cjs +23 -0
- package/dist/plugin-babel/src/helpers/filters.mjs +21 -0
- package/dist/plugin-babel/src/helpers/index.cjs +5 -0
- package/dist/plugin-babel/src/helpers/index.mjs +7 -0
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +38 -0
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +35 -0
- package/dist/plugin-babel/src/helpers/options.cjs +50 -0
- package/dist/plugin-babel/src/helpers/options.mjs +47 -0
- package/dist/plugin-babel/src/index.cjs +91 -0
- package/dist/plugin-babel/src/index.mjs +89 -0
- package/dist/plugin-babel/src/types/index.d.mts +1 -0
- package/dist/plugin-babel/src/types/plugin.d.cts +15 -0
- package/dist/plugin-babel/src/types/plugin.d.mts +15 -0
- package/dist/plugin-env/src/babel/index.cjs +1 -0
- package/dist/plugin-env/src/babel/index.mjs +3 -0
- package/dist/plugin-env/src/babel/plugin.cjs +121 -0
- package/dist/plugin-env/src/babel/plugin.mjs +119 -0
- package/dist/plugin-env/src/components/docs.cjs +9 -0
- package/dist/plugin-env/src/components/docs.mjs +11 -0
- package/dist/plugin-env/src/components/env.cjs +575 -0
- package/dist/plugin-env/src/components/env.mjs +572 -0
- package/dist/plugin-env/src/components/index.cjs +2 -0
- package/dist/plugin-env/src/components/index.mjs +4 -0
- package/dist/plugin-env/src/helpers/automd-generator.cjs +22 -0
- package/dist/plugin-env/src/helpers/automd-generator.mjs +21 -0
- package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +55 -0
- package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +54 -0
- package/dist/plugin-env/src/helpers/index.cjs +6 -0
- package/dist/plugin-env/src/helpers/index.mjs +8 -0
- package/dist/plugin-env/src/helpers/load.cjs +83 -0
- package/dist/plugin-env/src/helpers/load.mjs +80 -0
- package/dist/plugin-env/src/helpers/persistence.cjs +199 -0
- package/dist/plugin-env/src/helpers/persistence.mjs +188 -0
- package/dist/plugin-env/src/helpers/reflect.cjs +111 -0
- package/dist/plugin-env/src/helpers/reflect.mjs +103 -0
- package/dist/plugin-env/src/helpers/source-file-env.cjs +24 -0
- package/dist/plugin-env/src/helpers/source-file-env.mjs +23 -0
- package/dist/plugin-env/src/helpers/template-helpers.cjs +2 -0
- package/dist/plugin-env/src/helpers/template-helpers.mjs +4 -0
- package/dist/plugin-env/src/index.cjs +175 -0
- package/dist/plugin-env/src/index.mjs +173 -0
- package/dist/plugin-env/src/types/plugin.d.cts +151 -0
- package/dist/plugin-env/src/types/plugin.d.mts +153 -0
- package/dist/{runtime-B8Zgz0Kb.d.cts → plugin-env/src/types/runtime.d.cts} +2 -2
- package/dist/{runtime-BFnA_zZ8.d.mts → plugin-env/src/types/runtime.d.mts} +2 -2
- package/dist/powerlines/src/lib/build/esbuild.cjs +102 -0
- package/dist/powerlines/src/lib/build/esbuild.mjs +100 -0
- package/dist/powerlines/src/lib/entry.cjs +12 -0
- package/dist/powerlines/src/lib/entry.mjs +14 -0
- package/dist/powerlines/src/lib/logger.cjs +41 -0
- package/dist/powerlines/src/lib/logger.mjs +39 -0
- package/dist/powerlines/src/lib/typescript/tsconfig.cjs +38 -0
- package/dist/powerlines/src/lib/typescript/tsconfig.mjs +35 -0
- package/dist/powerlines/src/lib/utilities/bundle.cjs +35 -0
- package/dist/powerlines/src/lib/utilities/bundle.mjs +34 -0
- package/dist/powerlines/src/lib/utilities/resolve.cjs +30 -0
- package/dist/powerlines/src/lib/utilities/resolve.mjs +29 -0
- package/dist/powerlines/src/plugin-utils/paths.cjs +1 -0
- package/dist/powerlines/src/plugin-utils/paths.mjs +3 -0
- package/dist/powerlines/src/types/babel.d.cts +22 -0
- package/dist/powerlines/src/types/babel.d.mts +22 -0
- package/dist/powerlines/src/types/build.d.cts +145 -0
- package/dist/powerlines/src/types/build.d.mts +145 -0
- package/dist/powerlines/src/types/commands.d.cts +8 -0
- package/dist/powerlines/src/types/commands.d.mts +9 -0
- package/dist/powerlines/src/types/config.d.cts +387 -0
- package/dist/powerlines/src/types/config.d.mts +388 -0
- package/dist/powerlines/src/types/context.d.cts +414 -0
- package/dist/powerlines/src/types/context.d.mts +416 -0
- package/dist/powerlines/src/types/fs.d.cts +486 -0
- package/dist/powerlines/src/types/fs.d.mts +486 -0
- package/dist/powerlines/src/types/hooks.d.mts +2 -0
- package/dist/powerlines/src/types/plugin.d.cts +231 -0
- package/dist/powerlines/src/types/plugin.d.mts +231 -0
- package/dist/powerlines/src/types/resolved.d.cts +82 -0
- package/dist/powerlines/src/types/resolved.d.mts +82 -0
- package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
- package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
- package/dist/types/index.cjs +0 -3
- package/dist/types/index.d.cts +2 -5
- package/dist/types/index.d.mts +2 -6
- package/dist/types/index.mjs +0 -4
- package/dist/types/plugin.cjs +0 -1
- package/dist/types/plugin.d.cts +72 -3
- package/dist/types/plugin.d.mts +72 -4
- package/dist/types/plugin.mjs +0 -2
- package/dist/types/runtime.cjs +0 -1
- package/dist/types/runtime.d.cts +14 -3
- package/dist/types/runtime.d.mts +14 -3
- package/dist/types/runtime.mjs +0 -2
- package/package.json +6 -6
- package/dist/components-BWLXb7a2.cjs +0 -0
- package/dist/components-D-mbfYAe.mjs +0 -1
- package/dist/index-B8OHl-c_.d.mts +0 -1
- package/dist/index-CFG0_wK4.d.cts +0 -1
- package/dist/index-DNLi60D-.d.mts +0 -1
- package/dist/index-_wQ5ClJU.d.cts +0 -1
- package/dist/plugin-jZ9N9Mz-.mjs +0 -1
- package/dist/plugin-pBKbb5K9.cjs +0 -0
- package/dist/react-optimized-BpFTLlx0.mjs +0 -937
- package/dist/react-optimized-CVXQfO40.d.mts +0 -88
- package/dist/react-optimized-Kv14o38g.cjs +0 -1078
- package/dist/react-optimized-NGRcJkqA.d.cts +0 -105
- package/dist/resolved-CTt23qfE.d.cts +0 -1795
- package/dist/resolved-Nive48eM.d.mts +0 -1796
- package/dist/runtime-B-KyPHeI.d.mts +0 -15
- package/dist/runtime-BKY6WvHV.mjs +0 -1
- package/dist/runtime-Bp9G0scd.cjs +0 -0
- package/dist/runtime-Dm--tkdO.d.cts +0 -15
- package/dist/types--fVOUYBq.mjs +0 -1
- 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
|
|
2
|
-
require('../components-BWLXb7a2.cjs');
|
|
1
|
+
const require_components_react_optimized = require('./react-optimized.cjs');
|
|
3
2
|
|
|
4
|
-
exports.ReactOptimizedBuiltin =
|
|
3
|
+
exports.ReactOptimizedBuiltin = require_components_react_optimized.ReactOptimizedBuiltin;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import "
|
|
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 "
|
|
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,3 +1,49 @@
|
|
|
1
|
-
const
|
|
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
|
-
|
|
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 "../
|
|
2
|
-
import
|
|
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 "../
|
|
2
|
-
import "
|
|
3
|
-
|
|
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 {
|
|
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 };
|