fix(release,ui): pack @openelement/ui through the compiled-element intrinsic transform (#1301) - #1302
Merged
Merged
Conversation
…trinsic transform (#1301) The packed npm artifact of @openelement/ui could not be SSR-admitted via the documented packageIslands path: deno pack transpiles the component .tsx sources to .js with TC39 decorator lowering (applyDecs2203R), which erases the compile-time-only @element/@Property intrinsics (ADR-0143 — their runtime exports are inert no-ops by design). No Part Program registered from the packed modules, so SSG failed closed with OE_PROGRAM_MISSING. In-repo consumers never saw this because the adapter auto-aliases workspace members to source (workspace-alias.ts). The admission contract is unchanged. The pack pipeline now runs the same open:compiled-element intrinsic transform a consumer build would run: packages shipping compiled-element sources are packed from a staged temporary workspace whose component modules carry the compiler output, so deno pack transpiles compiled form (semantics-preserving) instead of lowering the intrinsics away. Adds consumer:packaged-ui, a CI-gated (ci + release tiers) packed-artifact consumer qualification: the five pack:dry-run tarballs are installed into a hermetic scratch consumer outside the repository, a minimal app admits @openelement/ui via packageIslands, and the prerendered HTML must carry the compiled DSD for <open-theme-toggle>. RED pre-fix (build fails, OE_PROGRAM_MISSING), GREEN post-fix.
Contributor
|
APIError: Insufficient Balance |
This was referenced Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The packed npm artifact of
@openelement/uicould not be SSR-admitted via the documentedpackageIslands: ['@openelement/ui']path.@element/@propertyare compile-time-only intrinsics (ADR-0143, #1209): their runtime exports in@openelement/elementare inert no-ops by design, and the Part Program is produced exclusively by the adapter'sopen:compiled-elementtransform, which admits only.tsxmodules carrying a canonically bound@element(...)decorator application (packages/adapter-vite/src/internal/compiler/plugin.ts).deno packtranspilespackages/ui/src/*.tsxto.jswith TC39 decorator lowering (applyDecs2203R), erasing the decorator applications — so no Part Program can ever register from the packed modules, and SSG fails closed withOE_PROGRAM_MISSINGon the first ui component (<open-theme-toggle>).In-repo consumers (www, the ui-dogfood fixture, the packaged starter) never exercised this: the adapter auto-aliases workspace members to their
.tsxsource whenever cwd is inside a Deno workspace (packages/adapter-vite/src/workspace-alias.ts), and the packed starter does not consume ui.packages/app/packages/elementpacked artifacts keep their contract because their public surface is runtime APIs, which transpilation preserves; ui is the only package shipping decorator-authored components.Owner
Release/pack pipeline (
tools/publish-npm.ts) + packed-consumer qualification (tools/consumer-packaged-ui.ts). No product-package ownership change.Before
deno task pack:dry-runpacks ui sources directly; the tarball'sopen-theme-toggle.jscontainsapplyDecs2203Rlowering and no__partProgram.packageIslands: ['@openelement/ui'], one static route rendering<open-theme-toggle>) fails: build exit 1,OE_PROGRAM_MISSING: admitted nested component <open-theme-toggle> is not registered with a compiled Part Program, static route/ -> 500, "SSG failed: static route(s) returned non-200".ui-0.44.0-beta.1.tgz.After
open:compiled-elementcompiler output (the same intrinsic transform a consumer's own build runs against workspace source).deno packthen transpiles the compiled form — semantics-preserving — instead of lowering the intrinsics away. Staging relaxes onlynoImplicitOverride/noImplicitAnyfor the staged member (the compiler emission drops authoredoverridemodifiers and leaves computed-factory params implicitly typed; consumers never typecheck the emission). No.d.tsis emitted today and none is emitted now.open-theme-toggle.jsnow carriesstatic __partProgramand zeroapplyDecs; package.json exports/main/dependencies post-processing is byte-identical in behavior.dist/index.htmlcontains<open-theme-toggle theme="light">with its compiled DSD (<template shadowrootmode="open" …>,class="theme-toggle", compileddata-theme="light"sink).deno task consumer:packaged-ui(registered intools/autoflow/policy.ts,ci+releasetiers, ordered afterpackage-artifacts:checkwhich produces the tarballs it installs).Why-not-second-owner
The alternative owners were rejected per the issue's boundary ruling:
.tsxsource to npm so consumer builds compile it:deno packhas no keep-source mode; this would also change the published module format and every consumer's resolution contract — an ADR-level change, not a repair..js: the compiled grammar requires authored TSX; the lowered form is unrecoverable. Also ADR-level.Running the existing, already-mandatory intrinsic transform earlier in the pipeline (pack time instead of consumer-build time) keeps one compiler, one contract, one owner.
Evidence
deno task consumer:packaged-ui→ exit 1,Packed ui consumer SSG build failed/OE_PROGRAM_MISSINGon<open-theme-toggle>.deno task pack:dry-runexit 0 ([npm] @openelement/ui: packing staged compiler output for 10 compiled element module(s) (#1301));deno task consumer:packaged-uiexit 0 (packageIslands SSR admission renders the compiled DSD from the packed artifact).deno task package-artifacts:checkexit 0 (publint + attw + ESM-only/host-API scans on all five tarballs);deno task consumer:packagedexit 0 (starter path unchanged).deno task testexit 0 (1818 passed / 0 failed main suite; 150 / 0 supabase starter),deno task workflow:checkexit 0,deno fmt/deno lint/deno checkclean on changed files.tools/lib/compiled-pack-staging.test.ts(3 tests: ui modules compile with decorators erased + inline map stripped; non-component packages untouched; staging layout/relaxed options/tarball exclusion).Scope
tools/lib/compiled-pack-staging.ts(new),tools/publish-npm.ts(staging wiring),tools/consumer-packaged-ui.ts(new gate),deno.json(task),tools/autoflow/policy.ts(gate registration + triggers).Risk
deno packresolves workspace deps from a temporary workspace using the root import map (network/cache for npm deps of@openelement/element, already required bypackage-artifacts:check's publint/attw steps)..d.tsregression.Closes #1301