This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.