Skip to main content

Crate react_compiler_hir

Crate react_compiler_hir 

Source

Re-exports§

pub use reactive::*;

Modules§

default_module_type_provider
Default module type provider, ported from DefaultModuleTypeProvider.ts.
dominator
Dominator and post-dominator tree computation.
environment
environment_config
Environment configuration, ported from EnvironmentConfigSchema in Environment.ts.
globals
Global type registry and built-in shape definitions, ported from Globals.ts.
object_shape
Object shapes and function signatures, ported from ObjectShape.ts.
print
Shared formatting utilities for HIR debug printing.
reactive
Reactive function types — tree representation of a compiled function.
type_config
Type configuration types, ported from TypeSchema.ts.
visitors

Structs§

AliasingSignature
Aliasing signature for function calls. Ported from TS AliasingSignature in AliasingEffects.ts.
ArrayPattern
BasicBlock
A basic block in the CFG
BlockId
BuiltinTag
Case
CompilerDiagnostic
A single compiler diagnostic (new-style)
DeclarationId
DependencyPathEntry
EvaluationOrder
Evaluation order assigned to instructions and terminals during numbering. This was previously called InstructionId in the TypeScript compiler.
FloatValue
Wrapper around f64 that stores raw bytes for deterministic equality and hashing. This allows use in HashMap keys and ensures NaN == NaN (bitwise comparison).
FunctionId
HIR
The HIR control-flow graph
HirFunction
A function lowered to HIR form
Identifier
IdentifierId
Instruction
InstructionId
Index into the flat instruction table on HirFunction.
LValue
LValuePattern
LoweredFunction
ManualMemoDependency
MutableRange
MutableRangeId
ObjectPattern
ObjectProperty
Phi
Phi node for SSA
Place
Position
ReactiveScope
ReactiveScopeDeclaration
A declaration produced by a reactive scope.
ReactiveScopeDependency
A dependency of a reactive scope.
ReactiveScopeEarlyReturn
Early return value info for a reactive scope.
ScopeId
SourceLocation
Source location (matches Babel’s SourceLocation format) This is the HIR source location, separate from AST’s BaseNode location. GeneratedSource is represented as None.
SpreadPattern
TemplateQuasi
TypeId

Enums§

AliasingEffect
Describes the aliasing/mutation/data-flow effects of an instruction or terminal. Ported from TS AliasingEffect in AliasingEffects.ts.
ArrayElement
ArrayPatternElement
BinaryOperator
BindingKind
BlockKind
Block kinds
Effect
ErrorCategory
Error categories matching the TS ErrorCategory enum
FunctionExpressionType
GotoVariant
Hole
IdentifierName
InstructionKind
InstructionValue
JsxAttribute
JsxTag
LogicalOperator
ManualMemoDependencyRoot
MutationReason
Reason for a mutation, used for generating hints (e.g. rename to “Ref”).
NonLocalBinding
ObjectPropertyKey
ObjectPropertyOrSpread
ObjectPropertyType
ParamPattern
Pattern
PlaceOrSpread
PlaceOrSpreadOrHole
Combined Place/Spread/Hole for Apply args.
PrimitiveValue
PropertyLiteral
PropertyNameKind
ReactFunctionType
ReturnVariant
Terminal
Type
UnaryOperator
UpdateOperator
VariableBinding

Constants§

GENERATED_SOURCE
Sentinel value for generated/synthetic source locations

Functions§

format_js_number
Format an f64 the way JavaScript’s Number.prototype.toString() does.
is_array_type
Returns true if the type is an array.
is_jsx_type
Returns true if the type is JSX.
is_map_type
Returns true if the type is a Map.
is_plain_object_type
Returns true if the type is a plain object (BuiltInObject).
is_primitive_type
Returns true if the type (looked up via identifier) is primitive.
is_props_type
Returns true if the type is the props object.
is_ref_or_ref_like_mutable_type
Returns true if the type is a ref or ref-like mutable type (e.g. Reanimated shared values).
is_ref_or_ref_value
Returns true if the type is a ref or ref value.
is_ref_value_type
Returns true if the identifier type is a ref value.
is_set_state_type
Returns true if the type is a setState function (BuiltInSetState).
is_set_type
Returns true if the type is a Set.
is_start_transition_type
Returns true if the type is a startTransition function (BuiltInStartTransition).
is_use_effect_event_type
Returns true if the type is a useEffectEvent function.
is_use_effect_hook_type
Returns true if the type is a useEffect hook.
is_use_insertion_effect_hook_type
Returns true if the type is a useInsertionEffect hook.
is_use_layout_effect_hook_type
Returns true if the type is a useLayoutEffect hook.
is_use_operator_type
Returns true if the type is the use() operator (React.use).
is_use_ref_type
Returns true if the identifier type is useRef.
is_use_state_type
Returns true if the type is a useState result (BuiltInUseState).