
Show HN: Transcrypt Python to JavaScript compiler can now generate native JavaScript components - JdeH
http://www.transcrypt.org/docs/html/special_facilities.html#transcrypt-s-unit-mechanism-and-creating-native-javascript-component-frameworks
======
JdeH
Starting with Transcrypt v3.6.101 it is now possible to create native
JavaScript component frameworks using the Transcrypt Python to JavaScript
compiler. This makes it possible to write compact, fast JavaScript components
for the browser in Python.

The project can be found at:

[https://github.com/qquick/Transcrypt](https://github.com/qquick/Transcrypt)

Components can be freely mixed on a page without requiring recompilation. A
developer doesn't need Transcrypt or any knowledge of it to use such a
framework.

Each page has one unit that contains the Transcrypt runtime and, if needed,
any central facilities. It is compiled with the -u .run switch. In addition
each page can hold as many separate components as needed. Compile these with
the -u .com switch.

A loader is generated, accepting a list of components. By varying this list,
each page can have its own subset of components, without the need to
recompile. The generated JavaScript code for components can be very small,
typically a few hundred bytes. The runtime and central facilities are included
in the page only once.

