Resolve source changes without losing sight of the finished module
JavaScript files often collect overlapping edits: one copy changes imports, another fixes a condition, and both touch the same function. A raw side-by-side diff exposes the edits but can leave the final assembly to manual copy and paste. MergeGlass adds a resolution step and a live combined preview so each choice contributes directly to the candidate output.
Syntax-aware coloring helps distinguish keywords, strings, numbers, and comments, while word-level highlights narrow attention inside changed lines. You can switch to three-way mode and provide a common base when the two versions came from the same earlier file. That gives the merge engine more information about which edits happened independently.
MergeGlass does not execute JavaScript. It cannot identify a missing import at runtime, infer which API contract is current, or guarantee that choosing both blocks creates valid syntax. The final file still belongs in your normal formatter, linter, typechecker, test suite, and review process.
Review JavaScript changes with fewer surprises
Start at imports and exports
Resolve module boundaries first. A later function may rely on a renamed import or a changed export shape.
Watch delimiter ownership
When keeping both blocks, inspect commas, braces, parentheses, and semicolons around their boundary.
Keep comments with code
A comment may describe only one version of an implementation. Make sure it remains accurate after the merge.
Use the project toolchain
Run Prettier or the project formatter, ESLint, TypeScript where applicable, and the relevant tests after export.
A repeatable four-step workflow
- Load the two modulesSource A and B may be branches, backups, or generated alternatives. Use Text mode for JavaScript.
- Add a common base when availableThree-way mode is valuable when both copies descend from a known earlier version.
- Resolve by responsibilityConsider what each changed block does, not only how the tokens differ. Keep both when edits are independent and compatible.
- Format and testDownload the candidate, place it in the project, and let automated checks expose syntax, type, and behavior problems.
Important limits
- Minified bundles are poor merge inputs; compare source files instead.
- Generated files should usually be regenerated from their source of truth.
- A clean textual merge can still introduce a behavioral regression.