From 7e873b0b51d118ea77e3001b81d346b599329230 Mon Sep 17 00:00:00 2001 From: dcode Date: Sat, 14 Jan 2023 01:45:10 +0100 Subject: [PATCH 1/3] Use Web SDK in editor --- src/.vuepress/public/editor.html | 20 +------------------ src/.vuepress/public/scripts/empty.js | 0 src/compiler.md | 28 ++++++++++++++------------- 3 files changed, 16 insertions(+), 32 deletions(-) delete mode 100644 src/.vuepress/public/scripts/empty.js diff --git a/src/.vuepress/public/editor.html b/src/.vuepress/public/editor.html index aea3fd8a1..71a1f31b7 100644 --- a/src/.vuepress/public/editor.html +++ b/src/.vuepress/public/editor.html @@ -312,25 +312,7 @@
Documentation
- - + - + ``` -Note that the matching versions of the respective dependencies need to be filled in instead of `x.x.x`. Current versions can be obtained from the generated [importmap.json](https://cdn.jsdelivr.net/npm/assemblyscript@latest/dist/importmap.json) file. The [es-module-shims](https://github.com/guybedford/es-module-shims) dependency polyfills support for import maps where not yet available. +Here, `x.x.x` must be replaced with the [respective version to use](https://github.com/AssemblyScript/assemblyscript/tags), or `latest` to always use the latest version (not recommended in production). By default, the script installs [the necessary import map](https://cdn.jsdelivr.net/npm/assemblyscript@latest/dist/importmap.json) and, for browsers that do not yet support import maps, [an import map shim](https://github.com/guybedford/es-module-shims). It also accepts the following optional options: + +| Script URL | Effect +|---------------------------|------------------------------------------ +| `web.js?noinstall` | Does not install the import map. +| `web.js?noshim` | Does not install the import map shim. +| `web.js?noinstall,noshim` | Does not install the import map or shim. + +Regardless of the options used, the script always declares the following global variables: +| Variable | Description +|----------------------------|------------------------------------------------- +| `ASSEMBLYSCRIPT_VERSION` | Version string of the compiler release used +| `ASSEMBLYSCRIPT_IMPORTMAP` | The respective import map of the release as JSON ## Host bindings From 714fc3e40023faf72a127071615cf8d11e87320c Mon Sep 17 00:00:00 2001 From: dcode Date: Sat, 14 Jan 2023 01:57:59 +0100 Subject: [PATCH 2/3] fix --- src/compiler.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler.md b/src/compiler.md index 1a4e588b5..fc31a3b97 100644 --- a/src/compiler.md +++ b/src/compiler.md @@ -246,7 +246,7 @@ if (error) { } ``` -The compiler runs in browsers as well. The simplest way to set it up is to include the generated [web.js](ttps://cdn.jsdelivr.net/npm/assemblyscript@latest/dist/web.js) so the compiler can be used with an `import` on the Web: +The compiler runs in browsers as well. The simplest way to set it up is to include the generated [web.js](https://cdn.jsdelivr.net/npm/assemblyscript@latest/dist/web.js) so the compiler can be used with an `import` on the Web: ```html From 33c63ebb133dc6772f7ef32b719df03501ae6528 Mon Sep 17 00:00:00 2001 From: dcode Date: Sat, 14 Jan 2023 01:59:44 +0100 Subject: [PATCH 3/3] concretize --- src/compiler.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler.md b/src/compiler.md index fc31a3b97..cd58bfcca 100644 --- a/src/compiler.md +++ b/src/compiler.md @@ -256,7 +256,7 @@ import asc from "assemblyscript/asc"; ``` -Here, `x.x.x` must be replaced with the [respective version to use](https://github.com/AssemblyScript/assemblyscript/tags), or `latest` to always use the latest version (not recommended in production). By default, the script installs [the necessary import map](https://cdn.jsdelivr.net/npm/assemblyscript@latest/dist/importmap.json) and, for browsers that do not yet support import maps, [an import map shim](https://github.com/guybedford/es-module-shims). It also accepts the following optional options: +Here, `x.x.x` must be replaced with the [respective version to use](https://github.com/AssemblyScript/assemblyscript/tags), or `latest` to always use the latest version (not recommended in production). By default, the script installs [the necessary import map](https://cdn.jsdelivr.net/npm/assemblyscript@latest/dist/importmap.json) and, for browsers that do not yet support import maps, [an import map shim](https://github.com/guybedford/es-module-shims). It also accepts the following options in case there is a need to only perform part of the setup: | Script URL | Effect |---------------------------|------------------------------------------