|
| 1 | +# 0.8.0 (21 October 2020) |
| 2 | + |
| 3 | +This release introduces a few enhancements and deprecations. Namely, `JSValueConstructible` |
| 4 | +and `JSValueConvertible` were renamed to `ConstructibleFromJSValue` and `ConvertibleToJSValue` |
| 5 | +respectively. The old names are deprecated, and you should move away from using the old names in |
| 6 | +your code. Additionally, JavaScriptKit now requires the most recent 5.3 and development toolchains, |
| 7 | +but thanks to this it no longer uses unsafe flags, which prevented building other libraries |
| 8 | +depending on JavaScriptKit on other platforms. |
| 9 | + |
| 10 | +The main user-visible enhancement is that now force casts are no longer required in client code. |
| 11 | +That is, we know allow this |
| 12 | + |
| 13 | +```swift |
| 14 | +let document = JSObject.global.document |
| 15 | +let foundDivs = document.getElementsByTagName("div") |
| 16 | +``` |
| 17 | + |
| 18 | +in addition to the previously available explicit style with force unwrapping: |
| 19 | + |
| 20 | +```swift |
| 21 | +let document = JSObject.global.document.object! |
| 22 | +let foundDivs = document.getElementsByTagName!("div").object! |
| 23 | +``` |
| 24 | + |
| 25 | +Note that the code in the first example is still dynamically typed. The Swift compiler won't warn |
| 26 | +you if you misspell names of properties or cast them to a wrong type. This feature is purely |
| 27 | +additive, and is added for convenience. You can still use force unwraps in your code interfacing |
| 28 | +with JavaScriptKit. If you're interested in a statically-typed DOM API, we recommend having a look |
| 29 | +at the [DOMKit](https://github.com/swiftwasm/DOMKit) library, which is currently in development. |
| 30 | + |
| 31 | +Lastly, `JSError` now conforms to the `JSBridgedClass` protocol, which makes it easier to integrate |
| 32 | +with idiomatic Swift code. |
| 33 | + |
| 34 | +**Closed issues:** |
| 35 | + |
| 36 | +- Errors building example: undefined symbols ([#95](https://github.com/swiftwasm/JavaScriptKit/issues/95)) |
| 37 | +- Documentation website is broken ([#93](https://github.com/swiftwasm/JavaScriptKit/issues/93)) |
| 38 | +- Rename `JSValueConstructible` and `JSValueConvertible` ([#87](https://github.com/swiftwasm/JavaScriptKit/issues/87)) |
| 39 | +- Build fails with the unsafe flags error ([#6](https://github.com/swiftwasm/JavaScriptKit/issues/6)) |
| 40 | + |
| 41 | +**Merged pull requests:** |
| 42 | + |
| 43 | +- Update example code in `README.md` ([#100](https://github.com/swiftwasm/JavaScriptKit/pull/100)) via [@MaxDesiatov](https://github.com/MaxDesiatov) |
| 44 | +- Update toolchain version, script, and `README.md` ([#96](https://github.com/swiftwasm/JavaScriptKit/pull/96)) via [@MaxDesiatov](https://github.com/MaxDesiatov) |
| 45 | +- [Proposal] Add unsafe convenience methods for JSValue ([#98](https://github.com/swiftwasm/JavaScriptKit/pull/98)) via [@kateinoigakukun](https://github.com/kateinoigakukun) |
| 46 | +- Remove all unsafe linker flags from Package.swift ([#91](https://github.com/swiftwasm/JavaScriptKit/pull/91)) via [@kateinoigakukun](https://github.com/kateinoigakukun) |
| 47 | +- Sync package.json and package-lock.json ([#90](https://github.com/swiftwasm/JavaScriptKit/pull/90)) via [@kateinoigakukun](https://github.com/kateinoigakukun) |
| 48 | +- Rename JSValueConvertible/Constructible/Codable ([#88](https://github.com/swiftwasm/JavaScriptKit/pull/88)) via [@j-f1](https://github.com/j-f1) |
| 49 | +- Bump @actions/core from 1.2.2 to 1.2.6 in /ci/perf-tester ([#89](https://github.com/swiftwasm/JavaScriptKit/pull/89)) via [@dependabot[bot]](https://github.com/dependabot[bot]) |
| 50 | +- Make `JSError` conform to `JSBridgedClass` ([#86](https://github.com/swiftwasm/JavaScriptKit/pull/86)) via [@MaxDesiatov](https://github.com/MaxDesiatov) |
| 51 | + |
1 | 52 | # 0.7.2 (28 September 2020)
|
2 | 53 |
|
3 | 54 | This is a bugfix release that resolves an issue with the JavaScript runtime being unavailable when installed via NPM.
|
|
0 commit comments