Share generated interface member descriptors - #97
Closed
leileizhang (lei9444) wants to merge 8 commits into
Closed
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 84688dea-d965-4933-a2d9-41f8f6ad2f2e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b485b75e-2292-44e1-98c8-3f7bb6489bff
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b485b75e-2292-44e1-98c8-3f7bb6489bff
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b485b75e-2292-44e1-98c8-3f7bb6489bff
Mixed-language test coverageWorkflow status: ✅ Passed
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b485b75e-2292-44e1-98c8-3f7bb6489bff
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 84688dea-d965-4933-a2d9-41f8f6ad2f2e
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b485b75e-2292-44e1-98c8-3f7bb6489bff
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b485b75e-2292-44e1-98c8-3f7bb6489bff
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.
Summary
--shared-interface-membersJavaScript codegen flag.Compatibility
The implementation uses one canonical interface identity for source emission and descriptor copying. It falls back to class-local members for ambiguous flat filenames and rejects incompatible incremental overwrites.
When sharing replaces an inline raw-interface declaration, the class deep module preserves the same public JS/TypeScript import through an equivalent canonical re-export. Declaration APIs and import paths are preserved, but flag-on
.d.tsfiles are not byte-identical. Flag-off/default output remains byte-compatible.The option is JavaScript-only and disabled by default.
Corrected isolated Gallery A/B
Measured with the latest branch, the same 32 Gallery WinMDs and 99 references, and no bundle post-processing:
File sets and all 2,781 root exports are preserved. Deep modules lose no baseline exports; two modules gain canonical raw-interface re-exports. TypeScript root/deep import validation passes and unsafe copied sources are zero.
Validation
IStringableJS/DTS imports are preserved, including Node 22 ESM named imports.cargo test -p dynwinrt-codegenpassed.Recommendation
Correctness and compatibility issues are resolved, but the final measured benefit is negligible and the first-screen dependency graph becomes larger and more cyclic. Based on the current data, this change does not provide enough value to justify merging in its present form.