-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(website): update hash value if problem occurs due to ts version error #11292
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?
fix(website): update hash value if problem occurs due to ts version error #11292
Conversation
Thanks for the PR, @developer-bandi! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
View your CI Pipeline Execution ↗ for commit 95ba0c0.
☁️ Nx Cloud last updated this comment at |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #11292 +/- ##
==========================================
- Coverage 90.91% 90.85% -0.06%
==========================================
Files 501 501
Lines 50869 50901 +32
Branches 8382 8383 +1
==========================================
Hits 46248 46248
- Misses 4606 4638 +32
Partials 15 15
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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.
A good start, thanks for getting it started! I left some refactor changes to make the code a bit more precise.
@@ -140,6 +141,12 @@ export const useSandboxServices = ( | |||
}) | |||
.catch((err: unknown) => { | |||
if (err instanceof Error) { | |||
if ( | |||
err.message === | |||
'Could not get all the dependencies of sandbox set up!' |
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.
[Refactor] A couple issues with the implementation as-is:
- I had to do a find-all to see where this magic string came from. -1 from me on using magic: https://softwareengineering.stackexchange.com/questions/365339/what-is-wrong-with-magic-strings
- I also think that continuing to use
catch
/reject
as a form of control flow is not ideal here. Especially now that we know there's a real case to be handled with an "error" state. https://www.joshuakgoldberg.com/blog/try-catch-as-little-as-possible
But, stepping back, I think this is too wide of a check. Any error rejection from loadSandbox
will run props.setState({ ts: process.env.TS_VERSION });
Even if it wasn't a TS version error in the first place!
Requesting changes:
- The reset of
ts
state should only happen if:
a. The existingts
version is an unsupported one
b. The failure is specifically for thevs/editor/editor.main
- Switch the return type of
loadSandbox
to be something like a discriminated union, so the failure state is captured in the type system
PR Checklist
Overview
If an error occurs due to the ts version, hash's ts is modified to load the latest version.