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

"tsc --watch should clear screen on new compilation" Two: Electric Boogaloo #20389

Merged
merged 5 commits into from
Dec 2, 2017

Conversation

JoshuaKGoldberg
Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg commented Dec 1, 2017

Fixes #20379

Port of #17756 since that hasn't been updated in a few weeks. The first iteration was written by @k0pernikus.

@mhegazy I like how the screen still has the "there's been a recompile" notice up top. Otherwise, for long recompiles, it can get a little confusing when the screen is completely blank for seconds at a time.

Re writing tests - I'm a little lost here. Is there somewhere this kind of test should go?
If it's acceptable to merge this PR without tests (which would be great for using the feature in nightlies!), I'd still be very interested in writing them later.

Todo: look into 2 baseline unit test failures for .d.ts files
Todo: tests, if this doesn't get merged in first (which is fine by me!)

k0pernikus and others added 2 commits August 12, 2017 02:43
* added optional clearScreen method to System]
* implemented via `x1Bc`, reset screen
* fixes 13020
# Conflicts:
#	src/compiler/tsc.ts
@@ -493,6 +493,10 @@ namespace ts {
}

function updateProgram() {
if (sys.clearScreen()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should be if (sys.clearScreen)

Copy link
Contributor

Choose a reason for hiding this comment

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

you should not use sys here. you should use watchingHost.system instead.

@@ -134,6 +134,10 @@ namespace ts {
}

function reportWatchModeWithoutSysSupport() {
if (sys.clearScreen()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

Copy link
Contributor

Choose a reason for hiding this comment

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

I do not see why you need this line here. checking in watch is sufficient.

@mhegazy
Copy link
Contributor

mhegazy commented Dec 1, 2017

you also need to accept the api baselines since you have changed the public API shape.

@mhegazy
Copy link
Contributor

mhegazy commented Dec 1, 2017

For the tests, all the tests for watch are in https://github.com/Microsoft/TypeScript/blob/master/src/harness/unittests/tscWatchMode.ts

@JoshuaKGoldberg
Copy link
Contributor Author

After trying this out locally, I found it disruptive to have the screen immediately clear before the first "compilation succeeded" message. Removing that now and will add it to test cases.

@mhegazy mhegazy merged commit 08c6dc9 into microsoft:master Dec 2, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Dec 2, 2017

thanks @JoshuaKGoldberg for picking this up and driving it through.

@imhoffd
Copy link

imhoffd commented Jan 31, 2018

This is awesome, but really screws with output when multiple tsc invocations are running concurrently (say, in a monorepo setup). I'm not seeing a way to disable it in the code merged from this PR. Should I create an issue?

@JoshuaKGoldberg
Copy link
Contributor Author

@dwieeb see #21295

@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.

None yet

4 participants