-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide UMD compatibility #40
Labels
Milestone
Comments
nicksay
added a commit
to nicksay/spfjs
that referenced
this issue
Aug 14, 2014
* Ensure build output is wrapped to support both AMD (e.g. RequireJS) and CommonJS (e.g. Browserify) module formats. * Use a dedicated wrapper.js file since the complexity has grown. * Streamline how the API is defined for both the main and bootloader binaries to reduce boilerplate. Closes youtube#40.
nicksay
added a commit
to nicksay/spfjs
that referenced
this issue
Aug 14, 2014
* Ensure build output is wrapped to support both AMD (e.g. RequireJS) and CommonJS (e.g. Browserify) module formats. * Use a dedicated wrapper.js file since the complexity has grown. * Streamline how the API is defined for both the main and bootloader binaries to reduce boilerplate. Closes youtube#40.
nicksay
added a commit
to nicksay/spfjs
that referenced
this issue
Aug 15, 2014
* Ensure build output is wrapped to support both AMD (e.g. RequireJS) and CommonJS (e.g. Browserify) module formats. * Use a dedicated wrapper.js file since the complexity has grown. * Streamline how the API is defined for both the main and bootloader binaries to reduce boilerplate. Closes youtube#40.
nicksay
added a commit
to nicksay/spfjs
that referenced
this issue
Aug 15, 2014
* Ensure build output is wrapped to support both AMD (e.g. RequireJS) and CommonJS (e.g. Browserify) module formats. * Use a dedicated wrapper.js file since the complexity has grown. * Streamline how the API is defined for both the main and bootloader binaries to reduce boilerplate. Closes youtube#40.
nicksay
added a commit
to nicksay/spfjs
that referenced
this issue
Aug 15, 2014
* Ensure build output is wrapped to support both AMD (e.g. RequireJS) and CommonJS (e.g. Browserify) module formats. * Use a dedicated wrapper.js file since the complexity has grown. * Streamline how the API is defined for both the main and bootloader binaries to reduce boilerplate. Closes youtube#40.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
UMD Compatibility
Current
Currently SPF is delivered in the traditional format of a compiled binary wrapped in an anonymous function, with exports being assigned to the global level via the window variable.
Issue
While there's nothing wrong with the current system, but if someone were to want to load SPF via an AMD (e.g. RequireJS) or CommonJS loader, it would require a shim config.
Proposal
Wrap the compiled binary in a UMD-style format like that defined at https://github.com/umdjs/umd/blob/master/commonjsStrict.js for broader compatibility.
The text was updated successfully, but these errors were encountered: