babel-plugin-react-compiler 0.0.0-experimental-a9d296d-20250325 → 0.0.0-experimental-84c28d9-20250326
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/index.d.ts +3 -1
- package/dist/index.js +21 -0
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
@@ -1432,6 +1432,7 @@ type InstructionId = number & {
|
|
1432
1432
|
type Options = {
|
1433
1433
|
indent: number;
|
1434
1434
|
};
|
1435
|
+
declare function printFunctionWithOutlined(fn: HIRFunction): string;
|
1435
1436
|
declare function printHIR(ir: HIR, options?: Options | null): string;
|
1436
1437
|
|
1437
1438
|
declare enum ErrorSeverity {
|
@@ -1516,6 +1517,7 @@ type CodegenFunction = {
|
|
1516
1517
|
hasFireRewrite: boolean;
|
1517
1518
|
};
|
1518
1519
|
|
1520
|
+
declare function printReactiveFunctionWithOutlined(fn: ReactiveFunction): string;
|
1519
1521
|
declare function printReactiveFunction(fn: ReactiveFunction): string;
|
1520
1522
|
|
1521
1523
|
type CompilerPipelineValue = {
|
@@ -1651,4 +1653,4 @@ declare global {
|
|
1651
1653
|
let __DEV__: boolean | null | undefined;
|
1652
1654
|
}
|
1653
1655
|
|
1654
|
-
export { CompilerError, CompilerErrorDetail, type CompilerErrorDetailOptions, type CompilerPipelineValue, CompilerSuggestionOperation, Effect, type EnvironmentConfig, ErrorSeverity, type ExternalFunction, type Hook, type Logger, type LoggerEvent, OPT_IN_DIRECTIVES, OPT_OUT_DIRECTIVES, type PluginOptions, ProgramContext, type SourceLocation, ValueKind, compileFn as compile, compileProgram, BabelPluginReactCompiler as default, findDirectiveDisablingMemoization, findDirectiveEnablingMemoization, parseConfigPragmaForTests, parsePluginOptions, printHIR, printReactiveFunction, runBabelPluginReactCompiler, validateEnvironmentConfig };
|
1656
|
+
export { CompilerError, CompilerErrorDetail, type CompilerErrorDetailOptions, type CompilerPipelineValue, CompilerSuggestionOperation, Effect, type EnvironmentConfig, ErrorSeverity, type ExternalFunction, type Hook, type Logger, type LoggerEvent, OPT_IN_DIRECTIVES, OPT_OUT_DIRECTIVES, type PluginOptions, ProgramContext, type SourceLocation, ValueKind, compileFn as compile, compileProgram, BabelPluginReactCompiler as default, findDirectiveDisablingMemoization, findDirectiveEnablingMemoization, parseConfigPragmaForTests, parsePluginOptions, printFunctionWithOutlined, printHIR, printReactiveFunction, printReactiveFunctionWithOutlined, runBabelPluginReactCompiler, validateEnvironmentConfig };
|
package/dist/index.js
CHANGED
@@ -110434,8 +110434,10 @@ __export(index_exports, {
|
|
110434
110434
|
findDirectiveEnablingMemoization: () => findDirectiveEnablingMemoization,
|
110435
110435
|
parseConfigPragmaForTests: () => parseConfigPragmaForTests,
|
110436
110436
|
parsePluginOptions: () => parsePluginOptions,
|
110437
|
+
printFunctionWithOutlined: () => printFunctionWithOutlined,
|
110437
110438
|
printHIR: () => printHIR,
|
110438
110439
|
printReactiveFunction: () => printReactiveFunction,
|
110440
|
+
printReactiveFunctionWithOutlined: () => printReactiveFunctionWithOutlined,
|
110439
110441
|
runBabelPluginReactCompiler: () => runBabelPluginReactCompiler,
|
110440
110442
|
validateEnvironmentConfig: () => validateEnvironmentConfig
|
110441
110443
|
});
|
@@ -114959,6 +114961,14 @@ function getHookKindForType(env, type) {
|
|
114959
114961
|
var import_generator = __toESM(require_lib26());
|
114960
114962
|
|
114961
114963
|
// src/ReactiveScopes/PrintReactiveFunction.ts
|
114964
|
+
function printReactiveFunctionWithOutlined(fn) {
|
114965
|
+
const writer = new Writer();
|
114966
|
+
writeReactiveFunction(fn, writer);
|
114967
|
+
for (const outlined of fn.env.getOutlinedFunctions()) {
|
114968
|
+
writer.writeLine("\nfunction " + printFunction(outlined.fn));
|
114969
|
+
}
|
114970
|
+
return writer.complete();
|
114971
|
+
}
|
114962
114972
|
function printReactiveFunction(fn) {
|
114963
114973
|
const writer = new Writer();
|
114964
114974
|
writeReactiveFunction(fn, writer);
|
@@ -115326,6 +115336,15 @@ _line = new WeakMap();
|
|
115326
115336
|
_depth = new WeakMap();
|
115327
115337
|
|
115328
115338
|
// src/HIR/PrintHIR.ts
|
115339
|
+
function printFunctionWithOutlined(fn) {
|
115340
|
+
const output = [printFunction(fn)];
|
115341
|
+
for (const outlined of fn.env.getOutlinedFunctions()) {
|
115342
|
+
output.push(`
|
115343
|
+
function ${outlined.fn.id}:
|
115344
|
+
${printHIR(outlined.fn.body)}`);
|
115345
|
+
}
|
115346
|
+
return output.join("\n");
|
115347
|
+
}
|
115329
115348
|
function printFunction(fn) {
|
115330
115349
|
const output = [];
|
115331
115350
|
let definition = "";
|
@@ -144166,8 +144185,10 @@ var index_default = BabelPluginReactCompiler;
|
|
144166
144185
|
findDirectiveEnablingMemoization,
|
144167
144186
|
parseConfigPragmaForTests,
|
144168
144187
|
parsePluginOptions,
|
144188
|
+
printFunctionWithOutlined,
|
144169
144189
|
printHIR,
|
144170
144190
|
printReactiveFunction,
|
144191
|
+
printReactiveFunctionWithOutlined,
|
144171
144192
|
runBabelPluginReactCompiler,
|
144172
144193
|
validateEnvironmentConfig
|
144173
144194
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "babel-plugin-react-compiler",
|
3
|
-
"version": "0.0.0-experimental-
|
3
|
+
"version": "0.0.0-experimental-84c28d9-20250326",
|
4
4
|
"description": "Babel plugin for React Compiler.",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"license": "MIT",
|
@@ -12,12 +12,12 @@
|
|
12
12
|
"build": "rimraf dist && tsup",
|
13
13
|
"test": "./scripts/link-react-compiler-runtime.sh && yarn snap:ci",
|
14
14
|
"jest": "yarn build && ts-node node_modules/.bin/jest",
|
15
|
-
"snap": "
|
15
|
+
"snap": "yarn workspace snap run snap",
|
16
16
|
"snap:build": "yarn workspace snap run build",
|
17
17
|
"snap:ci": "yarn snap:build && yarn snap",
|
18
18
|
"ts:analyze-trace": "scripts/ts-analyze-trace.sh",
|
19
19
|
"lint": "yarn eslint src",
|
20
|
-
"watch": "yarn build --watch"
|
20
|
+
"watch": "yarn build --dts --watch"
|
21
21
|
},
|
22
22
|
"dependencies": {
|
23
23
|
"@babel/types": "^7.26.0"
|