Skip to main content

EcmascriptChunkPlaceable

Trait EcmascriptChunkPlaceable 

Source
pub trait EcmascriptChunkPlaceable:
    ChunkableModule
    + Module
    + Send
    + Sync
    + NonLocalValue
    + ValueDebug {
    // Required methods
    fn get_exports(self: Vc<Self>) -> Vc<EcmascriptExports>
       where Self: Sized;
    fn chunk_item_content(
        self: Vc<Self>,
        _chunking_context: Vc<Box<dyn ChunkingContext>>,
        _module_graph: Vc<ModuleGraph>,
        _async_module_info: Option<Vc<AsyncModuleInfo>>,
        _estimated: bool,
    ) -> Vc<EcmascriptChunkItemContent>
       where Self: Sized;

    // Provided methods
    fn get_async_module(self: Vc<Self>) -> Vc<OptionAsyncModule>
       where Self: Sized { ... }
    fn chunk_item_content_ident(
        self: Vc<Self>,
        _chunking_context: Vc<Box<dyn ChunkingContext>>,
        _module_graph: Vc<ModuleGraph>,
    ) -> Vc<AssetIdent>
       where Self: Sized { ... }
    fn chunk_item_output_assets(
        self: Vc<Self>,
        _chunking_context: Vc<Box<dyn ChunkingContext>>,
        _module_graph: Vc<ModuleGraph>,
    ) -> Vc<OutputAssetsWithReferenced>
       where Self: Sized { ... }
}

Required Methods§

Source

fn get_exports(self: Vc<Self>) -> Vc<EcmascriptExports>
where Self: Sized,

Source

fn chunk_item_content( self: Vc<Self>, _chunking_context: Vc<Box<dyn ChunkingContext>>, _module_graph: Vc<ModuleGraph>, _async_module_info: Option<Vc<AsyncModuleInfo>>, _estimated: bool, ) -> Vc<EcmascriptChunkItemContent>
where Self: Sized,

Generate chunk item content directly on the module. This replaces the need for separate ChunkItem wrapper structs. The estimated parameter is used during size estimation - when true, implementations should avoid calling chunking context APIs that would cause cycles.

Provided Methods§

Source

fn get_async_module(self: Vc<Self>) -> Vc<OptionAsyncModule>
where Self: Sized,

Source

fn chunk_item_content_ident( self: Vc<Self>, _chunking_context: Vc<Box<dyn ChunkingContext>>, _module_graph: Vc<ModuleGraph>, ) -> Vc<AssetIdent>
where Self: Sized,

Returns the content identity for cache invalidation. Override this for modules whose content depends on more than just the module source (e.g., async loaders that depend on available modules).

Source

fn chunk_item_output_assets( self: Vc<Self>, _chunking_context: Vc<Box<dyn ChunkingContext>>, _module_graph: Vc<ModuleGraph>, ) -> Vc<OutputAssetsWithReferenced>
where Self: Sized,

Returns output assets that this chunk item depends on. Override this for modules that reference static assets, manifests, etc.

Trait Implementations§

Implementors§