BridgeJS: Remove `@JS protocol` in favor of `@JSClass struct` by kateinoigakukun · Pull Request #560 · swiftwasm/JavaScriptKit
added 2 commits
…ss` interfaces. - `Plugins/BridgeJS/Sources/BridgeJSCore/SwiftToSkeleton.swift` now rejects `@JS protocol` with a clear diagnostic pointing to `@JSClass struct`; updated `ImportTS.swift` messaging accordingly. - Dropped protocol fixtures/snapshots (`Plugins/BridgeJS/Tests/BridgeJSToolTests/Inputs/Protocol.swift` and related snapshots); README/type-modeling notes now steer interface modeling toward `@JSClass` (`Plugins/BridgeJS/README.md`). - Rewrote the DocC article to document `@JSClass` interface usage and migration steps (`Sources/JavaScriptKit/Documentation.docc/Articles/BridgeJS/Exporting-Swift/Exporting-Swift-Protocols.md`). - Removed protocol-based runtime APIs/tests, refreshed JS harness, and regenerated bridge outputs to align (`Tests/BridgeJSRuntimeTests/ExportAPITests.swift`, `Tests/prelude.mjs`, `Tests/BridgeJSRuntimeTests/Generated/*`). Tests run: - `swift test --package-path Plugins/BridgeJS`
…SClass`: - Introduced a JSClass-based interface and manager to exercise property/method dispatch from Swift into plain JS objects (`Tests/BridgeJSRuntimeTests/ExportAPITests.swift`), using throwing JS calls via `try!` where required. - Added a new JS-side scenario to drive the manager and verify interactions, backup swapping, tagging, labeling, and message passing (`Tests/prelude.mjs`). - Regenerated BridgeJS outputs to reflect the new runtime APIs (`Tests/BridgeJSRuntimeTests/Generated/*`). Tests: `make unittest SWIFT_SDK_ID=DEVELOPMENT-SNAPSHOT-2025-11-03-a-wasm32-unknown-wasip1` passed.
kateinoigakukun
changed the title
Remove @JS protocol in favor of @JSClass
Remove @JS protocol in favor of @JSClass struct
kateinoigakukun
changed the title
Remove
BridgeJS: Remove @JS protocol in favor of @JSClass struct@JS protocol in favor of @JSClass struct
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