-
Notifications
You must be signed in to change notification settings - Fork 37
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
D3 v4 - how to handle sub-modules? #4
Comments
I don't have any immediate plans for d3 v4 yet. Unfortunately my ability to sit down and code is extremely limited at the moment, at least until I return to work in September. From a quick glance, it seems to me that https://github.com/ivanvanderbyl/ember-cli-d3-shape loads up all the d3 submodules, not just shape, and patches up the AMD modules to be compatible with Ember CLI's loader? Would be nice if the hacks weren't needed and we could use the AMD modules that d3 v4 provides out of the box in the first place. |
How about giving myself and @ivanvanderbyl contributor access so we can take care of this for you. I'd love to see only one main "d3 shim" ember addon that the whole ecosystem revolves around. A common sense approach might be to tag this with |
I'd be happy to do the leg work to make this happen. I'm not sure of the current status of the D3 modules, but when I started authoring that addon they were using a type of universal module loader which was not compatible with Ember because Ember doesn't expose a 100% compatible AMD module loader, so the Funnel I built basically converts them to modules which Ember can load, then adds them to the vendor tree so you can easily import them as per the D3 v4 docs. |
I added both of you as contributors. I'll take care of the NPM portion when I can get access to a terminal later today. Wish I could be of more help! |
Thanks so much Estelle, I'll get it ready to cut a new release and have this replace my addon next. |
@ivanvanderbyl / @mike-north Added as owners to NPM. |
Awesome. Thanks estelle! Ivan - I have some interesting "nested addon" cases that might make a good set of target use cases A "d3 v3 only" librarywhere I need to constrain d3 to a particular version to support something built on top of it (https://github.com/levanto-financial/ember-nvd3-shim/blob/master/blueprints/ember-nvd3-shim/index.js#L6-L11) blueprints/ember-nvd3-shim/index.js afterInstall: function() {
return this.addBowerPackagesToProject([
{name: 'nvd3', target: '^1.8.0'},
{name: 'd3', target: '^3.0.0'}
]);
} An app that only needs part of the d3 v4 stuffYour old shim made this work well, although I believe I still had the overhead of everything in my app. There's something to be said for explicitly opting in to submodules -- particularly when managing a lot of developers (easy to "contain" usage to a particular subset, if developers need to "opt in" to another module in a pull request). An app/addon that wants to use d3 v4 as a complete libraryProbably a very typical use case. imo this should still use submodules so we can take advantage of tree shaking and other "project svelte" initiatives in the future. It feels like we might want to do the following
|
Hey @mike-north — sounds like a good plan. I was actually thinking In my addon I've managed to make some assumptions about whether the addon is in another addon or an app, which means we don't need to install any other deps in the parent like we do with bower because it can work out which app to import to https://github.com/ivanvanderbyl/ember-cli-d3-shape/blob/master/index.js#L28-L45 I think there's a possibility that we could make this either include a version of D3 v4.x or use one installed in the parent, I'm just not sure which one takes precedence, Stefan probably has some idea :) |
👍 |
Module opt-in is resolved in #8 |
What's the plan for d3 v4? This may work for bringing in the whole library, but it might be useful for opting into particular submodules of the new repo.
It would be nice to avoid having a bunch of individual shims, like https://github.com/ivanvanderbyl/ember-cli-d3-shape for each submodule -- particularly when you consider the "nested addon" use case (i.e., addon1 requires
d3-shape v1
and addon2 requiresd3-shape v2
)cc: @ivanvanderbyl since he's using d3v4, and is well-versed in common usage patterns
cc: @stefanpenner since we're talking about nested addons, and I'm curious as to what he thinks the possible (and recommended) path(s) forward are
The text was updated successfully, but these errors were encountered: