-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
feat: Add DEC mode 2026 support (Synchronized Output) to Jest #15008
Conversation
This commit introduces support for DEC private mode 2026, also known as Synchronized Output, to DefaultReporter. The Synchronized Output mode is a terminal feature that helps mitigate screen tearing effects that can occur when the terminal is rendering output while the application is still writing to the screen. Two new methods have been added to the DefaultReporter: - `__beginSynchronizedUpdate`: This method sends the control sequence to enable Synchronized Output mode to the terminal. - `__endSynchronizedUpdate`: This method sends the control sequence to disable Synchronized Output mode to the terminal. These methods are called before and after the reporter updates the status, respectively. By doing this, we ensure that the terminal renders a consistent state of the screen for each status update, even if we're writing to the screen frequently. Read more: https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036
✅ Deploy Preview for jestjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
ooooh, this is awesome! mind adding a changelog entry? and signing the CLA 🙂
@@ -120,6 +124,26 @@ export default class DefaultReporter extends BaseReporter { | |||
} | |||
} | |||
|
|||
protected __beginSynchronizedUpdate(): void { |
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.
put this in BaseReporter
?
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.
Is it intentional that we check _globalConfig
every time we have a write operation?
I'm waiting on hearing from the legal team at Netflix on how to proceed here. I don't anticipate this taking too long though! Thanks for your patience. |
c8de1b1
to
4cd1df9
Compare
@SimenB CLA Signed! |
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.
awesome stuff, thanks!
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
This PR introduces support for DEC private mode 2026, also known as Synchronized Output, to DefaultReporter. The Synchronized Output mode is a terminal feature that helps mitigate screen tearing effects that can occur when the terminal is rendering output while the application is still writing to the screen.
Two new methods have been added to the DefaultReporter:
__beginSynchronizedUpdate
: This method sends the control sequence to enable Synchronized Output mode to the terminal.__endSynchronizedUpdate
: This method sends the control sequence to disable Synchronized Output mode to the terminal.These methods are called before and after the reporter updates the status, respectively. By doing this, we ensure that the terminal renders a consistent state of the screen for each status update, even if we're writing to the screen frequently.
Read more: https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036
Why / Test plan
Here's Jest output before (notice the flickering):
jest.output.bad.mp4
Here's Jest output after:
jest.output.good.mp4