This PR is an implementation of my proposal in issue #14.
In general, this PR encompasses two major changes, along with several minor changes, which were mostly made to accommodate the major changes or to plan ahead for features we know we'll want in the future.
Major change 1: The three software components (the GTK Javascript library, the gentk Python module and the gtkserver.py Python server) have all been separated, and each has its own directory in the top level: client-js, client-py and server. The server directory, in addition to the gtkserver.py script also contains all of the static files that the server provides. However, the client-side javascript library is now stored in the client-js directory, and the make_release script will place a copy in the server's static directory.
Major change 2: The GTK Javascript library is now built using webpack into a single gtk.min.js file.
A few advantages to this:
A webpage only needs to include the one file to get all GTK functionality.
THREE.js and d3 are automatically bundled in.
With GTK structured as a NodeJS module, we can more easily unit-test it or implement new modules that we might decide we need.
All of the class names have had their GTK prefix dropped, and instead, each one is available through the global GTK object. So, for example, GTKAppState becomes GTK.AppState. Within the library itself, references to other classes are handled by requireing them at the top of the file.
Some minor changes:
The make_release script has been cleaned up a bit and is generally more failure-proof.
When running the server, port, host and project directory are now handled through command-line arguments to gtkserver.py instead of a YAML file. In anticipation of eventually using a production HTTP server, the server will also only serve static files when running the test server from the command-line (the idea being that a full HTTP server would serve the static files itself, and then call gtkserver.py through WSGI for other endpoints).
The Readme's been updated to more clearly explain the process of creating a release and running the server.
The top-level img directory has been moved inside the doc directory.
This PR is an implementation of my proposal in issue #14.
In general, this PR encompasses two major changes, along with several minor changes, which were mostly made to accommodate the major changes or to plan ahead for features we know we'll want in the future.
Major change 1: The three software components (the
GTK
Javascript library, thegentk
Python module and thegtkserver.py
Python server) have all been separated, and each has its own directory in the top level:client-js
,client-py
andserver
. Theserver
directory, in addition to thegtkserver.py
script also contains all of the static files that the server provides. However, the client-side javascript library is now stored in theclient-js
directory, and themake_release
script will place a copy in the server'sstatic
directory.Major change 2: The GTK Javascript library is now built using webpack into a single
gtk.min.js
file.A few advantages to this:
All of the class names have had their
GTK
prefix dropped, and instead, each one is available through the globalGTK
object. So, for example,GTKAppState
becomesGTK.AppState
. Within the library itself, references to other classes are handled byrequire
ing them at the top of the file.Some minor changes:
make_release
script has been cleaned up a bit and is generally more failure-proof.gtkserver.py
instead of a YAML file. In anticipation of eventually using a production HTTP server, the server will also only serve static files when running the test server from the command-line (the idea being that a full HTTP server would serve the static files itself, and then callgtkserver.py
through WSGI for other endpoints).img
directory has been moved inside thedoc
directory.