0.11.0
This release adds support for async
/await
and SwiftWasm 5.5. Use the new value
async property on a JSPromise
instance to await
for its result. You'll have to add a dependency on the new JavaScriptEventLoop
target in your Package.swift
, import JavaScriptEventLoop
, and call JavaScriptEventLoop.installGlobalExecutor()
in your code before you start using await
and Task
APIs.
Additionally, manual memory management API of JSClosure
has been removed to improve usability. This significantly bumps minimum browser version requirements for users of apps depending on JavaScriptKit. Previous manual memory management mode is still available though with a special compiler flags, see README.md
for more details.
This new release of JavaScriptKit may work with SwiftWasm 5.4 and 5.3, but is no longer tested with those versions due to compatibility issues introduced on macOS by latest versions of Xcode.
Many thanks to @j-f1, @kateinoigakukun, and @PatrickPijnappel for their contributions to this release!
Closed issues:
- Enchancement: Add a link to the docs (#136)
- Use
FinalizationRegistry
to auto-deinitJSClosure
(#131) make test
crashes due toJSClosure
memory issues (#129)- Avoid manual memory management with
JSClosure
(#106)
Merged pull requests:
- Fix recursion in
JSTypedArray
initializer (#142) via @PatrickPijnappel - Experimental global executor cooperating with JS event loop (#141) via @kateinoigakukun
- Update NPM dependencies of
Example
project (#140) via @MaxDesiatov - Refactor
JSClosure
to leverageFinalizationRegistry
(#128) via @j-f1 - Test with the latest 5.5 snapshot (#138) via @MaxDesiatov
- Test with multiple toolchain versions (#135) via @kateinoigakukun
- Gardening tests (#133) via @kateinoigakukun