Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Add first dependencies #2

Merged
merged 11 commits into from
May 28, 2014
Merged

Conversation

justinvdm
Copy link
Contributor

The first dependencies for sapphire will be:

The biggest complication is adding these dependencies in a way that works for all cases, regardless of whether whoever is consuming sapphire is using amd, commonjs, or browser globals. Browserify adds a small wrapper for handling the different environments already (looks like people are calling it a 'umd' nowadays) if it is given a standalone option. Problem is, it doesn't handle dependencies for each environment, since it assumes everything will eventually be bundled together (dependencies included). This doesn't work for sapphire, since sapphire is meant to be another library people consume (so they might already be loading d3 on their page).

To solve this, the plan is to use gulp-wrap to continue leaving the defining part of the umd wrapping up to browserify, but handle the dependencies part by injecting the dependencies into a scope that all of sapphire's modules are contained in.

d3-grid-layout was designed to be included in browserify bundles, so it isn't registered as a bower component and doesn't do any umd wrapping. This is a tiny dependency, and it isn't likely that it will be around on pages already for people that want to use sapphire, so the plan is to bundle this dependency in with sapphire.

@justinvdm
Copy link
Contributor Author

Ready for review.

@hodgestar
Copy link
Contributor

👍

@justinvdm justinvdm merged commit cc44bb4 into develop May 28, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants