Skip to content

Add dynamic JavaScript COM implementations - #104

Merged
leileizhang (lei9444) merged 1 commit into
mainfrom
feature/dynamic-com-implementations
Aug 20, 2026
Merged

Add dynamic JavaScript COM implementations#104
leileizhang (lei9444) merged 1 commit into
mainfrom
feature/dynamic-com-implementations

Conversation

@lei9444

Copy link
Copy Markdown
Contributor

Summary

  • add a metadata-driven inbound CallbackMethodPlan with cached libffi closures while retaining static callback fast paths
  • support validated scalar, enum, GUID, handle, interface, BSTR/HSTRING, POD, InOut, counted-buffer, HRESULT, void, and direct-return callback ABI shapes
  • add canonical IUnknown identity, frozen multi-interface views, inherited/base-IID QueryInterface routing, and generated implement() / implementation() / as() APIs
  • publish owned callback outputs transactionally: QI references, BSTR/HSTRING values, and CoTaskMem allocations remain RAII-owned until every output is ready
  • keep Classic COM isolated under /com and /com/unsafe, with unsupported ownership, Automation, union, and apartment contracts failing closed

Scope

Implementations are non-agile and execute synchronously on their creating JavaScript thread. Cross-apartment dispatch, aggregation, COM server registration, custom marshaling, and the complete Automation callback surface remain out of scope.

Validation

  • cargo test -p dynwinrt — 242 passed, 1 ignored
  • cargo test -p dynwinrt-codegen — full suite passed with Win32Metadata 71.0.14-preview
  • npm run test:tsfn — 19/19 passed
  • Classic COM live E2E — 17/17 passed
  • WinRT TypeScript E2E — 37/37 passed
  • i686, x64, and ARM64 compile checks passed
  • complete-interface census unchanged at 5567/7929 (70.210619%)

Add cached libffi callback closures, metadata-validated callback marshalling, multi-interface identity, inherited QueryInterface aliases, and generated implement/implementation APIs. Preserve fail-closed ownership and apartment rules, including transactional callback output publication.

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

Copilot-Session: 565c4300-9e07-40c2-8ad3-875138379a86
@github-actions

Copy link
Copy Markdown

Mixed-language test coverage

Workflow status: ✅ Passed

Layer Lines Functions Branches/regions
Rust, including native .pyd/.node 82.04% 78.48% 81.98% regions
Generated Python projections 71.2% n/a 36.54% branches
JavaScript aggregate 18.92% 21.32% 52.69% branches
JavaScript runtime 19.91% 14.28% 7.14% branches
Generated WinRT projections 22.27% 20.02% 52.85% branches
Generated Classic COM projections 13.89% 25.06% 53.56% branches

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

@lei9444
leileizhang (lei9444) merged commit df48519 into main Aug 20, 2026
25 checks passed
@lei9444
leileizhang (lei9444) deleted the feature/dynamic-com-implementations branch August 20, 2026 08:59
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.

3 participants