-
Notifications
You must be signed in to change notification settings - Fork 3k
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
WAITING FOR TSC 1.8: Move static observable stubs from Observable.ts to… #1288
Conversation
👍 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; |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
cc @Blesh also for visibility, @Blesh , this PR changes organizations of static method as below
|
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. |
Yes, my terms are not precise. @david-driscoll 's correct. removed incorrect comment. |
Will this all work correctly if the consumer is using an older version of TypeScript? (say 1.7 or 1.8?) |
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) |
microsoft/TypeScript#6731 is tagged as version 1.8.2 |
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? |
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). |
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. |
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. |
TypeScript is currently published at version 1.7 and 1.8 is beta. So we need to support 1.7, unfortunately. |
: 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? |
Let's have the Angular folks chime in on this too, since this is their big ask: @IgorMinar @jeffbcross @vsavkin @robwormald |
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...) |
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. |
Oh it's fine to hold it. We can't all ride on the bleeding edge. 👍 |
@kwonoj No objection here, waiting for 1.8 makes sense. |
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 |
Great news :) |
declare module '../../Observable' { | ||
module Observable { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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 😄
04a6085
to
6c6bf10
Compare
@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 |
@masaeedu did you pull them out in your branch? I can do that no problem. |
@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. |
6c6bf10
to
2e6da38
Compare
@kwonoj Yup, it'll be in 1.8. |
There are a bunch of changes in https://github.com/Microsoft/TypeScript/commits/release-1.8 (the release tracking branch that they are migrating changes into). |
@david-driscoll Haven't had time, will get to it on the weekend. No rush, right? 😢 |
@masaeedu just want to make sure we're lined up! 😄 Now just watch them release 1.8 tomorrow. 😱 |
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. |
TS 1.8 has released (https://github.com/Microsoft/TypeScript/releases/tag/v1.8.2). Might need align with ng2 still though. |
as of ng2beta7 we're 1.8 friendly I believe. |
: Lovely ❤️ |
@david-driscoll , I'm closing this PR per #1388. Let me know if this is incorrect. |
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. |
… patch files
Related to #1284, and I'm fine with rebasing once #1284 gets merged.
cc @masaeedu @kwonoj