babel-plugin-react-compiler 0.0.0-experimental-9e9cd66-20250520 → 0.0.0-experimental-8f8b1db-20250523

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 CHANGED
@@ -2,7 +2,7 @@ import * as BabelCore from '@babel/core';
2
2
  import { NodePath as NodePath$1 } from '@babel/core';
3
3
  import * as t from '@babel/types';
4
4
  import { z } from 'zod';
5
- import { Scope, NodePath } from '@babel/traverse';
5
+ import { NodePath, Scope } from '@babel/traverse';
6
6
 
7
7
  interface Result<T, E> {
8
8
  map<U>(fn: (val: T) => U): Result<U, E>;
@@ -546,7 +546,8 @@ declare class Environment {
546
546
  hasFireRewrite: boolean;
547
547
  hasInferredEffect: boolean;
548
548
  inferredEffectLocations: Set<SourceLocation>;
549
- constructor(scope: Scope, fnType: ReactFunctionType, compilerMode: CompilerMode, config: EnvironmentConfig, contextIdentifiers: Set<t.Identifier>, logger: Logger | null, filename: string | null, code: string | null, programContext: ProgramContext);
549
+ parentFunction: NodePath<t.Function>;
550
+ constructor(scope: Scope, fnType: ReactFunctionType, compilerMode: CompilerMode, config: EnvironmentConfig, contextIdentifiers: Set<t.Identifier>, parentFunction: NodePath<t.Function>, logger: Logger | null, filename: string | null, code: string | null, programContext: ProgramContext);
550
551
  get isInferredMemoEnabled(): boolean;
551
552
  get nextIdentifierId(): IdentifierId;
552
553
  get nextBlockId(): BlockId;
@@ -1412,6 +1413,7 @@ type DependencyPathEntry = {
1412
1413
  type DependencyPath = Array<DependencyPathEntry>;
1413
1414
  type ReactiveScopeDependency = {
1414
1415
  identifier: Identifier;
1416
+ reactive: boolean;
1415
1417
  path: DependencyPath;
1416
1418
  };
1417
1419
  declare const opaqueBlockId: unique symbol;
@@ -1548,10 +1550,19 @@ declare function compileFn(func: NodePath<t.FunctionDeclaration | t.ArrowFunctio
1548
1550
 
1549
1551
  declare const PanicThresholdOptionsSchema: z.ZodEnum<["all_errors", "critical_errors", "none"]>;
1550
1552
  type PanicThresholdOptions = z.infer<typeof PanicThresholdOptionsSchema>;
1553
+ declare const DynamicGatingOptionsSchema: z.ZodObject<{
1554
+ source: z.ZodString;
1555
+ }, "strip", z.ZodTypeAny, {
1556
+ source: string;
1557
+ }, {
1558
+ source: string;
1559
+ }>;
1560
+ type DynamicGatingOptions = z.infer<typeof DynamicGatingOptionsSchema>;
1551
1561
  type PluginOptions = {
1552
1562
  environment: EnvironmentConfig;
1553
1563
  logger: Logger | null;
1554
1564
  gating: ExternalFunction | null;
1565
+ dynamicGating: DynamicGatingOptions | null;
1555
1566
  panicThreshold: PanicThresholdOptions;
1556
1567
  noEmit: boolean;
1557
1568
  compilationMode: CompilationMode;
@@ -1635,7 +1646,7 @@ type CompilerPass = {
1635
1646
  };
1636
1647
  declare const OPT_IN_DIRECTIVES: Set<string>;
1637
1648
  declare const OPT_OUT_DIRECTIVES: Set<string>;
1638
- declare function findDirectiveEnablingMemoization(directives: Array<t.Directive>): t.Directive | null;
1649
+ declare function tryFindDirectiveEnablingMemoization(directives: Array<t.Directive>, opts: PluginOptions): Result<t.Directive | null, CompilerError>;
1639
1650
  declare function findDirectiveDisablingMemoization(directives: Array<t.Directive>): t.Directive | null;
1640
1651
  type BabelFn = NodePath$1<t.FunctionDeclaration> | NodePath$1<t.FunctionExpression> | NodePath$1<t.ArrowFunctionExpression>;
1641
1652
  type CompileProgramMetadata = {
@@ -1701,4 +1712,4 @@ declare global {
1701
1712
  let __DEV__: boolean | null | undefined;
1702
1713
  }
1703
1714
 
1704
- 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 };
1715
+ 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, tryFindDirectiveEnablingMemoization as findDirectiveEnablingMemoization, parseConfigPragmaForTests, parsePluginOptions, printFunctionWithOutlined, printHIR, printReactiveFunction, printReactiveFunctionWithOutlined, runBabelPluginReactCompiler, validateEnvironmentConfig };