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

Include es6 type definition via TypeScript compiler or 3rd party module #2016

Closed
kwonoj opened this issue Oct 10, 2016 · 9 comments · Fixed by #2027
Closed

Include es6 type definition via TypeScript compiler or 3rd party module #2016

kwonoj opened this issue Oct 10, 2016 · 9 comments · Fixed by #2027
Labels
feature PRs and issues for features TS Issues and PRs related purely to TypeScript issues

Comments

@kwonoj
Copy link
Member

kwonoj commented Oct 10, 2016

RxJS version:
.Beta.12

Additional information:
related to #2011 (comment)

Lot of confusion from TypeScript user is RxJS rely on some of 3rd party type definition to support ES2015 signatures and they have to install it by themselves. From TS@2.0, there's newly introduced mechanism to supply 3rd party type definition by installing published npm packages, like es6-shim(https://www.npmjs.com/package/@types/es6-shim) .

RxJS can specify them as dependency to remove those issues completely, or set loosely as peerDependency to consumer knows it's requires, feel freely choose between @types package or their own (i.e, typings).

I believe redux-observable is aim for similar, /cc @jayphelps as well for opinions.

@kwonoj kwonoj added feature PRs and issues for features TS Issues and PRs related purely to TypeScript issues labels Oct 10, 2016
@jayphelps
Copy link
Member

I was playing with the new @types and man this is such a confusing situation DefinitelyTyped vs typings vs types vs lib provides it already.

Can you share what changes you're recommending specifically? e.g. the package.json changes?

@kwonoj
Copy link
Member Author

kwonoj commented Oct 10, 2016

I also tried this bit yesterday and found it's bit confusing to me as well, since it isn't super clear origin of @types package comes in, and possible conflict based on user configuration, etcs.

I don't have concrete configurations at this moment - but current suggestion is set as peerDependency to not cause trouble to existing configs but let user know they need to supply 3rd party type definition. Consumer can freely choose to supply it via installing peerDependency, or use their own existing config like typings. (Note: this only applies npm@3 and above which doesn't install peerDependency explicitly)

@kwonoj
Copy link
Member Author

kwonoj commented Oct 10, 2016

in short, proposal will looks like

"peerDependencies": {
    "@types/es6-shim": "version we want"
}

@david-driscoll
Copy link
Member

Do we need third part shims to be a part of the library itself? With Ts2.0 we can simply set the lib appropriately, and then anyone consuming downstream just has to have the same or similar lib items.

@kwonoj
Copy link
Member Author

kwonoj commented Oct 10, 2016

@david-driscoll you're referring https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#including-built-in-type-declarations-with---lib , is that correct? Yes, this seems neat and more feasible (if it works as expected)

@kwonoj kwonoj changed the title Include es6 type definition as dependency (or peer) Include es6 type definition via TypeScript compiler or 3rd party module Oct 10, 2016
@kwonoj
Copy link
Member Author

kwonoj commented Oct 10, 2016

Changed subj.

@david-driscoll
Copy link
Member

@kwonoj yeah, the new lib part of tsconfig.json allows greater control. We can just build with as few primitives as necessary. And this should also allow us to bring back Iterable<T> and Iterator<T>.

@kwonoj
Copy link
Member Author

kwonoj commented Oct 11, 2016

That makes much more sense than original proposal. Let's evaluate those.

@lock
Copy link

lock bot commented Jun 6, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature PRs and issues for features TS Issues and PRs related purely to TypeScript issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants