Swift/JS interop used to mean "JSObject", "JSValue", and runtime surprises.

BridgeJS changes that: annotate your Swift, get typed glue code in both directions. Compile-time safe. Zero manual boilerplate. 🧵

Left side: Swift types with @​JS annotation.
Right side: fully generated TypeScript interfaces and exports.

You write @​JS. BridgeJS writes everything else.

Bridging options:
1. Annotate a Swift class or type with @​JS to create bindings for JS/TS code
2. Import an existing JavaScript class or function with @​JSClass or @​JSFunction on the Swift side
3. Or create a bridge-js.d.ts file to export TypeScript APIs to Swift

BridgeJS landed as an MVP just two weeks ago, and is evolving fast.

Check it out with the interactive playground — paste Swift, and see the generated results live: https://swiftwasm.org/JavaScriptKit/PlayBridgeJS/

Docs here: https://swiftpackageindex.com/swiftwasm/javascriptkit/main/documentation/javascriptkit

BridgeJS Playground