Skip to content

Support ES6 import in uncompiled mode #466

Closed
@mseeley

Description

@mseeley

Getting started with Shaka is easy. Install shaka-player through npm and step through the basic usage documentation and quickly we're playing a video. This is good thanks.

Our application is build on ES6 modules using WebPack and Babel. Including shaka-player into our player is as simple as: import shaka from 'shaka-player';

Going from this to a uncompiled version is unclear. The good velocity from setup and getting started hit a wall.

To load the library without compiling, you will need to generate a Closure "deps file" by running ./build/gendeps.py. Then, you'll need to bootstrap your application with three < script > tags:

In order to run in uncompiled mode we have to checkout the repo, build deps, then include these files in an HTML document. What's implied is the HTML document is in the root of the shaka-player repo. This is fine when you're debugging isolated test cases. This is nearly impossible to use when debugging integration issues with application logic.

Integrating an uncompiled Shaka Player into an application is unclear. The script element recommendation won't work, dep paths are inaccessible. Importing the three files also doesn't work; they collaborate using global variables and don't understand exports. So, the import approach above doesn't work as:

import 'shaka-player/third_party/closure/goog/base';
import 'shaka-player/dist/deps';
import 'shaka-player/shaka-player.uncompiled';

It was a long shot anyway. I didn't expect the multiple import approach to work, but, hey, grasping for uncompiled straws.

Will you please consider making it easier to debug integration issues? As a developer, quickly swapping a CDNJS link from the compiled to concatenated but not mangled build would be effortless. Same is true to use a import shaka from 'shaka-player/debug'.

I'm unsure if "compiled" means concatenated and minified in the Closure Compiler world. If not, please do consider making debugging flexible while avoiding requiring users build their own players from source.

Thanks for reading!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions