3 ms·
Is it possible to have V3 and V4 coexisting in a project? Like, adding some of the awesome v4 new things to an already working v3 project without having to rewo
by rusosnith 10y ago
Is it possible to have V3 and V4 coexisting in a project?
Like, adding some of the awesome v4 new things to an already working v3 project without having to rework all the v3 code to v4 compliance?
I've tried doing this with v4 beta, with strange behaviours :)
- a_humean 10y agoI think it is quite possible in some cases due to the modularisation. I have already done that with in my D3 v3 projects. For example I used the d3.stratify method that is part of the d3-hierarchy module.
- mbostock 10y agoHmm. It might be possible, though it doesn’t sound like a great idea to have both D3 3.x and the D3 4.0 default bundle loaded simultaneously, since there will be a lot of overlap. A better strategy might be to load just the new modules you want to use. Like if you just want the new force layout, then load d3-force: https://github.com/d3/d3-force https://github.com/d3/d3-force But it might be best to just migrate to 4.0. I know the changelist is long, but it might not be as hard as you think to migrate. And you can always send your questions to the d3-js Google group or d3.js on Stack Overflow and I’ll try to help.
- chrisprice 10y agoOn a project I work on* we've found that this technique has worked well so far. We're slowly moving from v3 to v4 by splitting out groups of components into their own packages and upgrading them as we go. We've been heavily inspired by d3's approach e.g. with the use of rollup for bundling. We're probably at about 60% of the library upgraded/split-out but we've yet to tackle the more tricky changes like d3-selection. * https://github.com/d3fc https://github.com/d3fc