-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
[types-2.0] Parallel Version Structure to Support D3 v4 Standard Bundle Definition and D3 v3 #11367
Comments
@RyanCavanaugh @andy-ms Is there an update on the ability to maintain current and legacy version in DT concurrrently? This feature is still causing issues, as people expect to find D3 v4 for the standard bundle in the This feature seems critical in general not just for D3, so an update/ETA would be great. Thanks in advance. |
Since the legacy version has already been published, you could go through the packages depending on it and give them a package.json with |
@andy-ms Thanks for the clarification. So, if I sum up the todo would be the following: 1, Find all definitions which have a dependency on legacy D3 (v3) I did not realize that the Definition tester running the integration tests over Which leads me to the last question: I suppose the Thanks as always for all your hard work!!! 😄 |
Actually, depend on |
Thanks, will let you know. I will try to fit it in today, I am just not 100% how many other packages with D3 dependencies I will have to hit. Cheers, T. |
@tomwanzek At least for starters, you could try looking at the files changed list from #4032. Those were the |
@gustavderdrache we also have the list of failed Travis tests from the initial attempt to merge D3v4. @andy-ms To take a concrete example {
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": false,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts"
]
} Is the idea that the Sorry for the follow-up question... |
You don't need to make any other changes. There may still be other dependencies from baseUrl. |
Alright, will have to touch:
On my way, stay tuned 😉 |
Best of luck, and heartfelt thanks for your continued diligence. |
@gustavderdrache Quick question to you: What is the scoop about the |
I only see one plugin in it. I think it's worth pinging the higher-ups to see if we can just move superformula to a top-level definition and remove that directory. |
@andy-ms I have pushed a commit to my fork of DefinitelyTyped, branch Before creating a PR, this is where it stands: Essentially, all it does is add the The Travis tests also fail see here for the tests on my fork. Given the Note that I would definitely do an additional little chore commit to update the version numbers in comment headers of the affected definition files listed above, where they do not already have one. For alignment purposes, where possible. |
OK, turns out you do need to edit the tsconfig.
|
Thx. I will touch up the |
Also, use caret ranges instead of ">=3 <4". |
Can do, no problem. |
Alright, I just pushed the resulting updates to my fork. Based on what I saw locally, as long as the travis tests run npm install in each affected folder, everything should work now. I will check back and let you know, when Travis had some time to ponder the matter 😄 If there are no issues on my fork I will convert to a PR to |
@andy-ms As Travis was oh so happy on my fork, I have now formally submitted the PR #12256. Once this one is through, we have arrived at the point where everything is simply about maintaining and improving the definitions in the ordinary course of business. Thanks for all your hard work along the way, including @RyanCavanaugh @mhegazy . |
So finally, with great pleasure I am closing this issue, as the D3 Standard Bundle now has a first version of the definitions published under version 4.2.37:
There should be a follow-up to pin down the minor versions of the modules which it re-exports so that the standard bundle definition stays "roughly" aligned with the corresponding d3 bundle library. I.e. add a stub- This is all the more indicated, as 4.3.0 was just released, with some changes to d3-geo and d3-voronoi triggering the minor version bump. I have already opened separate issues to update the two module definitions. |
D3 version 4 can be loaded on a module-by-module basis, but for convenience a D3 Standard Bundle is provided for both module import and vanilla script use.
This D3 Standard bundle is published as a UMD module of name d3. Currently, the definitions for this standard bundle cannot be published in DefinitelyTyped/types-2.0 (see closed PR #10453) due to existing dependencies of other libraries on the legacy D3 v3.x definitions (e.g. plottable, nvd3) contained in the same directory.
This issue is spun off from the original Definitions Request #9936, where it has been tracked so far.
This issue is related to a functional gap in the current setup of the DefinitelyTyped/types-2.0 Branch. The need for a parallel version structure is a known open item as per the TypeScript team, see issue #10711.
This issue carries over the migration issue for the existing D3 version 4 standard bundle defintion file which was tracked under d3-v4-definitelytyped Issue 116.
@RyanCavanaugh @andy-ms @mhegazy
cc @gustavderdrache
With the sincerest hope that it remains a temporary workaround, developers who need a definition file representing the D3 version 4 may proceed as follows:
Install the module-level definitions for the D3 modules comprising the D3 standard bundle individually, using e.g.
npm install @types/d3-selection --save
and so forthCreate your own definition file for the standard bundle by re-exporting the individual module definitions and creating the
d3
global, if required for a vanilla script project (see below for the file content.)Add the hand-crafted definition file to your project compilation context
Use
(a) as a module follows the standard TS module import nomenclature
import * as d3 from 'd3';
(or subsets.(b) for a vanilla script, makes the global
d3
available by including\\\ <reference types='d3' />
The content of the standard bundle definition file is as follows (
export as namespace d3;
exposes the global):Edit: The correct Definition Request Issue is #9936.
The text was updated successfully, but these errors were encountered: