Skip to content

Commit 1b21452

Browse files
committed
[compiler] Delete propagateScopeDeps (non-hir)
`enablePropagateScopeDepsHIR` is now used extensively in Meta. This has been tested for over two weeks in our e2e tests and production. The rest of this stack deletes `LoweredFunction.dependencies`, which the non-hir version of `PropagateScopeDeps` depends on. To avoid a more forked HIR (non-hir with dependencies and hir with no dependencies), let's go ahead and clean up the non-hir version of PropagateScopeDepsHIR. Note that all fixture changes in this PR were previously reviewed when they were copied to `propagate-scope-deps-hir-fork`. Will clean up / merge these duplicate fixtures in a later PR '
1 parent f2f002c commit 1b21452

File tree

61 files changed

+566
-1868
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+566
-1868
lines changed

compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ import {
5757
mergeReactiveScopesThatInvalidateTogether,
5858
promoteUsedTemporaries,
5959
propagateEarlyReturns,
60-
propagateScopeDependencies,
6160
pruneHoistedContexts,
6261
pruneNonEscapingScopes,
6362
pruneNonReactiveDependencies,
@@ -348,14 +347,12 @@ function* runWithEnvironment(
348347
});
349348
assertTerminalSuccessorsExist(hir);
350349
assertTerminalPredsExist(hir);
351-
if (env.config.enablePropagateDepsInHIR) {
352-
propagateScopeDependenciesHIR(hir);
353-
yield log({
354-
kind: 'hir',
355-
name: 'PropagateScopeDependenciesHIR',
356-
value: hir,
357-
});
358-
}
350+
propagateScopeDependenciesHIR(hir);
351+
yield log({
352+
kind: 'hir',
353+
name: 'PropagateScopeDependenciesHIR',
354+
value: hir,
355+
});
359356

360357
if (env.config.inlineJsxTransform) {
361358
inlineJsxTransform(hir, env.config.inlineJsxTransform);
@@ -383,15 +380,6 @@ function* runWithEnvironment(
383380
});
384381
assertScopeInstructionsWithinScopes(reactiveFunction);
385382

386-
if (!env.config.enablePropagateDepsInHIR) {
387-
propagateScopeDependencies(reactiveFunction);
388-
yield log({
389-
kind: 'reactive',
390-
name: 'PropagateScopeDependencies',
391-
value: reactiveFunction,
392-
});
393-
}
394-
395383
pruneNonEscapingScopes(reactiveFunction);
396384
yield log({
397385
kind: 'reactive',

compiler/packages/babel-plugin-react-compiler/src/HIR/Environment.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,6 @@ const EnvironmentConfigSchema = z.object({
231231
*/
232232
enableUseTypeAnnotations: z.boolean().default(false),
233233

234-
enablePropagateDepsInHIR: z.boolean().default(false),
235-
236-
/**
237-
* Enables inference of optional dependency chains. Without this flag
238-
* a property chain such as `props?.items?.foo` will infer as a dep on
239-
* just `props`. With this flag enabled, we'll infer that full path as
240-
* the dependency.
241-
*/
242-
enableOptionalDependencies: z.boolean().default(true),
243-
244234
/**
245235
* Enables inlining ReactElement object literals in place of JSX
246236
* An alternative to the standard JSX transform which replaces JSX with React's jsxProd() runtime

0 commit comments

Comments
 (0)