-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Watcher improvements #4509
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
Watcher improvements #4509
Conversation
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 seems to help non-generic functions like Object.entries
play nice with the type signature.
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 helps quite a bit when dealing with the extension compilation which is often quite verbose and inactionable.
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.
Yes! Basically this hides it unless --log
is passed when starting yarn watch
? Fantastic DX improvement 🔥
✨ Coder.com for PR #4509 deployed! It will be updated on every commit.
- Host: https://codercom-mfswq7vok-codercom.vercel.app/docs/code-server
- Last deploy status: success
- Commit: 4b38316
- Workflow status: https://github.com/cdr/code-server/actions/runs/1482624851
58f1c54
to
e969ebb
Compare
Codecov Report
@@ Coverage Diff @@ ## main #4509 +/- ## ========================================== - Coverage 66.03% 65.44% -0.60% ========================================== Files 30 30 Lines 1640 1658 +18 Branches 330 333 +3 ========================================== + Hits 1083 1085 +2 - Misses 474 487 +13 - Partials 83 86 +3
Continue to review full report at Codecov.
|
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 couple nits/questions but I feel like this is mostly good to go! 🔥
This is WAY easier to read by the way - bravo 👏
(when I first joined the team, I didn't really understand how this watcher worked. Now I feel like I do!)
Not sure if @code-asher wants to give the final approval but otherwise, I feel like we can get this in today)
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.
nit: since we moved vscodeSourcePath
any reason not to move rootPath
as well? That way paths
has all paths.
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.
Unfortunately JS doesn’t let you reference earlier object properties while still defining entries.
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.
Ahhhh got it! Disregard 👍
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.
👏 for comments
ci/dev/watch.ts
Outdated
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.
TIL about fork
.
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.
❓ Basically this reloadWebServer
kills the webServer
if it exists, forks the process (not sure what process.argv.slice(2)
is here? (might be nice to name it or add a comment?) and starts up a new child process, logging a message to let us know it started
(and also adding a log for when the process exits)
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.
process.argv.slice(2)
is a bit of a node convention. Since this array contains all the CLI arguments, the first two entries are usually the node runtime and the script name, e.g. node entry.js
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.
TIL! Thanks for the explainer!
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 like this pattern you've started introducing 👏 Does it have a name? Comment regions?
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 wish I could take credit for it but it’s built into VS Code’s region collapsing.
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.
Yes! Basically this hides it unless --log
is passed when starting yarn watch
? Fantastic DX improvement 🔥
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 section looks a lot cleaner 🔥
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.
🔥🔥 love the emojis in the logs :D
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.
nit: should this be a devDependency
?
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.
Already is 😄
Screen Shot 2021年11月19日 at 11 32 34
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.
LOL does this mean my eyesight is going? Apologies!
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.
👏 appreciate the type extraction and naming to make it easier to read/maintain
- Clean up watcher behaviors.
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.
Woohoo!
codecov/project — 65.44% (-0.60%) compared to dd29a82
It's less than a %. I think it's okay for us to ignore this
11fc940
to
f47abdf
Compare
This PR addresses feedback listed in #4499 (comment)
Previously, attempting to load VS Code before the compiler all files resulted in some cryptic errors. Our file watcher now detects when VS Code has truly finished compiling and appends a file our server can check for during development.