Category talk:Javascript Function

From RPTools Wiki
Jump to navigation Jump to search

We need names for the two categories of JavaScript functions. Something like "HTML5" or "browser-based", and then "GraalVM" or "non-HTML5" or something for the other.

The HTML5 group emulates a browser and runs on a separate thread from MTscript, meaning it can actually be executing concurrently with MTscript macros, but interacting with those macros is complex as it requires AJAX calls or other asynchronous approaches.

The GraalVM environment runs on the main GUI thread, just like MTscript macros do, means that they are always synchronous with MTscript and will block the GUI while they run.

Once names are chosen, the next step may be to rename the existing pages to include the category name and leave the original name as a placeholder so that older links still work. The advantage is that (new) users looking at the function list will be able to easily tell which functions work in which environment.

The other solution would be to rename the functions (instead of js. as a prefix for both groups, create separate prefixes; there's already an html. prefix, for example). I don't like this at all as it breaks a lot of existing code, but it might be an option for MTscript 2.0 (heh).

(Hm, maybe the JS functions for HTML5 could add html. as an additional prefix right now and deprecate the js. ones? At some future point, the deprecated functions would be removed.)