-
-
Notifications
You must be signed in to change notification settings - Fork 34
feat: prefer-optional-chaining #484
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
base: main
Are you sure you want to change the base?
feat: prefer-optional-chaining #484
Conversation
… which helps test speed
How to use the Graphite Merge QueueAdd the label 0-merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
| "prefer_optional_chain_options": { | ||
| "type": "object", | ||
| "properties": { | ||
| "allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing": { |
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.
Probably should just skip adding this option, in light of #425
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.
Technically this isn't a deprecated config option so there's maybe an argument for keeping it, but 🤷♂️
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.
yea I guess if its not deprecated then I guess should keep otherwise people who migrate may be confused where it is at IMO
| func CreateCompilerHost(cwd string, fs vfs.FS) compiler.CompilerHost { | ||
| defaultLibraryPath := bundled.LibPath() | ||
| return compiler.NewCompilerHost(cwd, fs, defaultLibraryPath, nil, nil) | ||
| return NewCompilerHost(cwd, fs, defaultLibraryPath, nil, nil) |
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.
Here was the change that helped speed up my test cases a lot IDK if this has any side effects other than AI seeing that typescript go didnt do any caching while our own host did
disclaimer this PR's code was generated entirely using opencode and claude opus 4.5. It has taken a lot of prompting on my end to get it into this state which I believe is a working on. I am not entirely sure how I would be able to test this on my ts codebase. I assume something with pnpm link would be possible?
I had it try look into reasons why my tests were so much slower and it found 1b11bfc to be one of the main reasons since the host in this repo has caching while ts go doesnt to my understanding.
I plan to review this over next week and test it out before I mark this as fully ready for external review but want to get some initial feedback if this was even the right direction / major glaring issues with the AI code.
Pretty excited about the speed increases from this as it is a major pain point in my company's code base and this rule and at least one other prefer nullish coalescing would be ones I wanted added asap so decided to try do it with opencode in my free time
closes #199