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

WAITING FOR TSC 1.8: Move static observable stubs from Observable.ts to… #1288

Closed

Conversation

david-driscoll
Copy link
Member

… patch files

Related to #1284, and I'm fine with rebasing once #1284 gets merged.

cc @masaeedu @kwonoj

@kwonoj
Copy link
Member

kwonoj commented Feb 2, 2016

👍 Thanks for PR, let's take #1284 first, hope you do not mind. (I know you already mentioned it's ok ;) )

declare module '../../Observable' {
module Observable {
export let bindNodeCallback: typeof BoundNodeCallbackObservable.create;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity - can let be const?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears the compiler will then refuse to let you assign the value above.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm.. interesting, thanks. Not a major issue, so think it'd be ok.

@kwonoj
Copy link
Member

kwonoj commented Feb 2, 2016

cc @Blesh also for visibility, @Blesh , this PR changes organizations of static method as below

  1. now Observable.ts does not include static method stubs by default
  2. as same as patch operator, importing patch will dynamically import static method as well as its types
  3. No changes for Rx / Rx.KitchenSink consumer perspective. Internally now it imports patch operator then reexports to type definitions are published.

@david-driscoll
Copy link
Member Author

One thing to note, today they still have to import the static method, but a TypeScript consumer will see that the method "exists" then when they try to use it they'll get a method not found error.

This change makes it obvious that method doesn't exist and that they need to import it.

@kwonoj
Copy link
Member

kwonoj commented Feb 2, 2016

Yes, my terms are not precise. @david-driscoll 's correct. removed incorrect comment.

@benlesh
Copy link
Member

benlesh commented Feb 2, 2016

Will this all work correctly if the consumer is using an older version of TypeScript? (say 1.7 or 1.8?)

@david-driscoll
Copy link
Member Author

I believe some of the changes are being back ported to 1.8 but I would have to confirm that. This would also affect #1284. @masaeedu do you know if this is being back ported to 1.8? I thought I saw something about that.

@kwonoj
Copy link
Member

kwonoj commented Feb 2, 2016

I believe it should work at least on 1.8, for earlier version need to verify it. Primary goal is not to regress and consumer should not care about typescript version dependency. (this, #1284 both)

@david-driscoll
Copy link
Member Author

microsoft/TypeScript#6731 is tagged as version 1.8.2

@kwonoj
Copy link
Member

kwonoj commented Feb 2, 2016

Just tried and verified this change won't work with previous version of typescript, i.e 1.7. So if typescript side fix are in 1.8.2, supported min version will be 1.8.2. This feels bit breaking - will there be user want to stay with 1.6, or 1.7?

@masaeedu
Copy link
Contributor

masaeedu commented Feb 2, 2016

This change won't work with TypeScript 1.7.5, no. You need to have a version of the compiler with the external augmentations feature enabled in order for #1284 and this PR to work, so you need to have either the nightlies or 1.8 (which is indeed being back ported to).

@masaeedu
Copy link
Contributor

masaeedu commented Feb 2, 2016

My personal opinion is that there aren't any very serious reasons for a developer to want to stick to TS 1.7, since the breaking changes between 1.7-1.8 are so few, and the new features so many. That said I appreciate that breaking changes should be taken seriously, and will leave it to the maintainers to decide how to proceed.

@kwonoj
Copy link
Member

kwonoj commented Feb 2, 2016

I personally living edge of versions so wouldn't mind to upgrade and would vote for this changes, but due to that reason I'm not able to represent actual consumer perspective. @Blesh , what do you think? If version support is concern, I think we can hold off these changes for now since this is not blocking any functional scope of current codebase.

@benlesh
Copy link
Member

benlesh commented Feb 2, 2016

TypeScript is currently published at version 1.7 and 1.8 is beta. So we need to support 1.7, unfortunately.

@kwonoj
Copy link
Member

kwonoj commented Feb 2, 2016

published at version 1.7 and 1.8 is beta. So we need to support 1.7

: That seems quite legit, valid point. @masaeedu / @david-driscoll , in that case I'd like to suggest to hold this changes until TypeScript release bumps up to 1.8 to avoid versioning issues - any suggestions around?

@benlesh
Copy link
Member

benlesh commented Feb 2, 2016

Let's have the Angular folks chime in on this too, since this is their big ask: @IgorMinar @jeffbcross @vsavkin @robwormald

@robwormald
Copy link
Contributor

definitely 👍 on this PR in general, but we do need to hold until this functionality is released properly. we can't ask users to install a specific TS edge version (not to mention then having to override their editor to use it as well...)

@kwonoj
Copy link
Member

kwonoj commented Feb 3, 2016

I agree it's hard to recommend consumers to tie with bleeding edge version of infrastructure.

Once I got agreement from @david-driscoll and @masaeedu , I'll put on hold both of PR and re raise once TypeScript bumps up its stable version includes this support. Hope it comes soon, I also quite like this changes and it possibly can bring additional benefit to codebases.

@david-driscoll
Copy link
Member Author

Oh it's fine to hold it. We can't all ride on the bleeding edge. 👍

@masaeedu
Copy link
Contributor

masaeedu commented Feb 3, 2016

@kwonoj No objection here, waiting for 1.8 makes sense.

@benlesh benlesh changed the title refactor(patches): move static observable stubs from Observable.ts to… WAITING FOR TSC 1.8: Move static observable stubs from Observable.ts to… Feb 3, 2016
@masaeedu
Copy link
Contributor

masaeedu commented Feb 4, 2016

Note for when we get back to this: microsoft/TypeScript#6858 fixes module imports so that re-exports aren't needed. TL;DR, all those import 'foo' -> import 'foo'; export * from 'foo'; changes are no longer required.

@kwonoj
Copy link
Member

kwonoj commented Feb 4, 2016

Great news :)

declare module '../../Observable' {
module Observable {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not namespace instead of module?

Reasoning: the key word module in these two lines mean two things, and it can be confusing. namespace would be clearer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mainly I'm just used to using module for so long. I have no issues changing it to namespace.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please, if that's not too much trouble. The less overloaded terms I need to disambiguate in my head the better 😄

@masaeedu
Copy link
Contributor

masaeedu commented Feb 4, 2016

@david-driscoll Since this only works in bleeding edge TypeScript anyways, I think you can also take advantage of microsoft/TypeScript#6858 and get rid of the export * froms. Imports are fixed so those are no longer needed.

@david-driscoll
Copy link
Member Author

@masaeedu did you pull them out in your branch? I can do that no problem.

@kwonoj
Copy link
Member

kwonoj commented Feb 4, 2016

@masaeedu Is that feature has planned tagged version? I.e 1.8.2 has module aug and if those comes later (1.9 or something else), it might need to be separated.

@masaeedu
Copy link
Contributor

masaeedu commented Feb 4, 2016

@kwonoj Yup, it'll be in 1.8.

@masaeedu
Copy link
Contributor

masaeedu commented Feb 4, 2016

@david-driscoll Haven't had time, will get to it on the weekend. No rush, right? 😢

@david-driscoll
Copy link
Member Author

@masaeedu just want to make sure we're lined up! 😄

Now just watch them release 1.8 tomorrow. 😱

@IgorMinar
Copy link
Contributor

This looks good to me but we need to coordinate merging this with a TS release and an Angular release. We can't ask people to be on unstable release of typescript.

@kwonoj
Copy link
Member

kwonoj commented Feb 22, 2016

TS 1.8 has released (https://github.com/Microsoft/TypeScript/releases/tag/v1.8.2). Might need align with ng2 still though.

@robwormald
Copy link
Contributor

as of ng2beta7 we're 1.8 friendly I believe.

@kwonoj
Copy link
Member

kwonoj commented Feb 24, 2016

as of ng2beta7 we're 1.8 friendly I believe.

: Lovely ❤️

@kwonoj
Copy link
Member

kwonoj commented Feb 24, 2016

@david-driscoll , I'm closing this PR per #1388. Let me know if this is incorrect.

@kwonoj kwonoj closed this Feb 24, 2016
@lock
Copy link

lock bot commented Jun 7, 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 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants