Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Restores and propagates the maxLineDiffLength render option through the worker-pool and renderer pipeline so inline per-line diff decorations aren’t computed for extremely long changed lines (improving performance and avoiding regressions introduced by recent virtualization/worker changes).
Changes:
- Plumbs
maxLineDiffLengththroughRenderDiffOptionsand worker rendering options (with default1000). - Enforces a length guard in
renderDiffWithHighlighterto skip inline line-diff computation when either side exceedsmaxLineDiffLength. - Centralizes render-option equality (including
maxLineDiffLength) viaareDiffRenderOptionsEqualand uses it for cache validation.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/diffs/src/worker/worker.ts | Adds maxLineDiffLength to worker default render options. |
| packages/diffs/src/worker/types.ts | Extends WorkerRenderingOptions with maxLineDiffLength. |
| packages/diffs/src/worker/WorkerPoolManager.ts | Ensures maxLineDiffLength is included in pool render options and option-change detection. |
| packages/diffs/src/utils/renderDiffWithHighlighter.ts | Skips inline line-diff decoration computation for very long changed lines using maxLineDiffLength. |
| packages/diffs/src/utils/areDiffRenderOptionsEqual.ts | New helper to compare diff render options, including maxLineDiffLength. |
| packages/diffs/src/types.ts | Adds maxLineDiffLength to RenderDiffOptions. |
| packages/diffs/src/renderers/DiffHunksRenderer.ts | Uses areDiffRenderOptionsEqual and includes maxLineDiffLength in computed render options. |
| packages/diffs/src/index.ts | Exports areDiffRenderOptionsEqual. |
| apps/docs/app/docs/WorkerPool/constants.ts | Documents maxLineDiffLength as an optional WorkerPool render option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a bunch of recent virtualization/worker pool logic, we ended up not passing this option through properly, causing diffs to be computed on extremely large lines, which isn't great.
Anyways, this brings back the check.