Skip to content
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

Closed
nicksay opened this issue Aug 4, 2014 · 0 comments · Fixed by #50
Closed

Provide UMD compatibility #40

nicksay opened this issue Aug 4, 2014 · 0 comments · Fixed by #50

Comments

@nicksay
Copy link
Contributor

nicksay commented Aug 4, 2014

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.

@nicksay nicksay added this to the SPF 20 milestone Aug 4, 2014
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant