makepad/libs/web_manifest/Cargo.toml
Admin 7657568654 web pack: the collect-web run, Event::Scan and cargo makepad wasm --pack <film|app|full> -- collection is dynamic: MAKEPAD_RUN=collect-web (with MAKEPAD_COLLECT=<dir>) is a variant of the headless/hidden runtime that boots the app once in the web font set with shader-pack recording on from before the first script module, draws a few frames, sends ONE Event::Scan through the widget tree, draws again and writes the manifest (makepad-web-manifest: shaders.pack + list, kernels, glyph coverage per font file with the laid-out texts, widgets, assets, JS features, diagnostics; every need records who emitted it, widget type and path or file:line). The scan API: cx.is_collecting()/collect_scan(), ScanEvent::need_font_full/need_glyphs/need_font_range/need_kernel/need_widget/need_asset/need_js_feature, and Scanner plug-ins for runtimes (Stage's film scanner). Widgets: every WidgetRef records its type, runs Widget::scan and forwards the scan to all children, visible or not; TextInput needs its fonts in full plus text-input/clipboard, labels/buttons/check boxes/radios/drop-downs emit their texts, Modal and DropDown open their popups, Video needs video-playback, and data-driven spawners (PortalList) spawn the variants named by the new additive scan: [@Row, RowView{}] property and forward into them (widgets/core/src/scan.rs). The text stack records every glyph layouts return per font (Layouter::record_glyphs, also for 3D type in text_mesh) and logs glyphs a shipped font lacks; get_resource records assets. --pack=<preset> (+ --strict) runs the app's collect build first, links the shader pack in (--cfg makepad_shader_pack, installed by app_main! before the first apply; strict also --cfg makepad_precompiled_shaders, no compiler), cuts fonts by coverage with makepad-font-subset, strips the JS sections no need names, and writes the linked wasm's per-crate profile; makepad-web-pack holds the presets/knobs, coverage, JS stripping, output and a static server shared with Stage. Also --link-table and --opt-speed=<crates> (opt-level 3 per crate through the profile, z for the rest). Counter example (brotli wasm): unpacked 1.477 MB, --pack=app 1.495 MB, --pack=app --strict 1.423 MB (9 widget types collected; JS 42.5 -> 35.1 KB); uizoo 1.872 MB unpacked, --pack=app 1.914 MB (33 widget types collected). Checked: cargo test --release -p makepad-web-pack -p makepad-web-manifest -p makepad-platform --lib collect; cargo build --release -p cargo-makepad.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 11:14:06 +02:00

11 lines
557 B
TOML

[package]
name = "makepad-web-manifest"
version = "0.1.0"
authors = ["Makepad <info@makepad.nl>"]
edition = "2021"
description = "The collect manifest: what a collect run learned an app needs on the web (shaders, glyphs, font coverage, kernels, widgets, JS sections, assets, diagnostics), as files in one directory; written by the platform's collect-web run mode and Stage's film analysis, read by the packers"
license = "MIT OR Apache-2.0"
homepage = "https://github.com/makepad/makepad/"
repository = "https://github.com/makepad/makepad/"
[dependencies]