First steps towards ES6-ification
Created by: imbcmdth
This is an example of some proposed changes to take the project towards a more ES6 direction. I am submitting this PR to get feedback from the community - it is nowhere near ready to be merged!
The build system has been overhauled to use babel
and browserify
to compile ES6 with imports down to ES5 that can run on all browsers. Uglify-js is then used to create the minimized versions.
The build directory has been gutted with the build process moved to the root directory and tests moved to their own sub-directory. This more closely follows common conventions in the node community. Installation is now just a git clone
followed by npm i
and grunt
to build the files into the dist
directory.
Every file is now a proper ES6 module that imports it's dependencies - there is no longer any dependency on the global scope. There is some cleanup necessary to have this work 100% - it seems like browserify
is having issues with some of the circular dependencies.
There are NO change to the usage of dijon (yet!)
In src/dash/Dash.js
and src/streaming/MediaPlayer.js
, we take great pains to recreate the previous object hierarchy and in src/dash.js
We make them global so that the interface appears the same from the outside world. This was done to ensure backward compatibility for testing purposes and allow us to test the changes in various demo pages without having to make changes to the tests themselves.