Skip to content

Conversation

@rschristian
Copy link
Member

What kind of change does this PR introduce?

Bugfix

Did you add tests for your changes?

N/A

Summary

Closes preactjs-templates/typescript#69

ForkTsChecker is ran async, and this usually (nearly always in my tests) results in errors/warnings being output before our own done hook. With the console clearing triggering in this hook, this meant errors/warnings from this plugin were hidden from users. They'd have to scroll (and know to scroll) in order to expose them often (again, we've set the reporting to async, so this output could come after, but it seems pretty rare w/ the TS template).

By moving this to the beforeCompile hook, we can ensure this output is not covered up.

beforeCompile seemed like the best fit; it shows the initial webpack dev server info, progress plugin stuff, and even fixes the awkward issue of progress plugin and wds doubling up:

before

 Build  [                 ] 0% (0.0s) compilingℹ 「wds」: Project is running at http://0.0.0.0:3000/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /home/ryun/Projects/foobar/src
ℹ 「wds」: 404s will fallback to /index.html
 Build  [====            ] 25% (0.7s) building

after

ℹ 「wds」: Project is running at http://0.0.0.0:3000/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /home/ryun/Projects/foobar/src
ℹ 「wds」: 404s will fallback to /index.html
 Build  [====            ] 25% (0.7s) building

Anything before done will work just fine though, as that's when ForkTsChecker outputs. Not sure if there's a more idiomatic place for this.

Does this PR introduce a breaking change?

No

@rschristian rschristian requested a review from a team as a code owner January 1, 2022 03:28
@changeset-bot
Copy link

changeset-bot bot commented Jan 1, 2022

🦋 Changeset detected

Latest commit: ac950e2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
preact-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rschristian rschristian changed the title fix: Console is cleared earlier, which stops hiding TS warnings/errors fix: TS warnings/errors hidden by console clearing Jan 1, 2022
@ForsakenHarmony ForsakenHarmony merged commit 00bea83 into master Jan 10, 2022
@ForsakenHarmony ForsakenHarmony deleted the fix/ts-checker-output-emit branch January 10, 2022 11:36
@preact-bot preact-bot mentioned this pull request Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type-checking development server

3 participants