RPTools / maptool

Virtual Tabletop for playing roleplaying games with remote players or face to face.
http://rptools.net
GNU Affero General Public License v3.0
790 stars 257 forks source link

[Feature]: Add Ability for JavaScript to import JavaScript from Add-Ons (GraalVM) #3524

Open cwisniew opened 2 years ago

cwisniew commented 2 years ago

Feature Request

JavaScript code in MapTool should be able to import JavaScript from Add-Ons

The Solution you'd like

GraalVM supports imports and a Polygot File System can be created which will restrict imports to JavaScript contained in Add-Ons.

Alternatives that you've considered.

No response

Additional Context

This feature request is only for the GraalVM enabling of JavaScript imports, #3523 will add the functionality to Add-Ons which allows exporting of JavaScript and the ability for this change to check if the file is exported/fetch read the file

cwisniew commented 2 years ago

@perkinslr created this issue to track import for GraalVM if you want me assign it to you please add a comment so GitHub will allow me to do so :)

Tdue21 commented 2 years ago

Partial duplicate, at least functionally, of #3513. Although this explains it better, so close mine :)

cwisniew commented 2 years ago

Partial duplicate, at least functionally, of #3513. Although this explains it better, so close mine :)

This is not for webview, no real plans for webview at the moment as we don't have really any control over it. You can use esbuild, or webpack or something similar.

Tdue21 commented 2 years ago

It's ok, my primary issues regarding modules is for graalvm. WebView can approximate with <script defer src=".."></script> so that's good.

I think the text in my issue is outdated :)

perkinslr commented 2 years ago

@perkinslr created this issue to track import for GraalVM if you want me assign it to you please add a comment so GitHub will allow me to do so :)

Pong.