qooxdoovtk.js

How to integrate ES6 Dependency Framework


I want to integrate an ES6 Dependency (vtk.js) into a Qooxdoo Application. I don't know how to manage this. Here is an Example to use the vtk.js. So my Question is:

  1. Is it Possible to integrate ES6 Dependencys?
  2. When it is possible, what i have to do?

Solution

  • The short answer is yes, with some caveats. Qooxdoo v5 (the current release) does not support ES6 constructs in code, because (a) the generator will not accept that syntax and (b) ES6 requires strict mode and there's a compatibility issue which prevents it working.

    You could use Qooxdoo v5 with an ES6 library, provided that you don't want to write ES6 code yourself - strict mode is specified on a per-file basis, and your only restriction is to not enable it on code which the generator compiles (ie your code).

    However, Qooxdoo v6 supports ES6 out of the box, provided that you use the new compiler (at github.com/qooxdoo-compiler). This compiler will allow you to write ES6 code and transpile it on the fly so that you can also achieve platform independence.

    Qooxdoo v6 is in beta and available via github.com/qooxdoo - the master branch is very stable and used in production by core team members so is worth consideration.

    In v6 you can customise the index.html generation, or use the externalResources key in compile.json (if you're using the compiler) or handle loading yourself via qx.io.DynamicScriptLoader.

    Once the javascript is loaded, you then need to create a custom class derived from qx.ui.core.Widget and override these methods:

    Once you've done that, you will have a custom widget that integrates with Qooxdoo; all that remains is to either expose the internal VTK implementation or build an API to operate VTK through.