Update Pjs to a modern 2016-2017 build system #265
Description
The current code is a whole lot of first pass "get the code modular" decisions, with a build system approach that no longer makes sense given the advances in tooling for offline JavaScript.
Estimated as a long-running task, the following subtasks can be identified:
- rewrite to proper commonjs2 format (taking advantage of the requires-are-cached property)
- add in eslint for code and code style validation
- rewrite to ES6+ as much as possible
- do bundling with webpack
- set up code testing using something like mocha or jest
A possible rewrite for the parser side of things might also be worth it, using java-parser to convert a set of .pde
files into a single large file (the same way Processing itself loads all code as source inside a single PApplet class definition) that is then turned into an AST, which can then either be serialized as javascript source, or compiled into a javascript sketch object (the latter being the preferred choice as this would allow live-updates much better).