Description
Following up from #836, I've done some preliminary investigation and work which can be tracked here. I'll use this issue to start detailed discussions and tracking priorities. Would be very happy to discuss suggestions or proposed changes to any of the plans outlined below. 😃
A few priorities:
- End user experience stays the same (except for performance improvements)
- Developer experience mostly stay the same
- Enable rendering of reference directly from translated reference data file
- Keep future maintainability in mind
Switching module system of reference
The first piece of work that is done is switching the module system used from requirejs to browserify. This change is not too consequential and admittedly a bit arbitrary. The reasons it is done is firstly that I'm more familiar with commonjs than AMD, secondly the p5.js library is also using browserify (albeit with babel transform and ES6 modules) so using it here would reduce the amount of prerequisite knowledge to maintain both souces, finally it also slightly reduce the download size from 43kb + require.js' runtime 6kb to 40kb without need for a runtime.
To do:
Render the reference from language specific data files
Now that there are defined structure for en.json
, es.json
, etc, these files can be used in place of data.json
to render the reference directly in the current language of the website. This could take a bit of work to make sure the data structure and templates matches.
To do:
Extract reference data from source comments using comment-parser
This is the final phase which will see that the reference generator we have currently (YUIDocs) be swapped out with a custom generator based on comment-parser
, outputing data in the now defined format of en.json
. I have some starting point that could be adapted in one of my own project.