Released: 2022-08-01
There is no code change in this release. It corrects a couple of glitches in the documentation in the wake of 2.0.0.
Released: 2022-07-28
This release contains a few breaking API changes for TaskPort module aimed at improving developer experience and instilling emerging best practice as a default:
- All versions of
call
function now accept the details of the call using a record to improve code readability. The only parameter that is passed outside of the record is the actual call parameter encoded into JSON for the interop call with a givenargsEncoder
. - All versions of
call
function now decode errors returned by JavaScript code as aJSError
value. For non-standard error objects, there is an escape hatch ofErrorValue
variant, which contains a JSON value as-is. - Variants of the
InteropError
type have changed. In the unlikely case you have built a logic to deal with the variants, it would need to be updated to use new names.
Upgrading from 1.2.x:
- Change all invocations of
call
andcallNoArgs
to use record syntax and removeerrorDecoder
parameter. See package documentation for examples. - If you have custom JavaScript error decoder, it will no longer work, as TaskPort always decodes JS Error as a value of type
JSError
. You need to change your error handling code to useJSError
. If your JavaScript code returns non-standard errors, use the escape hatch ofErrorValue
variant.
Other changes:
- Added support for function namespaces allowing Elm package developer to avoid function name clashes and helping to keep JS and Elm code in sync.
- Removed embedded Elm test suite, as all the same cases are covered end-to-end.
- Added an ability to control if TaskPort will log JS and interop errors to the JS console.
Released: 2022-07-23
- Fixes an error in using TaskPort with Tauri (PR #10 -- thanks @miniBill)
Released: 2022-07-22
- Provides
jsErrorDecoder
value andJSError
type to represent any erroneous result of executing a JavaScript function (issue #3) - Minor package documentation improvements
Upgrading from 1.1.0: This is a minior release and there are no breaking changes. If you implemented error handling using a custom JSON decoder, you should consider switching to now-available jsErrorDecoder
.
Released: 2022-07-20
- Fixes a bug representing all JS errors as
InteropError NotInstalled
(issue #5). - Implemented a function converting
InteropError
s into a descriptive string to simplify creation of helpful error messages (issue #4).
First officially released version (through discourse.elm-lang.org) supporting all major browsers and Node.js.