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

Making Ember + TypeScript Ergonomic #8637

Closed
4 tasks
wycats opened this issue May 17, 2016 · 8 comments
Closed
4 tasks

Making Ember + TypeScript Ergonomic #8637

wycats opened this issue May 17, 2016 · 8 comments
Assignees
Labels
Meta-Issue An issue about the team, or the direction of TypeScript

Comments

@wycats
Copy link

wycats commented May 17, 2016

At @DanielRosenwasser's request, I'm making a checklist of things that Ember needs (or would like) to make an ergonomic TypeScript story for our users.

I'm using notation that may or may not be the correct implementation answer, but should help explain what I'm getting at. I can go into more detail on any of the items if needed:

  • static create<T>(attrs: T): this & T
  • static extend<T>(extensions: T): typeof (this & T)
  • the ability for a function or method to impute a this onto methods on an object literal
  • the ability to construct a "constructable" class that has both the static and instance side at once, can be passed to extend, can be passed to instanceof and can be newed. It should be possible to build this construct dynamically using ES5 constructs and explain the result in terms of typed ES6 at the interface boundary.
@mhegazy
Copy link
Contributor

mhegazy commented May 17, 2016

1 static create<T>(attrs: T): this & T

this is tracked by #5863

2 static extend<T>(extensions: T): typeof (this & T)

how is that different from: static extends<T>(extensionFactory: { new (): T }): {new (): this & T} assuming #5863 is available.

3 the ability for a function or method to impute a this onto methods on an object literal

this should be working today through contextual typings. for instance:

declare function doSomething(a: { init?(this: BaseObject) });

doSomething({
    init() {
        this // BaseObject 
    }
})

4 the ability to construct a "constructable" class that has both the static and instance side at once,

We have talked about allowing class expressions in type locations. do not think there is a conceptual issue to stop this from working. but i think this should be tracked by a separate issue.

I would expect, however, that you want this in conjunction with extending generic type parameters (tracked by #4890), is this correct?

@mhegazy
Copy link
Contributor

mhegazy commented Jun 7, 2016

@wycats, I am going to close this in favor if #5863, #5863 and #4890, as these are more specific. if there are issues that i have missed please let me know.

@mhegazy mhegazy closed this as completed Jun 7, 2016
@mhegazy mhegazy added the Duplicate An existing issue was already created label Jun 7, 2016
@DanielRosenwasser DanielRosenwasser self-assigned this Jan 6, 2017
@DanielRosenwasser DanielRosenwasser added Meta-Issue An issue about the team, or the direction of TypeScript and removed Duplicate An existing issue was already created labels Jan 6, 2017
@wycats
Copy link
Author

wycats commented Jan 6, 2017

I'll refresh this issue with my sense of the current status later today.

@crhayes
Copy link

crhayes commented Feb 28, 2017

@wycats Any updates? 😌

@wycats
Copy link
Author

wycats commented Apr 22, 2017

@crhayes most of the open issues were addressed in 2.2. We had some announcements at EmberConf about it 😄

@rosshadden
Copy link

@wycats The announcements were exciting, but I don't think most of us (at least in the places I've brought it up so far) know what the current state is. Were the things announced at EmberConf just stepping stones, or is everything ready already? Can we use TypeScript with Ember yet, and if so, how?

@crhayes
Copy link

crhayes commented Apr 24, 2017

@wycats Thanks, I'll check out some of the conference content!

@RyanCavanaugh
Copy link
Member

Haven't seen any updates here in a while and the OP doesn't reflect the current state of Ember requests as I understand them. Welcome to a new issue with updated status but closing this as part of spring summer cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Meta-Issue An issue about the team, or the direction of TypeScript
Projects
None yet
Development

No branches or pull requests

6 participants