Conversation
krodak
force-pushed
the
kr/protocol-refinement-upstream
branch
from
September 22, 2026 13:48
a88f64f to
edca6f9
Compare
kateinoigakukun
approved these changes
Sep 25, 2026
This branch has not been deployed
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.
Overview
Support same-module
@JSprotocol refinement and protocol constraints on generic JavaScript imports.Generated implementations live in wrapper-only protocol extensions, so Swift resolves inheritance without copying members. TypeScript interfaces use
extends. Protocol-qualified helper names also prevent collisions between same-named methods; Wasm import names are unchanged.Example
This returns
"42: Main building". Previously, the generated wrapper was missing the inherited requirements.Generic Imports
Generates
roundTrip<T extends Node>(value: T): T. Qualified constraints such asGraphKit.Nodeare preserved. Concrete conformers must expose the required members to JavaScript.Limitations
Dependency protocols can be used as generic constraints, but cannot be refined locally. Anonymous existential parameters such as
any (Identified & Named)remain unsupported.Test Plan
npm run check:bridgejs-dts../Utilities/bridge-js-generate.sh(no drift).make unittest SWIFT_SDK_ID=swift-6.3.1-RELEASE_wasm BUILD_SYSTEM=native, covering refinement, inherited accessors, and constrained imports../Utilities/format.swiftandgit diff --check.