-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Provide a back-compat mechanism for bundled .d.ts files in package.json #22605
Comments
|
I would expect these files to be either hand-created, or generated through some downleveling process. The model for DT doesn't apply here since people may need e.g. the runtime v12 of a library for bugfix/feature reasons but not be able to consume type syntax from that version |
A few comments:
|
cc: @DanielRosenwasser since we were discussing this feature this morning. |
I put together a proposal that is very similar to this, which also addresses my earlier comments. The key differences are:
I also describe a proposed structure for DefinitelyTyped packages that could be used by |
I would also like to add that this would address a number of issues:
|
@RyanCavanaugh Seeing this I have an idea, I want to add the different language comment version in |
People are always excited to use new type system features in their programs or definition files.
However, if these developers are shipping a library with bundled type definitions, they can't use these features in an exposed way unless they are willing to force all TS consumers of the library to upgrade to a matching compiler version.
This leads to awkward trade-offs and end-user confusion when they upgrade eventually does happen.
There should be some way for library authors to say "Use this .d.ts file if you're on this version of TypeScript" so they can provide back-compat ranges. This could be based on semver ranges provided in
package.json
:The text was updated successfully, but these errors were encountered: