feat: Add DEC mode 2026 support (Synchronized Output) to Jest#15008
feat: Add DEC mode 2026 support (Synchronized Output) to Jest#15008SimenB merged 5 commits intojestjs:mainfrom
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. |
SimenB
left a comment
There was a problem hiding this comment.
ooooh, this is awesome! mind adding a changelog entry? and signing the CLA 🙂
| } | ||
| } | ||
|
|
||
| protected __beginSynchronizedUpdate(): void { |
There was a problem hiding this comment.
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! |
|
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