-
Notifications
You must be signed in to change notification settings - Fork 310
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
Safe typings for TypeScript v4 #327
Comments
I'm not aware of a way to offer alternate types for older versions of typescript. Unless that is possible, we will just document the dependency on Typescript v5+. |
I can handle this issue if possible |
@amjadorfali We might need to iterate a bit to find the best page to document this requirement, but if you're willing to go through that process, I'm happy to review. |
@nmn I'd be happy to take over this issue. Can you please provide input on the following
I'm new to open source so i'm not sure if i should be answering these questions myself or the core maintainers should. |
@amjadorfali As this is a documentation task, you should read through the documentation and propose answers to those questions yourself.
This is easy to answer. You can probably add an admonition (Wrapped in
I'm not sure. Definitely not the |
I want to take your opinion before implementation. As you mentioned we can write it in Learn/Static types; maybe instead we should write it under the API documentation for this API? An alternative would be to add a header in Learn/Static types specific for Please let me know what you think @nmn P.S: There are many other pages that reference |
Let's start with the API documentation page. |
There is an option to provide alternate types based on TypeScript version - https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#version-selection-with-typesversions |
This looks doable. I'll look into it. |
Would the same typing be possible without that |
It would be, but you'd need to manually add a Could you explain why you can't update Typescript for your project. As I understand, Typescript 5 is more than a year old. |
I have a multiple repo system where I am thinking of migrating to stylex from various different styling solutions across them currently. All of the repos however use Typescript 4.7.3. It's not that I can't update, it's just that it adds some traction. At the end of the day the decision is on the team here if that fix is worth the time. If it isn't then the addition to the docs will at least warn people. |
Is your feature request related to a problem? Please describe.
The problem is the one mentioned in this issue #313, where the TypeScript
const
modifier is used (microsoft/TypeScript#51865) which was introduced in v5 from what I can see.Describe a solution you'd like
Some way to make the types safe for earlier versions of TypeScript
Describe alternatives you've considered
If that is not possible, than atleast some kind of warning somewhere in the docs should be present to indicate the problem
Additional context
The text was updated successfully, but these errors were encountered: