summaryrefslogtreecommitdiff
path: root/deno_typescript/README.md
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2020-06-17 23:13:02 +1000
committerGitHub <noreply@github.com>2020-06-17 15:13:02 +0200
commit75bb9dbdfc7f8b4e8d17978808ae575e61843aef (patch)
tree570b8a537d13a72957afcfad1cdd339f13ccd93d /deno_typescript/README.md
parente88d72f101e773728c27306a3639589c1350e4ed (diff)
Deno.bundle supports targets < ES2017. (#6328)
This commit provides a "system_loader_es5.js" bundle loader which will be added to the bundle when the target is < ES2017, which is the minimum target syntax required for "system_loader.js". Supports #5913 (via Deno.bundle()) with a couple caveats: * Allowing "deno bundle" to take a different target is not supported, as we specifically ignore "target" when passed in a TypeScript config file. This is because deno bundle is really intended to generate bundles that work in Deno. It is an unintentional side effect that some bundles are loadable in browsers. * While a target of "es3" will be accepted, the module loader will still only be compatible with ES5 or later. Realistically no one should be expecting bundles generated by Deno to be used on IE8 and prior, and there is just too much "baggage" to support that at this point.
Diffstat (limited to 'deno_typescript/README.md')
-rw-r--r--deno_typescript/README.md17
1 files changed, 11 insertions, 6 deletions
diff --git a/deno_typescript/README.md b/deno_typescript/README.md
index 70fe74773..7ee4cf1df 100644
--- a/deno_typescript/README.md
+++ b/deno_typescript/README.md
@@ -69,9 +69,14 @@ At the time of this writing, while V8 and other JavaScript engines have
implemented top-level-await, no browsers have it implemented, meaning that most
browsers could not consume modules that require top-level-await.
-In order to facilitate this, there are two functions that are in the scope of
-the module in addition to the `System.register()` method. `__instantiate(main)`
-will bootstrap everything synchronously and `__instantiateAsync(main)` will do
-so asynchronously. When emitting a bundle that contains a module that requires
-top-level-await, Deno will detect this and utilise
-`await __instantiateAsync(main)` instead.
+In order to allow more browsers to consume bundles, there is an argument that is
+passed to the `__instantiate()` function which determines if the code is
+bootstrapped asynchronously or not. When emitting a bundle that contains a
+module that requires top-level-await, Deno will detect this and utilise
+`await __instantiate(main, true)`.
+
+The `system_loader_es5.js` is a transpiled version of `system_loader.js` that is
+designed to work with ES5 or later, and will be used when the bundle target is <
+ES2017. While ES3 is still a potential target which can be passed in a
+`tsconfig.json` to Deno, any resulting bundle will not be compatible, as there
+is a need to utilise items like `Object.defineProperty()`.