Closed WilliamIPark closed 1 month ago
Latest commit: 8614cbb2d0b12e021bd4c755dc95e1e51e2f28b7
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Name | Link |
---|---|
Latest commit | 8614cbb2d0b12e021bd4c755dc95e1e51e2f28b7 |
Latest deploy log | https://app.netlify.com/sites/tiptap-embed/deploys/66e9475f6ae18800081117ce |
Deploy Preview | https://deploy-preview-5623--tiptap-embed.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
As mentioned in the comment, this has to go towards a new major version so this PR is going to sit for a while
Yep sounds good :) Just wanted to make sure it wasn't left behind when that time comes!
Changes Overview
The type for
getPos
inside ofNodeViewRendererProps
was incorrectly typed to indicate that it always returns a number, when this is not the actual case. It can also returnundefined
.As per the ProseMirror documentation:
Trusting this function to always return a number has lead to some stability issues in our application, so I believe it's best that the type reflects the actual functionality, even if this may cause some headaches to handle
undefined
cases.Implementation Approach
Update the type to point towards
Parameters<NodeViewConstructor>[2]
, which I believe inherits offpm/view
.Testing Done
Verification Steps
getPos
inside of aNodeView
.Additional Notes
I'd consider this a breaking change, as it could flare up people's type checks if they're not handling the possibility of the return value being
undefined
, so I have marked it as needing a major version bump in the changeset.Checklist
Related Issues
https://github.com/ueberdosis/tiptap/issues/3823