← facebook/react

CODEFOSSIL · react

compileProgram

function in compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts:400 · Born 2023-06-02 (DERIVED, confidence 1.00)

3years old
100changes
6fixes
12authors
0callers
2024202520262023-06-02 2eded94 Make CompilerEntrypoint a little more generic2023-06-02 479ef40 Move entrypoint into its own directory2023-06-05 a65e9cd [devx] emit calls to `makeReadOnly` for debugging2023-06-05 5ba0a03 [config] Clean up codegen imports and gating2023-06-15 501cf92 Unify UnsafeInput and InvalidInput2023-06-16 a558b15 [babel-plugin] buildFunctionDeclaration errors are todos2023-06-20 98633d1 Add a noEmit compiler option2023-06-20 f467774 [babel-plugin][ez] Rename shouldCompile to shouldVisitNode2023-06-22 6c425f6 Remove codeframe/nodepath options from CompilerError2023-06-22 3f2b346 Make CompilerError.invariant assert the condition2023-06-27 6c4318e Add InvalidReact and InvalidConfig error severities2023-06-27 448ed2b Refactor CompilerErrorDetails2023-06-27 3fb8937 Add first example of error suggestion2023-08-11 dd8b743 [be] Refactor gating logic in babel plugin2023-08-11 25e3575 [be] Move more logic into Imports module2023-08-11 3ec95c5 [be] More babel plugin Program cleanup2023-08-14 298bf55 Address feedback2023-08-29 cee08ba [rfc] Dont convert ArrowFunction to FunctionDecl2023-08-29 ddc9f80 Enable compilation of FunctionExpressions2023-08-31 41c23e8 Disable compilation of "Components" inside class methods2023-09-14 869466b Revamp compilation modes2023-09-14 b2230f6 [pipeline] Make logging more structured2023-09-14 f993f0c [pipeline] panicOnBailout -> panicThreshold; remove isDev logging2023-10-31 ac170f4 [babel] Allow userspace useMemoCache2023-10-31 0a7bb7a [babel] Clean up import logic a bit2023-11-02 adadc21 [babel] Check if the gated component is used before decl2023-11-02 60af667 [ez] Check for use-before-decl only when gating is on2023-11-07 d6ff65e Add runtime validation for ExternalFunction2023-11-07 cf70ef8 Validate options before replacing with compiled function2023-11-07 688305a Check if critical error before throwing2023-11-07 bccd06a [babel] Simplify noEmit and hasCriticalError check2023-11-07 d8734b5 Remove hasForgetMutatedOriginalSource2023-11-07 58a10c0 [babel] Outline insertNewFunctionDeclaration2023-11-07 1c53385 Don't plumb PartialEnvironmentConfig2023-11-08 702aadd Fix to only add imports if we compiled something2023-11-08 6405c98 Use starred-block for multi line comments2023-11-08 3f7b9e2 Don't allow null to be passed to validateEnvironmentConfig2023-11-08 7aca04a [babel] Refactor handleError to pass the error first2023-11-09 f135942 [ez] Use BabelFn type2023-11-17 6d10143 [Babel] Fix up eslint suppression logic2023-11-30 9fb3a26 Add logging for number of memo *blocks* (in addition to slots)2023-12-05 37e1975 [be] Move codegen logic Program.ts -> Codegen2023-12-05 41b164e [validation] Runtime validation for hook calls2024-01-03 7ca3b00 Early branch with new type inference foundation2024-01-29 bc145f6 Support customizable eslint suppressions2024-02-09 19476aa Option to bail on Flow react-rule suppressions2024-02-09 48024b7 Fix lints2024-02-15 5142aff Allow module level "use no forget"2024-02-18 ca3d16c Enable hook syntax support2024-02-19 770ca4a [Babel] Add support for "use memo"2024-02-28 a06ded9 [other] Change instrumentation to use an optional gating identifier; record filepath2024-02-29 ad8f196 Infer type of React function2024-03-05 f5d99ba Add config option to ignore 'use no forget' directives2024-03-20 b35779c [logger] Add CompilerDiagnostic category, thread Logger into environment2024-04-02 cd3f56b [eslint] Enforce generic array type syntax2024-04-16 6bf64df [babel] Add a sources option2024-04-18 fc7467a [dx] Update error messages for config parsing2024-05-01 ebe58ee Update babel plugin to use runtime from react/compiler-runtime (#2918)2024-05-09 6b23c25 Support HMR2024-05-13 7e3be12 Use unique name for c import local identifier2024-05-31 5c420e3 [compiler] Debug tool to emit change detection code rather than memoization2024-06-10 cdbafc8 compiler: Log metrics on pruned memo blocks/values2024-06-10 a714685 fix[compiler] remove duplicate parsePluginOptions from the compilePro… (#29831)2024-07-17 a8c5e23 [compiler] Refactor Program to use queue of functions to compile2024-07-17 9d7f02d [compiler] General-purpose function outlining2024-07-18 fd2b3e1 Compiler: unfork prettier config (#30205)2024-07-24 a6b7e43 [compiler] Correctly insert (Arrow)FunctionExpressions2024-07-25 88bf4e1 [compiler] Always emit FuncDecl for outlined functions2024-07-25 9f3bbb0 [compiler] Make inserting outlined functions more resilient2024-08-08 83cc13f [compiler] Rewrite useContext callee2024-08-08 9d2da59 [compiler] Add context callee import if required2024-08-09 3871fda [compiler][be] Clean up compilation skipping logic in Program2024-08-09 2d2cc04 [compiler][ez] Option to bail out on blocklisted imports2024-08-09 8d74e8c [compiler] Patch error reporting for blocklisted imports2024-08-16 e9a869f [compiler] Run compiler pipeline on 'use no forget'2024-08-17 177b241 [compiler] Validate environment config while parsing plugin opts2024-08-30 071dd00 [compiler] Errors in earlier functions dont stop subsequent compilation2024-10-07 3fd3364 [rcr] Update default runtimeModule to react-compiler-runtime (#31144)2024-10-17 c91b3b0 JSX Outlining (#30956)2024-12-20 ab27231 [compiler] add fire imports (#31797)2024-12-20 45a720f [compile] Error on fire outside of effects and ensure correct compilation, correct import (#31798)2025-01-31 152bfe3 [compiler][rfc] Hacky retry pipeline for fire (#32164)2025-03-13 93b61fc [compiler][ez] Stop bailing out early for hoisted gated functions (#32597)2025-03-13 7939d92 [compiler] clean up retry pipeline: `fireRetry` flag -> compileMode (#32511)2025-03-14 5398b71 [compiler] detect and throw on untransformed required features (#32512)2025-03-20 0962f68 [compiler][bugfix] Don't insert hook guards in retry pipeline (#32665)2025-03-24 c61e75b [compiler] Avoid failing builds when import specifiers conflict or shadow vars (#32663)2025-03-27 8039f1b [compiler] Fix inferEffectDependencies lint false positives (#32769)2025-04-24 9938f83 [compiler] Emit CompileSkip before CompileSuccess event (#33012)2025-05-09 5069e18 [compiler][be] Make program traversal more readable (#33147)2025-05-09 3820740 [compiler][entrypoint] Fix edgecases for noEmit and opt-outs (#33148)2025-05-27 f9ae0a4 [compiler][gating] Custom opt out directives (experimental option) (#33328)2025-08-21 7d29ecb [compiler] Aggregate error reporting, separate eslint rules (#34176)2025-09-06 60d9b97 [compiler] Derive ErrorSeverity from ErrorCategory (#34401)2025-09-06 474f258 [compiler] Migrate CompilerError.invariant to new CompilerDiagnostic infra (#34403)2025-11-20 50e7ec8 [compiler] Deprecate noEmit, add outputMode (#35112)2025-11-24 fca172e [compiler] Ignore ESLint suppressions when ValidateMemoDeps enabled (#35184)2026-01-23 006ae37 [compiler] Collapse CompilerError.{invariant,simpleInvariant} (#35614)2026-02-20 b16b768 [compiler] Feature flag cleanup (#35825)2026-02-23 8b6b11f [compiler] Remove fallback compilation pipeline dead code (#35827)2023-06-02 b98ee34 Delegate BabelPlugin to CompilerEntrypoint
Every commit that changed it, 2023-06-02 – 2026-02-23. Raised orange dots are fixes.
  1. Changed [compiler] Remove fallback compilation pipeline dead code (#35827)

    8b6b11f · Joseph Savona

  2. Changed [compiler] Feature flag cleanup (#35825)

    b16b768 · Joseph Savona

  3. Changed [compiler] Collapse CompilerError.{invariant,simpleInvariant} (#35614)

    006ae37 · Joseph Savona

  4. Changed [compiler] Ignore ESLint suppressions when ValidateMemoDeps enabled (#35184)

    fca172e · Joseph Savona

  5. Changed [compiler] Deprecate noEmit, add outputMode (#35112)

    50e7ec8 · Joseph Savona

  6. Changed [compiler] Migrate CompilerError.invariant to new CompilerDiagnostic infra (#34403)

    474f258 · lauren

  7. Changed [compiler] Derive ErrorSeverity from ErrorCategory (#34401)

    60d9b97 · lauren

  8. Changed [compiler] Aggregate error reporting, separate eslint rules (#34176)

    7d29ecb · Joseph Savona

  9. Changed [compiler][gating] Custom opt out directives (experimental option) (#33328)

    f9ae0a4 · mofeiZ

  10. Changed [compiler][entrypoint] Fix edgecases for noEmit and opt-outs (#33148)

    3820740 · mofeiZ fix · INFERRED

  11. Changed [compiler][be] Make program traversal more readable (#33147)

    5069e18 · mofeiZ

  12. Changed [compiler] Emit CompileSkip before CompileSuccess event (#33012)

    9938f83 · lauren

  13. Changed [compiler] Fix inferEffectDependencies lint false positives (#32769)

    8039f1b · mofeiZ

  14. Changed [compiler] Avoid failing builds when import specifiers conflict or shadow vars (#32663)

    c61e75b · mofeiZ

  15. Changed [compiler][bugfix] Don't insert hook guards in retry pipeline (#32665)

    0962f68 · mofeiZ fix · INFERRED

  16. Changed [compiler] detect and throw on untransformed required features (#32512)

    5398b71 · mofeiZ

  17. Changed [compiler] clean up retry pipeline: `fireRetry` flag -> compileMode (#32511)

    7939d92 · mofeiZ

  18. Changed [compiler][ez] Stop bailing out early for hoisted gated functions (#32597)

    93b61fc · mofeiZ

  19. Changed [compiler][rfc] Hacky retry pipeline for fire (#32164)

    152bfe3 · mofeiZ

  20. Changed [compile] Error on fire outside of effects and ensure correct compilation, correct import (#31798)

    45a720f · Jordan Brown

  21. Changed [compiler] add fire imports (#31797)

    ab27231 · Jordan Brown

  22. Changed JSX Outlining (#30956)

    c91b3b0 · Sathya Gunasekaran

  23. Changed [rcr] Update default runtimeModule to react-compiler-runtime (#31144)

    3fd3364 · lauren

  24. Changed [compiler] Errors in earlier functions dont stop subsequent compilation

    071dd00 · Joe Savona

  25. Changed [compiler] Validate environment config while parsing plugin opts

    177b241 · Joe Savona

  26. Changed [compiler] Run compiler pipeline on 'use no forget'

    e9a869f · Lauren Tan

  27. Changed [compiler] Patch error reporting for blocklisted imports

    8d74e8c · Mofei Zhang

  28. Changed [compiler][ez] Option to bail out on blocklisted imports

    2d2cc04 · Mofei Zhang

  29. Changed [compiler][be] Clean up compilation skipping logic in Program

    3871fda · Mofei Zhang

  30. Changed [compiler] Add context callee import if required

    9d2da59 · Sathya Gunsasekaran

  31. Changed [compiler] Rewrite useContext callee

    83cc13f · Sathya Gunsasekaran

  32. Changed [compiler] Make inserting outlined functions more resilient

    9f3bbb0 · Lauren Tan

  33. Changed [compiler] Always emit FuncDecl for outlined functions

    88bf4e1 · Lauren Tan

  34. Changed [compiler] Correctly insert (Arrow)FunctionExpressions

    a6b7e43 · Lauren Tan

  35. Changed Compiler: unfork prettier config (#30205)

    fd2b3e1 · Jan Kassens

  36. Changed [compiler] General-purpose function outlining

    9d7f02d · Joe Savona

  37. Changed [compiler] Refactor Program to use queue of functions to compile

    a8c5e23 · Joe Savona

  38. Changed fix[compiler] remove duplicate parsePluginOptions from the compilePro… (#29831)

    a714685 · Yuto Yoshino fix · INFERRED

  39. Changed compiler: Log metrics on pruned memo blocks/values

    cdbafc8 · Joe Savona

  40. Changed [compiler] Debug tool to emit change detection code rather than memoization

    5c420e3 · Mike Vitousek

  41. Changed Use unique name for c import local identifier

    7e3be12 · Joe Savona

  42. Changed Support HMR

    6b23c25 · Joe Savona

  43. Changed Update babel plugin to use runtime from react/compiler-runtime (#2918)

    ebe58ee · Jan Kassens

  44. Changed [dx] Update error messages for config parsing

    fc7467a · Joe Savona

  45. Changed [babel] Add a sources option

    6bf64df · Sathya Gunsasekaran

  46. Changed [eslint] Enforce generic array type syntax

    cd3f56b · Sathya Gunasekaran

  47. Changed [logger] Add CompilerDiagnostic category, thread Logger into environment

    b35779c · Mofei Zhang

  48. Changed Add config option to ignore 'use no forget' directives

    f5d99ba · Jordan Brown

  49. Changed Infer type of React function

    ad8f196 · Sathya Gunasekaran

  50. Changed [other] Change instrumentation to use an optional gating identifier; record filepath

    a06ded9 · Mofei Zhang

  51. Changed [Babel] Add support for "use memo"

    770ca4a · Sathya Gunasekaran

  52. Changed Enable hook syntax support

    ca3d16c · Joe Savona

  53. Changed Allow module level "use no forget"

    5142aff · Lauren Tan

  54. Changed Fix lints

    48024b7 · Mike Vitousek fix · INFERRED

  55. Changed Option to bail on Flow react-rule suppressions

    19476aa · Mike Vitousek

  56. Changed Support customizable eslint suppressions

    bc145f6 · Joe Savona

  57. Changed Early branch with new type inference foundation

    7ca3b00 · Joe Savona

  58. Changed [validation] Runtime validation for hook calls

    41b164e · Mofei Zhang

  59. Changed [be] Move codegen logic Program.ts -> Codegen

    37e1975 · Mofei Zhang

  60. Changed Add logging for number of memo *blocks* (in addition to slots)

    9fb3a26 · Joe Savona

  61. Changed [Babel] Fix up eslint suppression logic

    6d10143 · Lauren Tan fix · INFERRED

  62. Changed [ez] Use BabelFn type

    f135942 · Sathya Gunasekaran

  63. Changed [babel] Refactor handleError to pass the error first

    7aca04a · Sathya Gunasekaran

  64. Changed Don't allow null to be passed to validateEnvironmentConfig

    3f7b9e2 · Sathya Gunasekaran

  65. Changed Use starred-block for multi line comments

    6405c98 · Sathya Gunasekaran

  66. Changed Fix to only add imports if we compiled something

    702aadd · Joe Savona fix · INFERRED

  67. Changed Don't plumb PartialEnvironmentConfig

    1c53385 · Sathya Gunasekaran

  68. Changed [babel] Outline insertNewFunctionDeclaration

    58a10c0 · Sathya Gunasekaran

  69. Changed Remove hasForgetMutatedOriginalSource

    d8734b5 · Sathya Gunasekaran

  70. Changed [babel] Simplify noEmit and hasCriticalError check

    bccd06a · Sathya Gunasekaran

  71. Changed Check if critical error before throwing

    688305a · Sathya Gunasekaran

  72. Changed Validate options before replacing with compiled function

    cf70ef8 · Sathya Gunasekaran

  73. Changed Add runtime validation for ExternalFunction

    d6ff65e · Sathya Gunasekaran

  74. Changed [ez] Check for use-before-decl only when gating is on

    60af667 · Sathya Gunasekaran

  75. Changed [babel] Check if the gated component is used before decl

    adadc21 · Sathya Gunasekaran

  76. Changed [babel] Clean up import logic a bit

    0a7bb7a · Lauren Tan

  77. Changed [babel] Allow userspace useMemoCache

    ac170f4 · Lauren Tan

  78. Changed [pipeline] panicOnBailout -> panicThreshold; remove isDev logging

    f993f0c · Mofei Zhang

  79. Changed [pipeline] Make logging more structured

    b2230f6 · Mofei Zhang

  80. Changed Revamp compilation modes

    869466b · Mofei Zhang

  81. Changed Disable compilation of "Components" inside class methods

    41c23e8 · Joe Savona

  82. Changed Enable compilation of FunctionExpressions

    ddc9f80 · Joe Savona

  83. Changed [rfc] Dont convert ArrowFunction to FunctionDecl

    cee08ba · Joe Savona

  84. Changed Address feedback

    298bf55 · Lauren Tan

  85. Changed [be] More babel plugin Program cleanup

    3ec95c5 · Lauren Tan

  86. Changed [be] Move more logic into Imports module

    25e3575 · Lauren Tan

  87. Changed [be] Refactor gating logic in babel plugin

    dd8b743 · Lauren Tan

  88. Changed Add first example of error suggestion

    3fb8937 · Lauren Tan

  89. Changed Refactor CompilerErrorDetails

    448ed2b · Lauren Tan

  90. Changed Add InvalidReact and InvalidConfig error severities

    6c4318e · Lauren Tan

  91. Changed Make CompilerError.invariant assert the condition

    3f2b346 · Lauren Tan

  92. Changed Remove codeframe/nodepath options from CompilerError

    6c425f6 · Lauren Tan

  93. Changed [babel-plugin][ez] Rename shouldCompile to shouldVisitNode

    f467774 · Lauren Tan

  94. Changed Add a noEmit compiler option

    98633d1 · Lauren Tan

  95. Changed [babel-plugin] buildFunctionDeclaration errors are todos

    a558b15 · Lauren Tan

  96. Changed Unify UnsafeInput and InvalidInput

    501cf92 · Lauren Tan

  97. Changed [config] Clean up codegen imports and gating

    5ba0a03 · Mofei Zhang

  98. Changed [devx] emit calls to `makeReadOnly` for debugging

    a65e9cd · Mofei Zhang

  99. Changed Move entrypoint into its own directory

    479ef40 · Lauren Tan

  100. Changed Make CompilerEntrypoint a little more generic

    2eded94 · Lauren Tan

  101. Born Delegate BabelPlugin to CompilerEntrypoint

    b98ee34 · Lauren Tan