Skip to content

Refactor typed JavaScript projection planning - #112

Merged
leileizhang (lei9444) merged 7 commits into
mainfrom
lei9444-refactor-js-projection
Sep 1, 2026
Merged

leileizhang (lei9444) merged 7 commits into
mainfrom
lei9444-refactor-js-projection

Conversation

@lei9444

Copy link
Copy Markdown
Contributor

Summary

  • unify WinRT generic naming, stable hashing, reference identity, and ABI identity behind one typed canonical semantic identity model
  • replace JavaScript projection thread-local layout state with an explicit JavaScriptProjectionContext
  • generate canonical modules, root CJS/ESM/DTS barrels, and package exports from a structured GenerationPlan
  • fail closed on missing planned dependencies and retained root metadata while preserving incremental aliases

Compatibility

This is a pure internal refactor on top of #109. Public canonical paths, root/package exports, generic names and hashes, CJS/ESM behavior, ABI identities, and inventory schema v1 remain compatible.

Retained subset generation may preserve a history-dependent internal implementation_name when metadata is unavailable. Internal class names, stack traces, and those module bytes are not stable public contracts; the consumer-visible JS/DTS surface, projected names, compatibility aliases, ABI identity, root exports, and package targets remain equivalent to a full-current generation.

Validation

  • cargo fmt --all -- --check
  • cargo test -p dynwinrt-codegen — 540 passed
  • TypeScript E2E — 38/38 passed
  • Classic COM E2E — 17/17 passed
  • Generate JavaScript bindings in canonical namespace paths #109 canonical comparison — 23/23 non-inventory files byte-identical; inventory records identical with schema v1; incremental rerun changed 0 files
  • WinAppSDK 1.8 staged generation across 26 WinMDs — 934 canonical modules, 934/934 CJS requires, 936/936 import targets, 936 strict declarations, 0 missing package targets, and 0 changes across 1,876 generator-owned files on rerun
  • final read-only diff review found no high-confidence issues

Unify semantic type identity, pass explicit projection context, and generate roots from a structured module plan.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Cover retained projected-name changes, root and package rewrites, clean-output byte identity, fail-closed metadata, and idempotent reruns.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Generate only the new type in phase two and assert exact retained aliases, root ownership, package targets, byte convergence, and idempotence.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Compare true retained generation with an independent full-current oracle while allowing only documented implementation-history artifacts to differ.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the semantic-history regression on the schema v1 merged by PR #109.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Mixed-language test coverage

Workflow status: ✅ Passed

Layer Lines Functions Branches/regions
Rust, including native .pyd/.node 82.86% 79.18% 82.77% regions
Generated Python projections 70.48% n/a 21.71% branches
JavaScript aggregate 21.24% 20.56% 53.98% branches
JavaScript runtime 19.91% 14.28% 7.14% branches
Generated WinRT projections 25.74% 19.25% 54.66% branches
Generated Classic COM projections 14.65% 24.46% 53.75% branches

View workflow run and download full HTML/LCOV/XML reports

Ignore only Classic COM compatibility exports while continuing to validate inventory-backed Com.* WinRT modules.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@lei9444
leileizhang (lei9444) merged commit 82933f6 into main Sep 1, 2026
26 checks passed
@lei9444
leileizhang (lei9444) deleted the lei9444-refactor-js-projection branch September 1, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants