Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
process: add
process.features.typescript
#54295process: add
process.features.typescript
#54295Changes from all commits
3317be7
74a8769
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This needs to emit experimental warning.
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.
I disagree, we should not discourage feature detection, that'd just nudge folks into either disabling warnings and/or find another way for detecting typescript support.
Also, I don't think this should be a getter, there's nothing dynamic about it.
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.
If we don't emit experimental warning here, and mark this as experimental, how can we remove this API if the
--experimental-typescript-*
flags are removed?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.
Anything documented as experimental can be deleted at any time – and folks should write their code in a way that it still works whether
process.features.typescript
isfalse
andundefined
(they have to if they want their code to work on older release lines anyway), so removing it is unlikely to cause breakage. (If it is not documented as experimental or graduated to stable, it would need to go through a full deprecation cycle, or stay there forever, with a value offalse
always)I expect lots of folks to prefer not use an API that may emit a warning (because users don't like them), so they would have to find another way to detect "TS" support, so what's the point of adding this in the first place if we don't want folks to use it?
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.
I agree with @aduh95 , if typescript is enabled, it will emit the warning regardless, if typescript is disabled, it returns false. Even if it does not emit the warning we can remove it. I dont see something that will be hard to remove since it returns a falsy value anyways. And having a warning in application that are not currently using ts feels like would impact adoption.
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.
Got it. I'll remove the emitted warning when I get a chance.
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.
Please don't resolve a review that isn't addressed. @RedYetiDev.
I recommend looking into this once again @marco-ippolito @aduh95. If you insist, I'll remove my block but this is an experimental feature that we should emit experimental warning for (according to documentation)
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.
My apologies, I assumed this was resolved given the opposing opinions
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.
I insist, I’m -1 on landing this with a runtime warning. I’d recommend using stability 1 Experimental and not stability 1.0 nonsense if that’s where the point of contention lies.
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.
I marked it with the same stability that type strip support is labeled under, but I can change it