Skip to content

Commit acd5834

Browse files
committed
Update on "[compiler] Fix issue where second argument of all functions was considered to be a ref"
[ghstack-poisoned]
2 parents 34d096f + 0dea20f commit acd5834

File tree

286 files changed

+11451
-2953
lines changed

Some content is hidden

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

286 files changed

+11451
-2953
lines changed

compiler/apps/playground/components/Editor/EditorImpl.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ function compile(source: string): [CompilerOutput, 'flow' | 'typescript'] {
235235
name: result.name,
236236
value: {
237237
type: 'FunctionDeclaration',
238-
id,
238+
id: withIdentifier(result.value.id),
239239
async: result.value.async,
240240
generator: result.value.generator,
241241
body: result.value.body,

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

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ import {propagatePhiTypes} from '../TypeInference/PropagatePhiTypes';
101101
import {lowerContextAccess} from '../Optimization/LowerContextAccess';
102102
import {validateNoSetStateInPassiveEffects} from '../Validation/ValidateNoSetStateInPassiveEffects';
103103
import {validateNoJSXInTryStatement} from '../Validation/ValidateNoJSXInTryStatement';
104+
import {propagateScopeDependenciesHIR} from '../HIR/PropagateScopeDependenciesHIR';
104105

105106
export type CompilerPipelineValue =
106107
| {kind: 'ast'; name: string; value: CodegenFunction}
@@ -341,6 +342,14 @@ function* runWithEnvironment(
341342
});
342343
assertTerminalSuccessorsExist(hir);
343344
assertTerminalPredsExist(hir);
345+
if (env.config.enablePropagateDepsInHIR) {
346+
propagateScopeDependenciesHIR(hir);
347+
yield log({
348+
kind: 'hir',
349+
name: 'PropagateScopeDependenciesHIR',
350+
value: hir,
351+
});
352+
}
344353

345354
const reactiveFunction = buildReactiveFunction(hir);
346355
yield log({
@@ -359,12 +368,14 @@ function* runWithEnvironment(
359368
});
360369
assertScopeInstructionsWithinScopes(reactiveFunction);
361370

362-
propagateScopeDependencies(reactiveFunction);
363-
yield log({
364-
kind: 'reactive',
365-
name: 'PropagateScopeDependencies',
366-
value: reactiveFunction,
367-
});
371+
if (!env.config.enablePropagateDepsInHIR) {
372+
propagateScopeDependencies(reactiveFunction);
373+
yield log({
374+
kind: 'reactive',
375+
name: 'PropagateScopeDependencies',
376+
value: reactiveFunction,
377+
});
378+
}
368379

369380
pruneNonEscapingScopes(reactiveFunction);
370381
yield log({

0 commit comments

Comments
 (0)