The Wayback Machine - http://web.archive.org/web/20220708080806/https://github.com/denoland/deno/issues/14858
Skip to content
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

Add watch mode for deno check #14858

Open

bxantus opened this issue Jun 13, 2022 · 6 comments · May be fixed by #14978
Open

Add watch mode for deno check #14858

bxantus opened this issue Jun 13, 2022 · 6 comments · May be fixed by #14978
Labels
--watch feat good first issue help wanted

Comments

@bxantus
Copy link

@bxantus bxantus commented Jun 13, 2022

For me it would make a lot of sense to run check in watch mode.
I think that adding check subcommand was a great idea, and running it in watch mode would provide the best development experience (at least for me). Also if I'm not mistaken it would check further edits faster, as typescript compiler is already warmed up after the first check.

deno check --watch
@bartlomieju bartlomieju added feat --watch labels Jun 13, 2022
@bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Jun 13, 2022

For me it would make a lot of sense to run check in watch mode.
I think that adding check subcommand was a great idea, and running it in watch mode would provide the best development experience (at least for me).

Sure, makes sense; it should be fairly easy to implement.

Also if I'm not mistaken it would check further edits faster, as typescript compiler is already warmed up after the first check.

Not really - to do so, we'd need to rearchitecture the check command for --watch mode - that's because, currently --watch literally restarts the whole subcommand that it's watching - there's no state preserved between the runs. To implement what you're suggesting we'd instead have to keep a TSC isolate running (and to do that we'd probably need to implement a new TS host or reuse one used in the deno lsp). @kitsonk any thoughts on this?

@ChristianSiegert
Copy link

@ChristianSiegert ChristianSiegert commented Jun 18, 2022

@bxantus, does deno run --check --watch do what you want?

@bxantus
Copy link
Author

@bxantus bxantus commented Jun 20, 2022

No, it isn't the same.
Currently I'm using Deno for creating web apps (running in the browser). I find it much easier to use Deno tooling compared to node.js. So deno run would not work in this case. I would like to use deno check --watch like a compiler (the typescript compiler), checking if everything is ok. Then I bundle the scripts using esbuild.

Even if I developed a console app (running it with deno run), using deno check --watch would suit me better. As I want to check my code frequently, but run it only when I'm fully finished with my modifications.
That's why I'm in favor of removing checking by default from run, and using checks mostly while developing.

@bartlomieju bartlomieju added good first issue help wanted labels Jun 20, 2022
@bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Jun 20, 2022

Marked as "good first issue", since the naive approach should be very easy to implement based on existing subcommands with support for --watch.

@VishnuJin
Copy link
Contributor

@VishnuJin VishnuJin commented Jun 20, 2022

@bartlomieju can you please assign this to me? I'll give it a try!

@bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Jun 20, 2022

@bartlomieju can you please assign this to me? I'll give it a try!

I cannot assign you the issue, but feel free to pick it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--watch feat good first issue help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants