Skip to main content

EnvironmentConfig

Struct EnvironmentConfig 

Source
pub struct EnvironmentConfig {
Show 39 fields pub custom_hooks: HashMap<String, HookConfig>, pub module_type_provider: Option<IndexMap<String, TypeConfig>>, pub custom_macros: Option<Vec<String>>, pub enable_reset_cache_on_source_file_changes: Option<bool>, pub enable_preserve_existing_memoization_guarantees: bool, pub validate_preserve_existing_memoization_guarantees: bool, pub validate_exhaustive_memoization_dependencies: bool, pub validate_exhaustive_effect_dependencies: ExhaustiveEffectDepsMode, pub enable_optional_dependencies: bool, pub enable_name_anonymous_functions: bool, pub validate_hooks_usage: bool, pub validate_ref_access_during_render: bool, pub validate_no_set_state_in_render: bool, pub enable_use_keyed_state: bool, pub validate_no_set_state_in_effects: bool, pub validate_no_derived_computations_in_effects: bool, pub validate_no_derived_computations_in_effects_exp: bool, pub validate_no_jsx_in_try_statements: bool, pub validate_static_components: bool, pub validate_no_capitalized_calls: Option<Vec<String>>, pub validate_blocklisted_imports: Option<Vec<String>>, pub validate_source_locations: bool, pub validate_no_impure_functions_in_render: bool, pub validate_no_freezing_known_mutable_functions: bool, pub enable_assume_hooks_follow_rules_of_react: bool, pub enable_transitively_freeze_function_expressions: bool, pub enable_emit_hook_guards: Option<ExternalFunctionConfig>, pub enable_emit_instrument_forget: Option<InstrumentationConfig>, pub enable_function_outlining: bool, pub enable_jsx_outlining: bool, pub assert_valid_mutable_ranges: bool, pub throw_unknown_exception_testonly: bool, pub enable_custom_type_definition_for_reanimated: bool, pub enable_treat_ref_like_identifiers_as_refs: bool, pub enable_treat_set_identifiers_as_state_setters: bool, pub validate_no_void_use_memo: bool, pub enable_allow_set_state_from_refs_in_effects: bool, pub enable_verbose_no_set_state_in_effect: bool, pub enable_forest: bool,
}
Expand description

Compiler environment configuration. Contains feature flags and settings.

Fields that would require passing JS functions across the JS/Rust boundary are omitted with TODO comments. The Rust port uses hardcoded defaults for these (e.g., defaultModuleTypeProvider).

Fields§

§custom_hooks: HashMap<String, HookConfig>

Custom hook type definitions, keyed by hook name.

§module_type_provider: Option<IndexMap<String, TypeConfig>>

Pre-resolved module type provider results. Map from module name to TypeConfig, computed by the JS shim.

§custom_macros: Option<Vec<String>>

Custom macro-like function names that should have their operands memoized in the same scope (similar to fbt).

§enable_reset_cache_on_source_file_changes: Option<bool>

If true, emit code to reset the memo cache on source file changes (HMR/fast refresh). If null (None), HMR detection is conditionally enabled based on NODE_ENV/DEV.

§enable_preserve_existing_memoization_guarantees: bool§validate_preserve_existing_memoization_guarantees: bool§validate_exhaustive_memoization_dependencies: bool§validate_exhaustive_effect_dependencies: ExhaustiveEffectDepsMode§enable_optional_dependencies: bool§enable_name_anonymous_functions: bool§validate_hooks_usage: bool§validate_ref_access_during_render: bool§validate_no_set_state_in_render: bool§enable_use_keyed_state: bool§validate_no_set_state_in_effects: bool§validate_no_derived_computations_in_effects: bool§validate_no_derived_computations_in_effects_exp: bool§validate_no_jsx_in_try_statements: bool§validate_static_components: bool§validate_no_capitalized_calls: Option<Vec<String>>§validate_blocklisted_imports: Option<Vec<String>>§validate_source_locations: bool§validate_no_impure_functions_in_render: bool§validate_no_freezing_known_mutable_functions: bool§enable_assume_hooks_follow_rules_of_react: bool§enable_transitively_freeze_function_expressions: bool§enable_emit_hook_guards: Option<ExternalFunctionConfig>

Hook guard configuration. When set, wraps hook calls with dispatcher guard calls.

§enable_emit_instrument_forget: Option<InstrumentationConfig>

Instrumentation configuration. When set, emits calls to instrument functions.

§enable_function_outlining: bool§enable_jsx_outlining: bool§assert_valid_mutable_ranges: bool§throw_unknown_exception_testonly: bool§enable_custom_type_definition_for_reanimated: bool§enable_treat_ref_like_identifiers_as_refs: bool§enable_treat_set_identifiers_as_state_setters: bool§validate_no_void_use_memo: bool§enable_allow_set_state_from_refs_in_effects: bool§enable_verbose_no_set_state_in_effect: bool§enable_forest: bool

Trait Implementations§

Source§

impl Clone for EnvironmentConfig

Source§

fn clone(&self) -> EnvironmentConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EnvironmentConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EnvironmentConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for EnvironmentConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for EnvironmentConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.