Skip to content

Commit 088746a

Browse files
committed
Prepare 0.1.6 release
1 parent 39dc7b1 commit 088746a

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
iframe-worker-0.1.6 (2020-08-30)
2+
3+
* Added support for awaitable importScripts
4+
15
iframe-worker-0.1.5 (2020-03-24)
26

37
* Removed build files from package

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ import "iframe-worker/polyfill"
5252

5353
## Caveats
5454

55-
Note that due to JavaScript's event-driven nature `importScripts` cannot be
56-
synchronous. This means that all symbols that are exported from a script which
57-
is being imported may only be safely accessed in the message handler, but not
58-
in the worker's global scope.
55+
In Worker scripts, `importScripts` is a synchronous operation which will wait
56+
for the script to be loaded and executed. While it's not possible to implement
57+
this behavior as part of an `iframe`, the `importScripts` function that is
58+
provided as part of this polyfill returns a `Promise` which can be awaited on.
59+
Since awaiting a non-Promise is a no-op, using `await` on `importScripts` will
60+
work in normal, as well as polyfilled environments.
5961

6062
## License
6163

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iframe-worker",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"description": "A tiny WebWorker polyfill for the file:// protocol",
55
"keywords": [
66
"webworker",

0 commit comments

Comments
 (0)