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
Add a plugin to be able to swap the doc provider #10256
Conversation
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
Rebased to grab #10258, so this PR can be tested on Binder with RTC enabled. |
@jtpio quick feedbacks
|
Yes, it's still one of the remaining TODO items listed in #10256 (comment). This was also discussed yesterday during the RTC call (https://hackmd.io/UbnBH58hS8itoWgfiWT77A) and the conclusion was that it would indeed make sense to have a I can update this PR to add it. |
Not sure yet. But probably something to think about as a follow-up? |
Great!
Looking more at the constructs, the Context is created by the docmanager which is injected with the correct IDocumentProviderFactory, so having an docregistry-extension does not make sense for that case. Another enhancement would be to make the docregister/context a bit more agnostic, so not having to depend directly on the yjs library, so not having to maintain those 2 fields private _ydoc: Y.Doc;
private _ycontext: Y.Map<string>; |
The |
Added the Some CI checks will fail until the package is published to |
I have quickly scanned the diff and it LGTM. Do you have more to add before I review? |
Thanks. I think it should be ready to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed and tested. LGTM. Let's wait 2 days before merging to get any further comment.
Thanks @echarles. A follow-up to this PR would be to publish the new |
Releasing now |
Thx @jtpio and @blink1073 |
* Add plugin to create an IProviderFactory * Fix typo in tsconfig.json * Fix plugin id * Lint * Rename IProvider to IDocumentProvider * Read PageConfig collaborative from the plugin * Integrity * Provider URL is specific to websocket * Consistent WebSocket spelling * Add docprovider-extension package * Remove schemaDir * Remove TODO * Update sideEffects * Update plugin id * Add docprovider-extension to SKIP_CSS * Add docstrings * More docstrings
References
Fixes #10252
Early draft for what it would look like to have a plugin that can be used to set custom providers.
TODO
IProvider
toIDocumentProvider
IDocumentProvider
interfacedocprovider-extension
package?Code changes
Move the creation of the provider in the document context to a plugin, which can then be disabled or replaced in other lab extensions and distributions.
User-facing changes
None
Backwards-incompatible changes
Add an optional parameter to some of the instantiation options.