Skip to main content

Crate wesc

Crate wesc 

Source
Expand description

wesc compiles web components into a single HTML stream.

The crate is organized as a small pipeline:

  • build orchestrates a build: resolve dependencies, extract assets, and drive the top-level expansion loop.
  • [component] expands a single custom element from its definition, and [slots] resolves the light-DOM content that fills its <slot>s. These two are mutually recursive.
  • [simple_template] is a fast path for templates that contain only static markup and slots.
  • [assets] extracts top-level <style>/<script> into CSS and JS bundles.
  • [scan] and write_tags provide the byte-level and streaming HTML scanning primitives, backed by the cached chunked reader in chunk_reader.
  • component_definitions, dep_graph, and slotted_positions resolve <link rel="definition"> declarations, the dependency tree, and slotted light-DOM ranges respectively.

Modules§

chunk_reader
component_definitions
dep_graph
slotted_positions
write_tags

Structs§

BuildOptions
Tag

Constants§

CHUNK_SIZE
CONTENT_IN_PROGRESS
DEFAULT_SLOT_NAME

Functions§

build
Build the web components from the entry points to an output handler function.