Re-exports§
pub use align_method_call_scopes::align_method_call_scopes;pub use align_object_method_scopes::align_object_method_scopes;pub use align_reactive_scopes_to_block_scopes_hir::align_reactive_scopes_to_block_scopes_hir;pub use build_reactive_scope_terminals_hir::build_reactive_scope_terminals_hir;pub use flatten_reactive_loops_hir::flatten_reactive_loops_hir;pub use flatten_scopes_with_hooks_or_use_hir::flatten_scopes_with_hooks_or_use_hir;pub use analyse_functions::analyse_functions;pub use infer_mutation_aliasing_effects::infer_mutation_aliasing_effects;pub use infer_mutation_aliasing_ranges::infer_mutation_aliasing_ranges;pub use infer_reactive_places::infer_reactive_places;pub use infer_reactive_scope_variables::infer_reactive_scope_variables;pub use memoize_fbt_and_macro_operands_in_same_scope::memoize_fbt_and_macro_operands_in_same_scope;pub use merge_overlapping_reactive_scopes_hir::merge_overlapping_reactive_scopes_hir;pub use propagate_scope_dependencies_hir::propagate_scope_dependencies_hir;
Modules§
- align_
method_ call_ scopes - Ensures that method call instructions have scopes such that either:
- align_
object_ method_ scopes - Aligns scopes of object method values to that of their enclosing object expressions. To produce a well-formed JS program in Codegen, object methods and object expressions must be in the same ReactiveBlock as object method definitions must be inlined.
- align_
reactive_ scopes_ to_ block_ scopes_ hir - Aligns reactive scope boundaries to block scope boundaries in the HIR.
- analyse_
functions - Recursively analyzes nested function expressions and object methods to infer their aliasing effect signatures.
- build_
reactive_ scope_ terminals_ hir - Builds reactive scope terminals in the HIR.
- flatten_
reactive_ loops_ hir - Prunes any reactive scopes that are within a loop (for, while, etc). We don’t yet
support memoization within loops because this would require an extra layer of reconciliation
(plus a way to identify values across runs, similar to how we use
keyin JSX for lists). Eventually we may integrate more deeply into the runtime so that we can do a single level of reconciliation, but for now we’ve found it’s sufficient to memoize around the loop. - flatten_
scopes_ with_ hooks_ or_ use_ hir - For simplicity the majority of compiler passes do not treat hooks specially. However, hooks are different from regular functions in two key ways:
- infer_
mutation_ aliasing_ effects - Infers the mutation/aliasing effects for instructions and terminals.
- infer_
mutation_ aliasing_ ranges - Infers mutable ranges for identifiers and populates Place effects.
- infer_
reactive_ places - Infers which
Places are reactive. - infer_
reactive_ scope_ variables - Infers which variables belong to reactive scopes.
- memoize_
fbt_ and_ macro_ operands_ in_ same_ scope - Port of MemoizeFbtAndMacroOperandsInSameScope from TypeScript.
- merge_
overlapping_ reactive_ scopes_ hir - Merges reactive scopes that have overlapping ranges.
- propagate_
scope_ dependencies_ hir - Propagates scope dependencies through the HIR, computing which values each reactive scope depends on.