From 54e59f4d6e285c3d75cfff941660d509c8bac7a5 Mon Sep 17 00:00:00 2001 From: Jason Liu Date: Tue, 13 Dec 2022 23:15:41 -0800 Subject: [PATCH 1/2] Add documentation of Module.mainScriptUrlOrBlob --- site/source/docs/api_reference/module.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/site/source/docs/api_reference/module.rst b/site/source/docs/api_reference/module.rst index 33e3e966e1db2..68019f5e6193f 100644 --- a/site/source/docs/api_reference/module.rst +++ b/site/source/docs/api_reference/module.rst @@ -147,6 +147,9 @@ The following ``Module`` attributes affect code execution. Set them to customize Called when something is printed to standard error (stderr) +.. js:attribute:: Module.mainScriptUrlOrBlob + + Allows pthread workers or WASM workers to independently load up the the main application module JavaScript file (e.g. main.js) from a URL or blob. Creation of pthread workers or WASM workers need to load the main application module JavaScript file (e.g. main.js). By default, they load the the content of main.js from the URL of main.js. However, if the main.js file was loaded from a Blob or main.js, it is not possible to access the URL of the main.js. Also, when main.js is bundled by a Node.JS module bundler (e.g. webpack), the URL of that script can be wrong, the URL after webpack bundler will result in something like main.chunk.js Other methods ============= From 7b35d9a74a4103955d3e918dff00274d08a0fc0b Mon Sep 17 00:00:00 2001 From: Jason Liu Date: Tue, 13 Dec 2022 23:20:22 -0800 Subject: [PATCH 2/2] Enhance Module.mainScriptUrlOrBlob documentation --- site/source/docs/api_reference/module.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/source/docs/api_reference/module.rst b/site/source/docs/api_reference/module.rst index 68019f5e6193f..7ed2a9b406bfc 100644 --- a/site/source/docs/api_reference/module.rst +++ b/site/source/docs/api_reference/module.rst @@ -149,7 +149,7 @@ The following ``Module`` attributes affect code execution. Set them to customize .. js:attribute:: Module.mainScriptUrlOrBlob - Allows pthread workers or WASM workers to independently load up the the main application module JavaScript file (e.g. main.js) from a URL or blob. Creation of pthread workers or WASM workers need to load the main application module JavaScript file (e.g. main.js). By default, they load the the content of main.js from the URL of main.js. However, if the main.js file was loaded from a Blob or main.js, it is not possible to access the URL of the main.js. Also, when main.js is bundled by a Node.JS module bundler (e.g. webpack), the URL of that script can be wrong, the URL after webpack bundler will result in something like main.chunk.js + Allows pthread workers or WASM workers to independently load up the the main application module JavaScript file (e.g. main.js) from a URL or blob. Creation of pthread workers or WASM workers need to load the main application module JavaScript file (e.g. main.js). By default, they load the the content of main.js from the URL of main.js. However, if the main.js file was loaded from a Blob, it is not possible to access the URL of the main.js. Also, when main.js is bundled by a Node.JS module bundler (e.g. webpack), the URL of that script can be wrong, the URL after webpack bundler will result in wrong URL like main.chunk.js Other methods =============