0.10.0
This release contains multiple breaking changes in preparation for enabling async/await, when this feature is available in a stable SwiftWasm release. Namely:
JSClosure.init(_ body: @escaping ([JSValue]) -> ())overload is deprecated to simplify type checking. Its presence requires explicit type signatures at the place of use. It will be removed in a future version of JavaScriptKit.JSClosureis no longer a subclass ofJSFunction. These classes are not related enough to keep them in the same class hierarchy. As a result, you can no longer callJSClosureobjects directly from Swift. Call wrapped closures directly instead.- Introduced
JSOneshotClosurefor closures that are going to be called only once. You don't need to manage references to these closures manually, as opposed toJSClosure. However, they can only be called a single time from the JS side. Subsequent invocation attempts will raise a fatal error on the Swift side. - Removed generic parameters on
JSPromise, now both success and failure values are always assumed to be ofJSValuetype. This also significantly simplifies type checking and allows callers to fully control type casting if needed.
Closed issues:
- DOMKit? (#21)
Merged pull requests:
- Simplify
JSPromiseAPI (#115) via @kateinoigakukun - Create
FUNDING.yml(#117) via @MaxDesiatov - Major API change on
JSClosure(#113) via @kateinoigakukun - Update
package.jsonto lockfileVersion 2 (#114) via @kateinoigakukun - Bump
inifrom 1.3.5 to 1.3.8 in/Example(#111) via @dependabot[bot] - Update doc comment in
JSTypedArray.swift(#110) via @MaxDesiatov