Skip to content
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

SF-3136 Upgrade to Quill v2 #2925

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

siltomato
Copy link
Collaborator

@siltomato siltomato commented Dec 22, 2024

https://slab.com/blog/announcing-quill-2-0/
https://github.com/slab/quill/releases/tag/v2.0.0

Quill v1.3.7 (our current version) was released in September 2019, and it appears that all ongoing work, including bug fixes, is in the v2 branch.


This change is Reviewable

@siltomato siltomato added the will require testing PR should not be merged until testers confirm testing is complete label Dec 22, 2024
@siltomato siltomato force-pushed the feature/sf-3136-quill-v2-upgrade branch from 0bf4e22 to 304001a Compare December 22, 2024 22:58
Copy link

codecov bot commented Dec 22, 2024

Codecov Report

Attention: Patch coverage is 86.22754% with 23 lines in your changes missing coverage. Please review.

Project coverage is 80.89%. Comparing base (1bca82f) to head (b511e1e).

Files with missing lines Patch % Lines
...e/ClientApp/src/app/shared/text/quill-scripture.ts 84.90% 7 Missing and 1 partial ⚠️
...e/ClientApp/src/app/shared/text/text-view-model.ts 80.00% 5 Missing and 2 partials ⚠️
...cripture/ClientApp/src/app/core/models/text-doc.ts 20.00% 4 Missing ⚠️
...re/ClientApp/src/app/shared/text/text.component.ts 94.59% 0 Missing and 2 partials ⚠️
...late/editor/editor-draft/editor-draft.component.ts 0.00% 0 Missing and 1 partial ⚠️
...ntApp/src/app/translate/editor/editor.component.ts 94.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2925      +/-   ##
==========================================
- Coverage   80.91%   80.89%   -0.03%     
==========================================
  Files         533      533              
  Lines       31224    31226       +2     
  Branches     5085     5068      -17     
==========================================
- Hits        25265    25259       -6     
- Misses       5198     5218      +20     
+ Partials      761      749      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@josephmyers josephmyers self-assigned this Dec 23, 2024
Copy link
Collaborator

@josephmyers josephmyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been playing around with this for the past hour or so, and I haven't seen any bugs with the upgrade, not even the highlight on restore bug I just fixed. And the code changes are much, much cleaner than I was expecting. Good job!

Reviewed 36 of 36 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @siltomato)


src/SIL.XForge.Scripture/ClientApp/src/app/shared/text/quill-scripture.ts line 729 at r1 (raw file):

        this.quill.scrollingContainer.scrollTop = scrollTop;
        this.quill.focus();
      }, 1);

This appears to still work as before, without all this extra code. Good job simplifying!


src/SIL.XForge.Scripture/ClientApp/src/app/shared/text/quill-scripture.ts line 39 at r1 (raw file):

    if (typeof op.retain.length === 'number') {
      return op.retain.length;

I'm not seeing any mention of the .length format in their docs, though that may not mean much. It's all { retain: 5 }. Did they add this as a new possibility? How do I get here with a breakpoint?

Copy link
Collaborator Author

@siltomato siltomato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, hopefully it'll be a smooth upgrade.

Reviewable status: 35 of 36 files reviewed, 1 unresolved discussion (waiting on @josephmyers)


src/SIL.XForge.Scripture/ClientApp/src/app/shared/text/quill-scripture.ts line 39 at r1 (raw file):

Previously, josephmyers wrote…

I'm not seeing any mention of the .length format in their docs, though that may not mean much. It's all { retain: 5 }. Did they add this as a new possibility? How do I get here with a breakpoint?

Good catch. The typescript def for Op threw me off, and I hallucinated a length prop from looking at the docs.

Changed to throw an error if the type of retain is not a number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
will require testing PR should not be merged until testers confirm testing is complete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants