Definitelytyped: Clarify Contributing for Typescript 2.0

Created on 13 Sep 2016  路  5Comments  路  Source: DefinitelyTyped/DefinitelyTyped

Hi,

I ran into some points of confusion about contributing to DefinitelyTyped that don't seem to be answered in the contribution guide. I wanted to flag those here so that the answers can be documented in the future. (Answers to these questions would be appreciated, but I understand if StackOverflow is the better venue for that.)

  1. Are contributors supposed to send PRs to the master or the types-2.0 branch? Both?
  2. The types-2.0 branch seems to have its own naming convention (declaration files are index.d.t.s rather than {libname}.d.ts. Declarations on that branch also seem to be written differently. E.g., the express declarations are wrapped in a declare module "express" {} block on master, but not on types-2.0. Should contributors worry about/account for these differences? Or is there some way that the files on types-2.0 are being automatically pre-processed to account for these changes. (Preprocessing could easily change the name, and seems to be happening in other places; see below.)
  3. The types on the types-2.0 branch use a new <reference types=""> directive. I understand that this still needs to be documented further, but the documentation I could find seems to suggest that <reference types=""> should be used to pull in the types for a global, but an import could be used to pull in the types for a module... and yet the express declarations on types-2.0 uses _both_ import and <reference types="">. Why? Since <reference types=""> is new to 2.0, I can't imagine it's for backwards compatibility...
  4. In some files on the types-2.0 branch, <reference path=""> to seems to have been updated <reference types=""> manually by @RyanCavanaugh's commit, but other files (e.g.)on the types-2.0 branch still seem to be using the <reference path=""> syntax... and yet, if I install it through NPM, I see the <reference types=""> syntax instead. Does that mean the types publisher is doing some kind of auto-rewriting, as I alluded to above? And, if so, what does this mean for contributors too?
@types

Most helpful comment

Hi, I'm writing "MY" opinions.

Now, 1.8.10 is latest stable release version of TypeScript.
master branch support "latest stable version" only.
Beta and RC is experimental versions.

I suggestion we should send PR to master branch.
We can merge master into types-2.0, but We can't reverse it before TypeScript 2.0 stable release.
If we merge PR into master and types-2.0 branch both. Merge operation require veeeeery high calories.
I want to avoid it.

I just added @types label to Issue and PR.
I wait and see Microsoft TypeScript team. e.g. @RyanCavanaugh @mhegazy @zhengbli @andy-ms and more.


latest Merge master into types 2.0 is #10708 .
I think follow-up to the head it has become difficult...?


I am not confident. but...
<reference types=""> is similar to --types options.
It construct --types chain automatically.

check kind property in this document.
https://github.com/Microsoft/types-publisher#fields-in-datadefinitionsjson

see
https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#augmenting-globalmodule-scope-from-modules
https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#support-for-umd-module-definitions


If you can read japanese. I'm writing technical article for TypeScript 2.0.
http://qiita.com/vvakame/items/7c9103289da1d8ca5841
http://typescript.ninja/typescript-in-definitelyland/definition-file.html

All 5 comments

I have the same doubt about the first question.

I found most of the contributors send PR to master. Does it cause the differences become larger between master and type-2.0?

Suppose developers install the definitions from type-2.0, do they have the same definitions as master? :confused:

Hi, I'm writing "MY" opinions.

Now, 1.8.10 is latest stable release version of TypeScript.
master branch support "latest stable version" only.
Beta and RC is experimental versions.

I suggestion we should send PR to master branch.
We can merge master into types-2.0, but We can't reverse it before TypeScript 2.0 stable release.
If we merge PR into master and types-2.0 branch both. Merge operation require veeeeery high calories.
I want to avoid it.

I just added @types label to Issue and PR.
I wait and see Microsoft TypeScript team. e.g. @RyanCavanaugh @mhegazy @zhengbli @andy-ms and more.


latest Merge master into types 2.0 is #10708 .
I think follow-up to the head it has become difficult...?


I am not confident. but...
<reference types=""> is similar to --types options.
It construct --types chain automatically.

check kind property in this document.
https://github.com/Microsoft/types-publisher#fields-in-datadefinitionsjson

see
https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#augmenting-globalmodule-scope-from-modules
https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#support-for-umd-module-definitions


If you can read japanese. I'm writing technical article for TypeScript 2.0.
http://qiita.com/vvakame/items/7c9103289da1d8ca5841
http://typescript.ninja/typescript-in-definitelyland/definition-file.html

@vvakame @RyanCavanaugh When does master get merged into types-2.0? Is this done automatically on a regular basis?

For example, I want to merge the latest mongoose definitions on master
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/mongoose/mongoose.d.ts

into the one on types-2.0
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/types-2.0/mongoose/index.d.ts

The version on master was update a couple weeks ago. There's a commit on types-2.0 2 days ago that says master was merged into types-2.0, but it looks like the mongoose definitions on types-2.0 are not up to date.

FYI you might find some value in reviewing this issue and the responses therein #10711 .

This should now be answered by the new README: #12070

Was this page helpful?
0 / 5 - 0 ratings