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

Added console clearing with a message to --watch starts #20427

Merged

Conversation

JoshuaKGoldberg
Copy link
Contributor

Followup to #20379.

I advocated against immediately clearing the console when starting --watch in #17756 because it was confusing to have the console suddenly become blank, wait a while, and then give output. After using the feature for a little while, I think it's a little disorienting how the console will only start clearing after the first recompile. This change clears the console and immediately prints a new "Starting compilation in watch mode..." message.

I advocated against immediately clearing the console when starting --watch in microsoft#17756 because it was confusing to have the console suddenly become blank, wait a while, and _then_ give output. After using the feature for a little while, I think it's a little disorienting how the console will only start clearing after the first recompile. This change clears the console and immediately prints a new "Starting compilation in watch mode..." message.
@ghost
Copy link

ghost commented Dec 3, 2017

Build fixed by #20429, please rebase once that's in.

@mhegazy
Copy link
Contributor

mhegazy commented Dec 4, 2017

@sheetalkamat can you please review this change, and merge

@mhegazy
Copy link
Contributor

mhegazy commented Dec 4, 2017

@JoshuaKGoldberg some new CI failures after #20429. can you take a look.

@@ -302,6 +302,10 @@ namespace ts {
// There is no extra check needed since we can just rely on the program to decide emit
const builder = createBuilder({ getCanonicalFileName, computeHash });

if (watchingHost.system.clearScreen) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you create function expression clearScreen when entering this function and use that instead of if checks here and in update program?

const clearScreen = watchingHost.system.clearScreen ? watchingHost.system.clearScreen.bind(watchingHost.system) : noop;

Josh Goldberg added 2 commits December 4, 2017 23:11
@ogvolkov
Copy link

ogvolkov commented Jan 9, 2018

Is it possible to still have the old behavior behind the flag?
We are using TypeScript as a part of the gulp file which also contains other tasks (e.g. minify, watch for style changes etc.), and clearing the screen on recompile eventually erases the history of other tasks completely.

@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants