dillon1000/react

Commit

Add ReactiveFunctionValue variant

Per the previous PR, we don't have a way to rewrite an arbitrary subset of a
ReactiveFunction into a function expression, since FunctionExpression's contents
is still in HIR.

While long-term our plan is to move to HIR everywhere, this PR adds a stopgap of
adding a ReactiveFunctionValue variant of ReactiveValue. As a reminder,
ReactiveValue is a union of (HIR) InstructionValue | SequenceExpression |
LogicalExpression | ConditionalExpression.

For now i did a first stab at the visitors and transforms with the idea that:

* By default, visitors/transforms _don't_ look into these function expressions,
since we didn't previously traverse into (HIR-based) FunctionExpression either

* But there is a visitor/transform method that you can override if you need to.
Browse files
Changed paths6 files
First-parent comparison
M compiler/packages/babel-plugin-react-forget/src/HIR/HIR.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/HIR/PrintHIR.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/CodegenReactiveFunction.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PropagateScopeDependencies.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PruneNonEscapingScopes.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/visitors.ts Modified
Patch

Files changed

Rendering syntax-highlighted changes…