pub trait ChunkingContext:
Send
+ Sync
+ NonLocalValue
+ ValueDebug {
Show 34 methods
// Required methods
fn name(self: Vc<Self>) -> Vc<RcStr>
where Self: Sized;
fn source_map_source_type(self: Vc<Self>) -> Vc<SourceMapSourceType>
where Self: Sized;
fn root_path(self: Vc<Self>) -> Vc<FileSystemPath>
where Self: Sized;
fn output_root(self: Vc<Self>) -> Vc<FileSystemPath>
where Self: Sized;
fn output_root_to_root_path(self: Vc<Self>) -> Vc<RcStr>
where Self: Sized;
fn environment(self: Vc<Self>) -> Vc<Environment>
where Self: Sized;
fn chunk_root_path(self: Vc<Self>) -> Vc<FileSystemPath>
where Self: Sized;
fn chunk_path(
self: Vc<Self>,
asset: Option<Vc<Box<dyn Asset>>>,
ident: Vc<AssetIdent>,
content_hashing_prefix: Option<RcStr>,
extension: RcStr,
) -> Vc<FileSystemPath>
where Self: Sized;
fn reference_chunk_source_maps(
self: Vc<Self>,
chunk: Vc<Box<dyn OutputAsset>>,
) -> Vc<bool>
where Self: Sized;
fn reference_module_source_maps(
self: Vc<Self>,
module: Vc<Box<dyn Module>>,
) -> Vc<bool>
where Self: Sized;
fn asset_url(
self: Vc<Self>,
ident: FileSystemPath,
tag: Option<RcStr>,
) -> Vc<RcStr>
where Self: Sized;
fn asset_path(
self: Vc<Self>,
content: Vc<AssetContent>,
original_asset_ident: Vc<AssetIdent>,
tag: Option<RcStr>,
) -> Vc<FileSystemPath>
where Self: Sized;
fn async_loader_chunk_item(
self: Vc<Self>,
module: Vc<Box<dyn ChunkableModule>>,
module_graph: Vc<ModuleGraph>,
availability_info: AvailabilityInfo,
) -> Vc<Box<dyn ChunkItem>>
where Self: Sized;
fn async_loader_chunk_item_ident(
self: Vc<Self>,
module: Vc<Box<dyn ChunkableModule>>,
) -> Vc<AssetIdent>
where Self: Sized;
fn chunk_group(
self: Vc<Self>,
ident: Vc<AssetIdent>,
chunk_group: ChunkGroup,
module_graph: Vc<ModuleGraph>,
availability_info: AvailabilityInfo,
) -> Vc<ChunkGroupResult>
where Self: Sized;
fn evaluated_chunk_group(
self: Vc<Self>,
ident: Vc<AssetIdent>,
chunk_group: ChunkGroup,
module_graph: Vc<ModuleGraph>,
extra_chunks: Vc<OutputAssets>,
availability_info: AvailabilityInfo,
) -> Vc<ChunkGroupResult>
where Self: Sized;
fn entry_chunk_group(
self: Vc<Self>,
path: FileSystemPath,
chunk_group: ChunkGroup,
module_graph: Vc<ModuleGraph>,
extra_chunks: Vc<OutputAssets>,
extra_referenced_assets: Vc<OutputAssets>,
availability_info: AvailabilityInfo,
) -> Vc<EntryChunkGroupResult>
where Self: Sized;
fn chunk_item_id_strategy(self: Vc<Self>) -> Vc<ModuleIdStrategy>
where Self: Sized;
fn module_export_usage(
self: Vc<Self>,
module: Vc<Box<dyn Module>>,
) -> Vc<ModuleExportUsage>
where Self: Sized;
fn unused_references(self: Vc<Self>) -> Vc<UnusedReferences>
where Self: Sized;
fn debug_ids_enabled(self: Vc<Self>) -> Vc<bool>
where Self: Sized;
// Provided methods
fn chunk_loading(self: Vc<Self>) -> Vc<ChunkLoading>
where Self: Sized { ... }
fn service_worker_scope_base_path(self: Vc<Self>) -> Vc<RcStr>
where Self: Sized { ... }
fn url_behavior(self: Vc<Self>, _tag: Option<RcStr>) -> Vc<UrlBehavior>
where Self: Sized { ... }
fn chunking_configs(self: Vc<Self>) -> Vc<ChunkingConfigs>
where Self: Sized { ... }
fn batching_config(self: Vc<Self>) -> Vc<BatchingConfig>
where Self: Sized { ... }
fn is_nested_async_availability_enabled(self: Vc<Self>) -> Vc<bool>
where Self: Sized { ... }
fn is_module_merging_enabled(self: Vc<Self>) -> Vc<bool>
where Self: Sized { ... }
fn is_dynamic_chunk_content_loading_enabled(self: Vc<Self>) -> Vc<bool>
where Self: Sized { ... }
fn minify_type(self: Vc<Self>) -> Vc<MinifyType>
where Self: Sized { ... }
fn should_use_absolute_url_references(self: Vc<Self>) -> Vc<bool>
where Self: Sized { ... }
fn hmr_chunk_list(
self: Vc<Self>,
_ident: Vc<AssetIdent>,
_chunks: Vc<OutputAssets>,
) -> Vc<OutputAssets>
where Self: Sized { ... }
fn worker_configuration_options(
self: Vc<Self>,
) -> Vc<WorkerConfigurationOptions>
where Self: Sized { ... }
fn worker_entrypoint(self: Vc<Self>) -> Vc<Box<dyn OutputAsset>>
where Self: Sized { ... }
}Expand description
A context for the chunking that influences the way chunks are created
Required Methods§
fn name(self: Vc<Self>) -> Vc<RcStr>where
Self: Sized,
fn source_map_source_type(self: Vc<Self>) -> Vc<SourceMapSourceType>where
Self: Sized,
Sourcefn root_path(self: Vc<Self>) -> Vc<FileSystemPath>where
Self: Sized,
fn root_path(self: Vc<Self>) -> Vc<FileSystemPath>where
Self: Sized,
The root path of the project
Sourcefn output_root(self: Vc<Self>) -> Vc<FileSystemPath>where
Self: Sized,
fn output_root(self: Vc<Self>) -> Vc<FileSystemPath>where
Self: Sized,
The output root path in the output filesystem
Sourcefn output_root_to_root_path(self: Vc<Self>) -> Vc<RcStr>where
Self: Sized,
fn output_root_to_root_path(self: Vc<Self>) -> Vc<RcStr>where
Self: Sized,
A relative path how to reach the root path from the output root. This is used to compute original paths at runtime relative to the output files. e. g. import.meta.url needs that.
fn environment(self: Vc<Self>) -> Vc<Environment>where
Self: Sized,
Sourcefn chunk_root_path(self: Vc<Self>) -> Vc<FileSystemPath>where
Self: Sized,
fn chunk_root_path(self: Vc<Self>) -> Vc<FileSystemPath>where
Self: Sized,
The path to the folder where all chunks are placed. This can be used to compute relative paths.
fn chunk_path(
self: Vc<Self>,
asset: Option<Vc<Box<dyn Asset>>>,
ident: Vc<AssetIdent>,
content_hashing_prefix: Option<RcStr>,
extension: RcStr,
) -> Vc<FileSystemPath>where
Self: Sized,
Sourcefn reference_chunk_source_maps(
self: Vc<Self>,
chunk: Vc<Box<dyn OutputAsset>>,
) -> Vc<bool>where
Self: Sized,
fn reference_chunk_source_maps(
self: Vc<Self>,
chunk: Vc<Box<dyn OutputAsset>>,
) -> Vc<bool>where
Self: Sized,
Reference Source Map Assets for chunks
Sourcefn reference_module_source_maps(
self: Vc<Self>,
module: Vc<Box<dyn Module>>,
) -> Vc<bool>where
Self: Sized,
fn reference_module_source_maps(
self: Vc<Self>,
module: Vc<Box<dyn Module>>,
) -> Vc<bool>where
Self: Sized,
Include Source Maps for modules
Sourcefn asset_url(
self: Vc<Self>,
ident: FileSystemPath,
tag: Option<RcStr>,
) -> Vc<RcStr>where
Self: Sized,
fn asset_url(
self: Vc<Self>,
ident: FileSystemPath,
tag: Option<RcStr>,
) -> Vc<RcStr>where
Self: Sized,
Returns a URL (relative or absolute, depending on the asset prefix) to
the static asset based on its ident.
The tag is an arbitrary string that can be used to distinguish
different usages of the same asset (e.g. different base paths).
fn asset_path(
self: Vc<Self>,
content: Vc<AssetContent>,
original_asset_ident: Vc<AssetIdent>,
tag: Option<RcStr>,
) -> Vc<FileSystemPath>where
Self: Sized,
fn async_loader_chunk_item(
self: Vc<Self>,
module: Vc<Box<dyn ChunkableModule>>,
module_graph: Vc<ModuleGraph>,
availability_info: AvailabilityInfo,
) -> Vc<Box<dyn ChunkItem>>where
Self: Sized,
fn async_loader_chunk_item_ident(
self: Vc<Self>,
module: Vc<Box<dyn ChunkableModule>>,
) -> Vc<AssetIdent>where
Self: Sized,
fn chunk_group(
self: Vc<Self>,
ident: Vc<AssetIdent>,
chunk_group: ChunkGroup,
module_graph: Vc<ModuleGraph>,
availability_info: AvailabilityInfo,
) -> Vc<ChunkGroupResult>where
Self: Sized,
Sourcefn evaluated_chunk_group(
self: Vc<Self>,
ident: Vc<AssetIdent>,
chunk_group: ChunkGroup,
module_graph: Vc<ModuleGraph>,
extra_chunks: Vc<OutputAssets>,
availability_info: AvailabilityInfo,
) -> Vc<ChunkGroupResult>where
Self: Sized,
fn evaluated_chunk_group(
self: Vc<Self>,
ident: Vc<AssetIdent>,
chunk_group: ChunkGroup,
module_graph: Vc<ModuleGraph>,
extra_chunks: Vc<OutputAssets>,
availability_info: AvailabilityInfo,
) -> Vc<ChunkGroupResult>where
Self: Sized,
Like Self::chunk_group, but additionally produces an evaluate chunk
(and, in dev, a chunk-list register chunk) that bootstraps and runs
chunk_group’s entries.
extra_chunks are not part of this chunk group’s module graph, but they
are loaded alongside the entries (and tracked in the chunk-list register
chunk for HMR) — used to extend the entry’s HMR-tracked chunks with
chunks computed elsewhere (e.g. app-router client references).
Sourcefn entry_chunk_group(
self: Vc<Self>,
path: FileSystemPath,
chunk_group: ChunkGroup,
module_graph: Vc<ModuleGraph>,
extra_chunks: Vc<OutputAssets>,
extra_referenced_assets: Vc<OutputAssets>,
availability_info: AvailabilityInfo,
) -> Vc<EntryChunkGroupResult>where
Self: Sized,
fn entry_chunk_group(
self: Vc<Self>,
path: FileSystemPath,
chunk_group: ChunkGroup,
module_graph: Vc<ModuleGraph>,
extra_chunks: Vc<OutputAssets>,
extra_referenced_assets: Vc<OutputAssets>,
availability_info: AvailabilityInfo,
) -> Vc<EntryChunkGroupResult>where
Self: Sized,
Generates an output chunk that:
- loads the given extra_chunks in addition to the generated chunks; and
- evaluates the given assets; and
- exports the result of evaluating the last module as a CommonJS default export.
fn chunk_item_id_strategy(self: Vc<Self>) -> Vc<ModuleIdStrategy>where
Self: Sized,
fn module_export_usage(
self: Vc<Self>,
module: Vc<Box<dyn Module>>,
) -> Vc<ModuleExportUsage>where
Self: Sized,
fn unused_references(self: Vc<Self>) -> Vc<UnusedReferences>where
Self: Sized,
Provided Methods§
fn chunk_loading(self: Vc<Self>) -> Vc<ChunkLoading>where
Self: Sized,
fn service_worker_scope_base_path(self: Vc<Self>) -> Vc<RcStr>where
Self: Sized,
Sourcefn url_behavior(self: Vc<Self>, _tag: Option<RcStr>) -> Vc<UrlBehavior>where
Self: Sized,
fn url_behavior(self: Vc<Self>, _tag: Option<RcStr>) -> Vc<UrlBehavior>where
Self: Sized,
Returns the URL behavior for a given tag. This determines how asset URLs are suffixed (e.g., for deployment IDs).
fn chunking_configs(self: Vc<Self>) -> Vc<ChunkingConfigs>where
Self: Sized,
fn batching_config(self: Vc<Self>) -> Vc<BatchingConfig>where
Self: Sized,
Sourcefn is_nested_async_availability_enabled(self: Vc<Self>) -> Vc<bool>where
Self: Sized,
fn is_nested_async_availability_enabled(self: Vc<Self>) -> Vc<bool>where
Self: Sized,
Whether async modules should create an new availability boundary and therefore nested async modules include less modules. Enabling this will lead to better optimized async chunks, but it will require to compute all possible paths in the application, which might lead to many combinations.
Sourcefn is_module_merging_enabled(self: Vc<Self>) -> Vc<bool>where
Self: Sized,
fn is_module_merging_enabled(self: Vc<Self>) -> Vc<bool>where
Self: Sized,
Whether to use MergeableModule to merge modules if possible.
Sourcefn is_dynamic_chunk_content_loading_enabled(self: Vc<Self>) -> Vc<bool>where
Self: Sized,
fn is_dynamic_chunk_content_loading_enabled(self: Vc<Self>) -> Vc<bool>where
Self: Sized,
Whether to include information about the content of the chunk into the runtime, to allow more incremental loading of individual chunk items.
fn minify_type(self: Vc<Self>) -> Vc<MinifyType>where
Self: Sized,
fn should_use_absolute_url_references(self: Vc<Self>) -> Vc<bool>where
Self: Sized,
Sourcefn hmr_chunk_list(
self: Vc<Self>,
_ident: Vc<AssetIdent>,
_chunks: Vc<OutputAssets>,
) -> Vc<OutputAssets>where
Self: Sized,
fn hmr_chunk_list(
self: Vc<Self>,
_ident: Vc<AssetIdent>,
_chunks: Vc<OutputAssets>,
) -> Vc<OutputAssets>where
Self: Sized,
In development, produces a standalone HMR chunk-list register chunk
that tracks chunks for hot-module-replacement without producing an
evaluate chunk. Returns None (empty vec) outside dev or when HMR is
disabled. Used to register a page-specific chunk list that covers
client-reference chunks built outside the shared module graph.
Sourcefn worker_configuration_options(
self: Vc<Self>,
) -> Vc<WorkerConfigurationOptions>where
Self: Sized,
fn worker_configuration_options(
self: Vc<Self>,
) -> Vc<WorkerConfigurationOptions>where
Self: Sized,
Returns the worker-related configuration: the base-path override and the list of globals to forward to workers.
Sourcefn worker_entrypoint(self: Vc<Self>) -> Vc<Box<dyn OutputAsset>>where
Self: Sized,
fn worker_entrypoint(self: Vc<Self>) -> Vc<Box<dyn OutputAsset>>where
Self: Sized,
Returns the worker entrypoint for this chunking context.
Trait Implementations§
impl Dynamic<Box<dyn ChunkingContext>> for Box<dyn ChunkingContext>
impl Dynamic<Box<dyn ValueDebug>> for Box<dyn ChunkingContext>
Source§impl TraitVtablePrototype for Box<dyn ChunkingContext>
impl TraitVtablePrototype for Box<dyn ChunkingContext>
impl Upcast<Box<dyn ChunkingContext>> for Box<dyn ChunkingContext>
impl Upcast<Box<dyn ValueDebug>> for Box<dyn ChunkingContext>
impl UpcastStrict<Box<dyn ValueDebug>> for Box<dyn ChunkingContext>
Source§impl VcValueTrait for Box<dyn ChunkingContext>
impl VcValueTrait for Box<dyn ChunkingContext>
Source§const IMPL_VTABLES: &'static VTableRegistry<Self::ValueTrait>
const IMPL_VTABLES: &'static VTableRegistry<Self::ValueTrait>
type ValueTrait = dyn ChunkingContext
Source§fn get_trait_type_id() -> TraitTypeId
fn get_trait_type_id() -> TraitTypeId
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".