From 062d6bedf7076182f3bdc3c25dcfca00ba1b4a6a Mon Sep 17 00:00:00 2001 From: webreflection Date: Wed, 20 Dec 2023 10:55:41 +0100 Subject: [PATCH] Make polyscript.js_modules crawable --- docs/README.md | 20 ++++++++++++ docs/core.js | 4 +-- docs/core.js.map | 2 +- esm/custom.js | 4 +-- esm/script-handler.js | 4 +-- esm/utils.js | 18 +++++++++++ esm/worker/_template.js | 4 +-- esm/worker/js_modules.js | 70 ++++++++++++++++++++-------------------- package.json | 2 +- test/leaflet.html | 63 ++++++++++++++++++++++++++++++++++++ test/modules-mpy.html | 35 -------------------- test/modules.html | 65 ++++++++++++++++++------------------- 12 files changed, 177 insertions(+), 114 deletions(-) create mode 100644 test/leaflet.html delete mode 100644 test/modules-mpy.html diff --git a/docs/README.md b/docs/README.md index e16f5b4e..0eca8c33 100644 --- a/docs/README.md +++ b/docs/README.md @@ -264,6 +264,26 @@ In *polyscript*, this is possible by defining one or more `[js_modules.X]` field * `[js_modules.main]` is a list of *source* -> *module name* pairs, similarly to how `[files]` field work, where the *module* name will then be reachable via `polyscript.js_modules.actual_name` in both *main* and *worker* world. As the *main* module lands on the main thread, where there is also likely some UI, it is also possible to define one or more related *CSS* to that module, as long as they target the very same name (see the example to better understand). * `[js_modules.worker]` is a list of *source* -> *module name* pairs that actually land only in ` + + + + +

Main

+
+ + +
+ +

Worker

+
+ + + diff --git a/test/modules-mpy.html b/test/modules-mpy.html deleted file mode 100644 index 56c2fb3f..00000000 --- a/test/modules-mpy.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - Polyscript JS Modules - - - - - - -

Main

- - -
- -

Worker

- - - - diff --git a/test/modules.html b/test/modules.html index 24c3d69a..f366fe93 100644 --- a/test/modules.html +++ b/test/modules.html @@ -5,59 +5,56 @@ Polyscript JS Modules - - -

Main

-
- + +

Worker

-
- - L.marker(mark).addTo(map).bindPopup('Modules on Worker are awesome πŸ₯³').openPopup() + +