Skip to content

Conversation

@Leilei332
Copy link
Contributor

Important

This PR is not backward compatible due to API changes

The original diff-match-patch repository is now archived. This PR migrates it to diff-match-patch-es which is more modern and uses pure functions instead of one object.

@netlify
Copy link

netlify bot commented Dec 20, 2025

Deploy Preview for tiddlywiki-previews ready!

Name Link
🔨 Latest commit 31ce323
🔍 Latest deploy log https://app.netlify.com/projects/tiddlywiki-previews/deploys/694fdca8be18c40008a3808e
😎 Deploy Preview https://deploy-preview-9511--tiddlywiki-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link

Confirmed: Leilei332 has already signed the Contributor License Agreement (see contributing.md)

@github-actions
Copy link

github-actions bot commented Dec 20, 2025

📊 Build Size Comparison: empty.html

Branch Size
Base (master) 2450.1 KB
PR 2448.2 KB

Diff: ⬇️ Decrease: 1.9 KB


✅ Change Note Status

All change notes are properly formatted and validated!

⚠️ Impact: $:/changenotes/5.4.0/#9511/impacts/api

Impact Type: compatibility-break
Related Change: $:/changenotes/5.4.0/#9511

The diff-match-patch-es library uses different APIs


📝 $:/changenotes/5.4.0/#9511

Type: enhancement | Category: developer
Release: 5.4.0

Migrate diff-match-patch library to diff-match-patch-es

🔗 #9511

👥 Contributors: Leilei332


📖 Change Note Guidelines

Change notes help track and communicate changes effectively. See the full documentation for details.

@pmario
Copy link
Member

pmario commented Dec 20, 2025

Do we have tests for diff-match-patch?

@pmario pmario added the needswork PR that cannot yet be merged; Issue that is "almost" actionable label Dec 20, 2025
@Leilei332
Copy link
Contributor Author

Do we have tests for diff-match-patch?

The original respository does have tests. IMO it's up to the library author to test the library. For tiddlywiki, we may add tests for diff-text widget and some operators using this library.

@pmario
Copy link
Member

pmario commented Dec 20, 2025

The current preview https://tiddlywiki.com/prerelease/#DiffTextWidget
behaves different than the new library here in the PR. So there seems to be a difference, that breaks the diffText widget. See the second example with the slider. It seems not to work with this PR

@pmario
Copy link
Member

pmario commented Dec 20, 2025

There is the https://deploy-preview-9511--tiddlywiki-previews.netlify.app/#makepatches%20and%20applypatches%20Operator%20(Examples) tiddler. If we could convert the examples to testcase widgets at tw-com, they will be picked up by our test runner.

So we can have both. New test, that also work as documentation.

@Leilei332
Copy link
Contributor Author

Looks like we already have tests for diff-match-patch operators in test-filters.js:

图片

@Jermolene
Copy link
Member

Thank you @Leilei332. I think that this is a worthwhile change. It's hard to assess the backwards compatibility impact, but any errors it raises should be simple to diagnose. Having said that it would be helpful if we had an automated way to scan publicly published plugins.

@Jermolene Jermolene merged commit c690612 into TiddlyWiki:master Jan 4, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needswork PR that cannot yet be merged; Issue that is "almost" actionable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants