Skip to content

Single file typescript declarations for latest v5.0.2 #2221

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

Closed
roblav96 opened this issue Dec 27, 2016 · 8 comments
Closed

Single file typescript declarations for latest v5.0.2 #2221

roblav96 opened this issue Dec 27, 2016 · 8 comments
Labels
feature PRs and issues for features TS Issues and PRs related purely to TypeScript issues

Comments

@roblav96
Copy link

roblav96 commented Dec 27, 2016

For the previous versions of [email protected] I've been able to find the typescript declarations in a single file:
https://github.com/Reactive-Extensions/RxJS/blob/master/ts/rx.d.ts
I prefer downloading the minified file off the CND from:
https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.1.0/rx.js
Then importing that file using:

global.RX = require('./rx.min')

But I can't find this single file declarations for the latest [email protected] anywhere. I tried downloading the release and running all the npm run compile_dist_* but the single file declarations was never produced.

Is there any other way I can generate all the declarations into one contained file that represents the CND's minified release builds? Thank you! :D

@kwonoj
Copy link
Member

kwonoj commented Dec 27, 2016

Unfortunately no, RxJS v5 does not provide merged (flattened) type definition and no short-term plan to support this. There was actually discussion regarding this topic to support UMD type of build to have type definitions as well (#1481), but current compiler support lacks of features to merge, or flatten type definitions into a single definition from multiple definitions.

In case of RxJS v4 (and other definition such as @types package) could support single type definition is those are handwritten and does not have relation to actual source code, but in case of Rx v5 type is generated via actual codebases, so manual handcrafting on each type definition is something hard to be done.

There is open discussion in compiler side support (microsoft/TypeScript#5332) but seems it hasn't been got lot of attention at the moment. If compiler supports those features, then it may possible to explore on this codebase if it's workable with existing codebases.

@kwonoj kwonoj added the TS Issues and PRs related purely to TypeScript issues label Dec 27, 2016
@kwonoj
Copy link
Member

kwonoj commented Dec 27, 2016

For now there isn't actionable item for this issue I'd like to suggest close and revisit once there's possible tool support as same as #1481 - what do you think @roblav96 ?

@kwonoj
Copy link
Member

kwonoj commented Dec 27, 2016

related note, microsoft/TypeScript#2568 maybe one possible approach but it doesn't support UMD directly, not sure if it'll work with UMD when targetted to other module types, also not sure how to validate those as well.

@roblav96
Copy link
Author

@kwonoj Thanks so much for these resources!

I'm thinking what I might try is compress/minify the v5.0.2 package into one file then use the https://github.com/TypeStrong/dts-bundle
I'll let you know how this turns out :D

@kwonoj
Copy link
Member

kwonoj commented Dec 27, 2016

@roblav96 yes, I was considered dts-bundle and generator (#1481 (comment)) at the moment with original issue, no luck then. Hope it may changed and updated.

@kwonoj kwonoj added help wanted Issues we wouldn't mind assistance with. and removed help wanted Issues we wouldn't mind assistance with. labels Mar 1, 2017
@kwonoj
Copy link
Member

kwonoj commented Mar 2, 2017

Typescript compiler considers this as 2.3 milestone microsoft/TypeScript#4433 , will not be able to achieve until proper upstream supports comes in.

@kwonoj kwonoj added the feature PRs and issues for features label Mar 2, 2017
@kwonoj
Copy link
Member

kwonoj commented Aug 14, 2017

It seems upstream issue is stall without exact milestone, I'm going to close issue for now as blocked by upstream. Once we have TSC supports we can revisit this.

@kwonoj kwonoj closed this as completed Aug 14, 2017
@timocov
Copy link

timocov commented May 16, 2018

Hi there!

I have a tool which allows to bundle single dts file - https://github.com/timocov/dts-bundle-generator.

Here is bundled dts created by dts-bundle-generator (entry point is src/index.ts). Possible that this tool is what you need until original issue from TypeScript is fixed 🙂. Please let me know if it built something wrong or if it not worked as you expect.

/cc @kwonoj

@lock lock bot locked as resolved and limited conversation to collaborators Jun 15, 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

No branches or pull requests

3 participants