Skip to main content

Module strip

Module strip 

Source
Expand description

The project-level strip: rewrite a compiled ProjectOutput from TypeScript into a JavaScript artefact (the in-browser track’s first-class JS output, ADR 0137).

These functions walk a ProjectOutput, so they live with the rest of the orchestration in bynk-driver (crate-hygiene D1, #2982, PR 4); bynk-strip keeps the text-level strip (strip_types, strip_types_mapped) on bynk-ts and oxc alone, so it builds alongside the checker instead of after code generation.

Structs§

StripError
A failure to strip TypeScript to JavaScript. For input produced by the Bynk emitter this should never occur — the emitter only emits valid, strip-only TypeScript (ADR 0136) — so a StripError indicates an emitter or toolchain bug rather than user error.

Functions§

strip_project_to_js
Rewrite a compiled ProjectOutput from TypeScript into a JavaScript artefact (the in-browser track’s first-class JS output — ADR 0137). The emitter always produces TypeScript; a JS artefact is that same output with types stripped, which is total because the emitter is strip-only (ADR 0136).
strip_project_to_js_mapped
strip_project_to_js that also returns, per emitted .js path, a Bynk-to-JavaScript v3 source map composed from the emitter’s own Bynk-to-TypeScript map and the strip’s TypeScript-to-JavaScript map (#2705). Only the modules in only (JS output paths; the host passes the user’s own) are mapped, so the rest skip the work. The returned ProjectOutput is identical to strip_project_to_js’s: the maps are not added as documents.

Type Aliases§

JsMaps
The per-.js-path Bynk-to-JavaScript source maps of a stripped project.