Skip to content
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

Clarify Contributing for Typescript 2.0 #11210

Closed
ethanresnick opened this issue Sep 13, 2016 · 5 comments
Closed

Clarify Contributing for Typescript 2.0 #11210

ethanresnick opened this issue Sep 13, 2016 · 5 comments
Assignees
Labels

Comments

@ethanresnick
Copy link
Contributor

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?
@RyanCavanaugh RyanCavanaugh self-assigned this Sep 13, 2016
@TonyPythoneer
Copy link
Contributor

TonyPythoneer commented Sep 14, 2016

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? 😕

@vvakame
Copy link
Member

vvakame commented Sep 14, 2016

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

@simonbear89
Copy link
Contributor

@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.

@tomwanzek
Copy link
Contributor

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

@ghost
Copy link

ghost commented Oct 19, 2016

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

@ghost ghost closed this as completed Oct 19, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants