User:Colby Russell/JS bridge: Difference between revisions

From triplescripts.org wiki
Content added Content deleted
(Created page with "The official way to interface with JS is `Function`. You can ship a JS module (or module trees) by "compiling" the JS into a template literal, and then having a constructor t...")
 
(JS support is optional, it must be statically declared, and actual use is discouraged)
Line 1: Line 1:
The official way to interface with JS is `Function`.
The official way to interface with JS shall be `Function`.


Runtimes will be permitted to provide optional support for JS. Apps/modules that need JS compatibility will need an attribute to statically declare their requirement.
You can ship a JS module (or module trees) by "compiling" the JS into a template literal, and then having a constructor that acts as a convenience wrapper around `Function`.

You can ship a JS module (or module trees) by "compiling" the JS into a template literal, and then having a constructor that acts as a convenience wrapper around `Function`. However, this will be highly discouraged and is only made available as a stopgap so modules can eventually be ported to the triple script dialect.


IIFEs as an escape hatch are forbidden. (Only permitted in the shunting block and as a convenience for static assignments for legacy runtimes that don't support `class` and constant property additions to the prototype is too annoying.)
IIFEs as an escape hatch are forbidden. (Only permitted in the shunting block and as a convenience for static assignments for legacy runtimes that don't support `class` and constant property additions to the prototype is too annoying.)

Revision as of 03:06, 24 July 2020

The official way to interface with JS shall be `Function`.

Runtimes will be permitted to provide optional support for JS. Apps/modules that need JS compatibility will need an attribute to statically declare their requirement.

You can ship a JS module (or module trees) by "compiling" the JS into a template literal, and then having a constructor that acts as a convenience wrapper around `Function`. However, this will be highly discouraged and is only made available as a stopgap so modules can eventually be ported to the triple script dialect.

IIFEs as an escape hatch are forbidden. (Only permitted in the shunting block and as a convenience for static assignments for legacy runtimes that don't support `class` and constant property additions to the prototype is too annoying.)

Cookies help us deliver our services. By using our services, you agree to our use of cookies.