-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Convert to TS or supply ambient definitions #795
Comments
Note: this will need a public type from Ember for |
I had a go at converting ember-resolver to TypeScript, basically just adding type annotations and avoiding major code changes. This was tedious but pretty straightforward, and uncovered a few minor bugs in code that failed typechecking. Some questions that came up:
|
@bwbuchanan somehow I totally missed this, and came back across it while flushing out my email this morning—will respond after the holiday! |
@bwbuchanan all right, sorry about the delay:
Yep, that's correct. You’ll also want to explicitly supply a
The public API for our purposes actually just matches what we have on DefinitelyTyped—I happen to have had the same question when updating that for Ember v4 support!
A good question. I think we probably want to do that but separately from the types work, not least so that we can do it in a major release which makes it explicit that we're dropping support for any classic class dependencies on it. I’ll confirm this with @rwjblue and the rest of Framework folks; it may be a bit dicier since we haven’t yet deprecated classic classes in general—but I think it’s perfectly reasonable to tackle on packages like this; Glimmer Component already requires native classes, so it's mostly important that we have a clear deprecation cycle and use
This is obviously related to the previous question. Purely from a mechanical POV, once classic class support is gone there’s zero reason to use
Heh, very much yes. Let's also keep that in a separate PR, but please do let's.
I haven't looked at these specifically, but presumably—again, let’s land each of these in separate PRs, just for the sake of CHANGELOG generation and ease of bisecting if something goes amiss later.
I’m going to have to defer entirely to @rwjblue on this one. |
@bwbuchanan I added an ambient type definition at #823, just to keep things moving, but we would still very much welcome a full conversion! |
@chriskrycho Thanks for the answers/clarifications above. I plan to make a draft PR in the next few days after resolving all typecheck/lint issues. |
Currently blocked on this issue:
And this unfortunately breaks the TypeScriptified ember-resolver I will raise a bug against ember. |
cc @ef4 for the peerDeps question |
Thanks! Will see about getting that unblocked this afternoon! |
I think it's fine to have a peerDep on ember-source. Especially since nobody can really use this package without already have that anyway, so it's not imposing anything new. It's just communicating to the package manager that ember-resolver needs to resolve the app's ember-source. |
Thanks for the quick fix to the ember-source typings @chriskrycho! My WIP branch for the TypeScript conversion is here: https://github.com/bwbuchanan/ember-resolver/tree/convert-to-typescript My objectives:
|
I merged the linked PR, but I'm not sure if the issue itself should be closed? As it seems we want to do an actual conversion. |
Right, we should publish a release with that definition ASAP as it unlocks work across the rest of the ecosystem, and then @bwbuchanan’s PR can follow it without any particular urgency (though obviously we’ll want to switch over to using it as soon as we can!). |
As part of Ember.js RFC #0800, this package needs to supply type definitions. Preferably, this would happen by converting to TS and generating from the source; as an alternative, it can publish ambient types (presumably starting with the ones on DefinitelyTyped).
All the members of the Typed Ember team are happy to advise on how to do this; feel free to reach out in #dev-typescript on Discord if you have questions!
The text was updated successfully, but these errors were encountered: