When I was designing OpenFL, one of the goals was to build an architecture that would allow for easy development on one of the backends. Currently, we have two backends: “openfl-native” and “openfl-html5”
If you install OpenFL, you will probably notice that these are completely different Haxe libraries. This makes it possible to make changes to the native backend without rebuilding command-line tools, or to make HTML5 improvements without rebuilding native binaries.
git clone https://github.com/openfl/openfl-html5 haxelib dev openfl-html5 openfl-html5
This can also let you replace a backend entirely.
One of the things about HTML5 particularly is that a “one size fits all” approach may not be ideal. One person to the next, or one project to the next, may require different features and emphasize competing priorities.
For sake of argument, I created a simple example of an alternative backend for HTML5. This backend uses DIV elements for Sprites, when requested, the Graphics object is a canvas element, and the stage clipping is a simple “overflow: hidden”
git clone https://github.com/jgranick/openfl-simple-html5 haxelib dev openfl-html5 openfl-simple-html5
Here is an example of a project that works with the backend:
Some features might never work with this kind of backend (for example, bitmapData.draw may not work for DIV elements) but this may be a good match, for, say, web application development.
There is still a lot of room left to innovate. Let’s play!