Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Tags: swiftwasm/JavaScriptKit

Tags

0.54.1

Toggle 0.54.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix error descriptions Embedded Swift compatibility (#759)

The BridgeJS generator emits `JSError(message: String(describing: error))` for throwing `@JS` exports, but `String.init(describing:)` is unavailable in Embedded Swift, so embedded Wasm builds of any package with a throwing export fail. The caught error is statically a `JSException` with a stored `description`, so the generated glue now uses `error.description` for identical output. Snapshots regenerated.

0.54.0

Toggle 0.54.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #754 from PassiveLogic/kr/fix-optional-jsclass-param

BridgeJS: Support optional @jsclass as exported function parameters

0.53.0

Toggle 0.53.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
BridgeJS: Optimize numeric array transfer with bulk TypedArray copy (#…

…745)

0.52.1

Toggle 0.52.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #739 from wfltaylor/fix-closure-struct-return

BridgeJS: Fix closures with struct return

0.52.0

Toggle 0.52.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #741 from swiftwasm/claude/fix-jsstring-threading-…

…XtWUJ

0.51.0

Toggle 0.51.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
[BridgeJS] Synthesize typed-closure init access from declaration surf…

…ace (#709) (#727)

* [BridgeJS] Synthesize typed-closure init access from declaration surface

Resolves #709: a public `@JSClass` exposing a
`JSTypedClosure<...>` parameter could not be consumed from another target
because the synthesized `extension JSTypedClosure { init(...) }` was always
internal, leaving downstream callers no way to construct the closure value
without hand-rolling a public wrapper.

Imported skeleton entries now record the source access level
(`public`/`package`/`internal`); the closure-signature collector takes the
maximum across every surface that references a given signature, and
`ClosureCodegen` prefixes the synthesized init with the resulting modifier
(internal stays bare). This matches the pattern `JSClassMacro` already uses
for `init(unsafelyWrapping:)`.

* [BridgeJS] Address PR feedback and refresh generated artifacts

- Make `accessLevel` decode-tolerant on imported skeleton structs
  (`ImportedFunctionSkeleton`, `ImportedConstructorSkeleton`,
  `ImportedGetterSkeleton`, `ImportedSetterSkeleton`,
  `ImportedTypeSkeleton`) by writing explicit `init(from:)` decoders
  that fall back to `.internal` when the key is missing. Without this,
  any pre-existing skeleton JSON without the new field fails decoding —
  the `build-examples` CI job hit `DecodingError.keyNotFound` for
  `accessLevel` against externally consumed skeletons.
- Extract a private `recordSignature` helper so `visitClosure` and
  `recordInjectedSignature` share a single merge implementation.
- Assert in `withAccessLevel(rawLevel:)` so unknown access strings
  ("open", "private", future schema additions) surface in debug
  builds instead of silently inheriting the outer level.
- Document the `.internal` seeding assumption on
  `ClosureSignatureCollectorVisitor.init(moduleName:signatures:)`.
- Regenerate the BridgeJS pre-generated artifacts under Benchmarks/,
  Examples/PlayBridgeJS/, Tests/BridgeJSIdentityTests/, and
  Tests/BridgeJSRuntimeTests/ via `./Utilities/bridge-js-generate.sh`,
  per CONTRIBUTING.md. The runtime-tests Swift output now emits
  `public init` on three `JSTypedClosure` extensions whose signatures
  surface through public exported types.

* [BridgeJS] Refresh identity tests skeleton after merge with main

#731 added the GC lifecycle test (with new imported function entries)
to main while this branch was open. Re-running the BridgeJS regen
against the merged tree fills in the `accessLevel` field on the new
entries that were absent at merge time.

* ci: retry flaky JSPromiseTests.testPromiseAndTimer

0.50.2

Toggle 0.50.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #717 from PassiveLogic/kr/fix-class-static-method-ts

BridgeJS: Emit static methods and properties on namespaced class entries

0.50.1

Toggle 0.50.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
relax swift-syntax version constraint to allow 603 (#714)

* relax swift-syntax version constraint to allow 603

Packages are updating to 603 and this can fail the dependency solver.

* .. and also test against it

0.50.0

Toggle 0.50.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add JSRemote<JSObject> (#711)

Add `JSRemote<JSObject>` API for accessing JSObjects without transfer

The new API allows creating a handle for a `JSObject` that remains
on its original JavaScript thread and hopping back to that thread
to access the object when needed. This is useful for cases where the
object cannot be transferred to another thread, but occasional access
is still required or when we want to guarantee that an object is always
accessed on the same thread for safety (it should be statically
guaranteed with strict Sendable checking, but modules with language mode
5 don't have that).

Example:

```swift
let document = JSObject.global.document.object!
let remoteDocument = JSRemote(document)

let executor = try await WebWorkerTaskExecutor(numberOfThreads: 1)
let title = try await Task(executorPreference: executor) {
    try await remoteDocument.withJSObject { document in
        document.title.string ?? ""
    }
}.value
```

0.49.0

Toggle 0.49.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
BridgeJS: support imports of JS `Promise` as `async` Swift (#707)

* BridgeJS: support imports of `Promise` JS as `async` Swift

* E2e testing of bridging Promise<interface> returns

* fix formatting

* `JSTypedClosure`-based approach

* Clean up `BridgeJSLink`

* Fix missing `import _Concurrency`

* Fix formatting

* Use `JSTypedClosure` without wrapping the result value

* Make closure parameters as `sending`

* Check more stack ABI types

* Add support for `async` in `@JSFunction`

* Use namespaced import

* Fix missing `fetchWeatherData`

* Bring back `fetchWeatherData`

* Regenerate `fetchWeatherData` bridging code

* BridgeJS: Centralize closure sig collection in BridgeSkeletonWalker

* BridgeJS: Stop spreading isAsync handling outside of CallJSEmission

* BridgeJS: Remove error-prone default effects in thunk generation

* BridgeJSLink: Centralize async handling in ImportedThunkBuilder

* BridgeJS: Remove reundant returnType from `call` family of methods in ImportedThunkBuilder

---------

Co-authored-by: Yuta Saito <yuta@goodnotes.com>
Morty Proxy This is a proxified and sanitized view of the page, visit original site.