Releases: swiftwasm/JavaScriptKit
Releases · swiftwasm/JavaScriptKit
0.23.0
Breaking changes
- Drop Swift 5.10 and earlier supports
JSValue
no longer conformsSendable
norError
JSError
no longer conformsSendable
norError
See #286 for rationale of removal of Sendable conformance from JSValue
Added APIs
JSException
type is added to replace usage ofError
conformance ofJSValue
JSSending
type is added to provide a way to safely transfer or clone JavaScript objects between threads
Quick example of JSSending
// Transfer an object to another thread
let buffer = JSObject.global.Uint8Array.function!.new(100).buffer.object!
let transferring = JSSending.transfer(buffer)
// Receive the object on a worker thread
let executor = try await WebWorkerTaskExecutor(numberOfThreads: 1)
Task(executorPreference: executor) {
let receivedBuffer = try await transferring.receive()
// Use the received buffer
}
// Clone an object for use in another thread
let object = JSObject.global.Object.function!.new()
object["test"] = "Hello, World!"
let cloning = JSSending(object)
Task(executorPreference: executor) {
let receivedObject = try await cloning.receive()
// Use the received object
}
Pull Requests
- Swift 6 language mode compatibility by @kateinoigakukun in #286
- Concurrency: Fix build for p1-threads target by @kateinoigakukun in #287
- Add a mechanism to "Transfer" JSObject between Workers by @kateinoigakukun in #292
Full Changelog: 0.22.3...0.23.0
0.22.3
What's Changed
- Add WASI SDK checksum to CONTRIBUTING.md by @ole in #280
- Support JS function calls with up to 7 arguments in Embedded Swift by @ole in #281
- Update readme by @sakrist in #283
- CI: Use Swift SDK by default by @kateinoigakukun in #285
New Contributors
Full Changelog: 0.22.2...0.22.3
0.22.2
What's Changed
- Expose
WebWorkerTaskExecutor
even if compiling with toolchain < 6.1 by @kateinoigakukun in #277 - Fix empty TypedArray creation by @kateinoigakukun in #278
Full Changelog: 0.22.1...0.22.2
0.22.1
What's Changed
- Stop use of global variable as a object cache by @kateinoigakukun in #274
Full Changelog: 0.22.0...0.22.1
0.22.0
What's Changed
- improved embedded support for building with SwiftPM by @sliemeobn in #267
- Add Swift 6.0 to CI matrix by @kateinoigakukun in #268
- Assert that
JSObject
is being accessed only from the owner thread by @kateinoigakukun in #273
Full Changelog: 0.21.0...0.22.0
0.21.0
What's Changed
- Support for Embedded Swift (v2) by @sliemeobn in #263
- Follow-up adjustment for Embedded support by @kateinoigakukun in #265
- Resolve warnings by @kateinoigakukun in #266
New Contributors
- @sliemeobn made their first contribution in #263
Full Changelog: 0.20.2...0.21.0
0.20.2
What's Changed
- Update macro conditions for runtime usage by @fjtrujy in #257
- Soft-fail integer conversion from JS values that are not representable by @kateinoigakukun in #259
- Fix some typos by @Sajjon in #260
- Use
compiler(>=6.1)
to gate for the main branch toolchain by @kateinoigakukun in #261
New Contributors
Full Changelog: 0.20.1...0.20.2
0.20.1
Minor fixes for IDE build support
Full Changelog: 0.20.0...0.20.1
0.20.0
This release adds initial multi-threading support.
What's Changed
- Start migrating imported functions to the new definition style by @kateinoigakukun in #252
- Allocate JavaScriptEventLoop per thread in multi-threaded environment by @kateinoigakukun in #255
- Add
WebWorkerTaskExecutor
by @kateinoigakukun in #256
Full Changelog: 0.19.3...0.20.0
0.19.3
What's Changed
- Fix
JSClosure
leak by @kateinoigakukun in #240 - Update README file to include new carton 1.0 implementation. by @kuhl in #243
- Update Carton context on README. by @kuhl in #245
- Support latest nightly snapshot by @kateinoigakukun in #246
- Use Swift SDK for development snapshot testing in CI by @kateinoigakukun in #248
- Add
sharedMemory
option to allow threads with shared memory by @kateinoigakukun in #247 - Check 5.10 toolchain in CI by @kateinoigakukun in #249
New Contributors
Full Changelog: 0.19.2...0.19.3