Releases: markwylde/workerbox
v6.4.0
What's Changed
- feat: improve types and use SuperJSON for serialization and deserialization by @TomerAberbach in #35
New Contributors
- @TomerAberbach made their first contribution in #35
Full Changelog: v6.3.2...v6.4.0
v6.3.2
v6.3.1
v6.3.0
v6.2.0
- Upgrades dependencies
- Downgrades minify temporarily as it's breaking functionality
Full Changelog: v6.1.1...v6.2.0
v6.1.1
A project using esbuild with code splitting wasn't working correctly, as the format had to change to esm, meaning the export default wasn't getting transpiled.
Anyway, I've broke out the export for the build in workerbox "server", which should now bundle correctly.
v6.0.0
- Embed a sandbox worker
We no longer need to add a serverUrl to run the script on a separate domain thanks to the sandbox attribute on the iframe.
Previously we had to do this:
const { run } = await createWorkerBox('https://sandbox.workerbox.net');
Whereas now we can do:
const { run } = await createWorkerBox();
If you still want to run the sandbox from the workerbox.net domain, you can update your code to:
const { run } = await createWorkerBox({
serverUrl: 'https://sandbox.workerbox.net',
appendVersion: true
});
v5.3.0 - Bugfix callback errors
Currently if you throw an error on the initial run
call, the promise will throw and you will get a nice stack traced error explaining what went wrong.
However, if you execute a callback later on, it will fail silently.
This PR fixes the issue.
Meaning the following:
const result = await run(`
return {
somethingBroken: () => {
ohno(); // ohno is not defined
}
}
`);
result.somethingBroken()
Will reject with
ReferenceError: ohno is not defined
at add (<sandbox>:3:9)');
v5.2.0 - Bugfix: Returning objects with functions
- Fixed a bug with returning objects with functions
The following will now work:
return {
add: (a, b) => a + b
}