GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Allow some per file compiler options by weswigham · Pull Request #49886 · microsoft/TypeScript Conversation
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
TypeScript Bot (@typescript-bot) pack this |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Heya Wesley Wigham (@weswigham), I've started to run the tarball bundle task on this PR at 459196b. You can monitor the build here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
TypeScript Bot (@typescript-bot) pack this now that baselines should be green again :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Heya Wesley Wigham (@weswigham), I've started to run the tarball bundle task on this PR at 97bba40. You can monitor the build here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Is this opt-in only, or will it be possible to opt-out as well? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
You should be able to write things like |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
TypeScript Bot (@typescript-bot) pack this |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Heya Wesley Wigham (@weswigham), I've started to run the tarball bundle task on this PR at ef3813c. You can monitor the build here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Hey Wesley Wigham (@weswigham), I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
WIP 2 Less WIP - Only exactOptionalPropertyTypes and strictNullChecks left Pragmas are case-insensitive Fix harness types Fixup baselines File-local support for exactOptionalPropertyTypes Fix lints Cache getSourceFileOfNode within the checker
ef3813c to
b45165d
Compare
There was an error while loading. Please reload this page.
1be381d to
fe5600e
Compare
|
This should be cleaned up and ready to go, so let's get the bot to do some tests on this iteration (not the much has changed implementation-wise since I ran them on the strict null checks-dedicated draft pr). TypeScript Bot (@typescript-bot) pack this |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Heya Wesley Wigham (@weswigham), I've started to run the extended test suite on this PR at 4bde2e7. You can monitor the build here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Heya Wesley Wigham (@weswigham), I've started to run the perf test suite on this PR at 4bde2e7. You can monitor the build here. Update: The results are in! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Heya Wesley Wigham (@weswigham), I've started to run the abridged perf test suite on this PR at 5b77328. You can monitor the build here. Update: The results are in! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Wesley Wigham (@weswigham) Here they are:Comparison Report - main..49886
System
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi, any updates on this? Now that it is approved, can we expect it to be merged anytime soon? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
TypeScript Bot (@typescript-bot) pack this |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hey Wesley Wigham (@weswigham), if you don't mind, can you please ask the TypeScript Bot (@typescript-bot) to pack this latest iteration? It seems to listen to the PR author. I wanted to try it out in some local project. Thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
TypeScript Bot (@typescript-bot) pack this |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Heya Jake Bailey (@jakebailey), I've started to run the tarball bundle task on this PR at 5b77328. You can monitor the build here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Hey Jake Bailey (@jakebailey), I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks Jake Bailey (@jakebailey)! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
There is only a week before ts 5.0 beta. Maybe this feature will be avaliable after 5.1 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I'm seeing these kinds of errors despite turning off the check. Is this expected? Ideally it should not be imo as turning off SNC from tsconfig would not generate this error. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I was writing up a much longer background for this, but I’m exhausted on Saturday, and don’t want to lose the context before I bail. I’m happy to come back and fill in details of why I’m asking if it seems really bonkers to ask. Is there any possibility this could allow specifying:
The use case prompting me to ask involves using Playwright as a library, and would incredibly simplify its usage (and type safety) for a single function proxy as I transition a library from dependence on Node APIs and native dependencies to be usable in browser. It’s definitely not a common use case, but I can imagine others which might benefit from specifying a given callback is being shuttled off to be executed in an entirely different environment. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hey all, the future of this feature is somewhat uncertain. Any time the type system has to make a decision based on strictness, it now has to walk up to the top of the file and check for strictness directives. If not that, every node (or almost every node) of our syntax trees has to get a little bit bigger to hold onto that information. This has a type-checking performance impact that is higher than we can accept. There might be some optimizations we can make for the more common case of no file-specific options within a project, but that leads to some unpredictable performance cliffs as soon as one is added. So this won't make its way into TypeScript 5.0, and it's unclear if we'll be able to bring it in in the future either. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Can this option be not added as an opt in? like an option in I came across this issue searching for a way to enable incremental strict checks on a 50k+ line codebase on which enabling strict checks throws up 3k+ errors 🙈 while i understand plugins exist for this having this on a compiler level can be so much better! I know no nothing about typescripts development process/priorities so if anything i said here is wrong/doesnt make sense I apologise but I sincerely hope you consider the request! Thank you to the author and typescript team for their time and effort on this! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Wesley Wigham (@weswigham) is this worth keeping open? Is it worth revisiting in Go? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Please consider adding this as an opt in option like Debadree Chatterjee (@debadree25) mentioned. Also im not sure that compiler performance is something that should be optimised for and chosen above this feature, considering the whole point of TS is to optimise for safely typed code? and especially considering the recent improvements after migration to go. Also, surely you just do a single pass of all the files and store their strictness directives in a hashmap?? so that you dont walk the tree on every single check? Id pay the one time incremental reduction in compilation time any day over having to live with strictNullChecks: false in the project forever. as it stands, migrating from non-strict to strict compilations is not a feasible task within a large active project with competing priorities. The rate of new work being developed by many developers with non-strict ts config, is greater than the amount of files that can be incrementally refactored to strict-checks by whatever developer is spearheading the operation. having the ability to enforce // Strict TypeScript (@ts-strict) at the top of any new file commits would go a long way in making a migration like this feasible |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
With 6.0 out as the final release vehicle for this codebase, we're closing all PRs that don't fit the merge criteria for post-6.0 patches. If you think this was a mistake and this PR fits the post-6.0 patch criteria, please post to the 6.0 iteration issue with details (specifically, which PR and which patch criteria it satisfies). Next steps for PRs:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
allow per file compilerOptions
There was an error while loading. Please reload this page.