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

Typing is incompatible between patch versions #297

Open
krassowski opened this issue Dec 16, 2024 · 5 comments
Open

Typing is incompatible between patch versions #297

krassowski opened this issue Dec 16, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@krassowski
Copy link
Collaborator

krassowski commented Dec 16, 2024

If one package (say jupyterlab main branch) has version 3.0.0 and another (say jupyter-collaboration) has version 3.0.2 we see:

    ✖  @jupyter/collaborative-drive:build
       src/tokens.ts(35,18): error TS2430: Interface 'ICollaborativeDrive' incorrectly extends interface 'IDrive'.
         The types of 'sharedModelFactory.registerDocumentFactory' are incompatible between these types.
           Types of parameters 'factory' and 'factory' are incompatible.
             Call signature return types 'YDocument<DocumentChange>' and 'YDocument<DocumentChange>' are incompatible.
               The types of 'ydoc' are incompatible between these types.
                 Type 'Doc' is missing the following properties from type 'Doc': isDestroyed, getXmlElement
       src/tokens.ts(47,18): error TS2430: Interface 'ISharedModelFactory' incorrectly extends interface 'ISharedFactory'.

Maybe we should avoid exposing any objects from ydocument.js? Not sure yet.

Edit: To be fair, we also have this issue with react, which is why we are aggressively pinning.

@krassowski krassowski added the bug Something isn't working label Dec 16, 2024
@krassowski
Copy link
Collaborator Author

krassowski commented Dec 16, 2024

Just in case if someone else sees this, the workaround is to add "@jupyter/ydoc": "3.0.0" to resolutions in package.json

@davidbrochart
Copy link
Collaborator

Isn't it because the two @jupyter/ydoc versions are using different versions of yjs?

@davidbrochart
Copy link
Collaborator

In particular:

  • jupyter-ydoc v3.0.2 has yjs v13.5.44.
  • jupyter-collaboration v3.1.0 has yjs v13.6.20.

@krassowski
Copy link
Collaborator Author

Yup. The question is how (if) we can make the developer experience better. If it was in our own code usually the answer is "use an interface which has to remain compatible across minor versions". Since this is in a third-party package, I am not sure if we can do much other than synchronizing versions across our packages more consistently.

@davidbrochart
Copy link
Collaborator

Actually I'm not familiar with how package resolution works in JupyterLab. Isn't there a way to say that yjs must not be bundled with @jupyter/ydoc nor jupyter-collaboration, since it should only be bundled with JupyterLab, so that only one version exists?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants