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

Add support for async model creation #22

Merged
merged 2 commits into from
Feb 7, 2025
Merged

Add support for async model creation #22

merged 2 commits into from
Feb 7, 2025

Conversation

martinRenou
Copy link
Member

This seems to be a breaking change on the typing (makes TypeScript fail) but it should be fine at runtime 🤷🏽‍♂️

@martinRenou martinRenou added the enhancement New feature or request label Feb 6, 2025
@martinRenou martinRenou marked this pull request as draft February 6, 2025 17:20
@martinRenou martinRenou marked this pull request as ready for review February 6, 2025 17:35
Copy link
Member

@davidbrochart davidbrochart left a comment

Choose a reason for hiding this comment

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

Maybe there could be a new method in JupyterYModel, something like async initialize(commMetadata), that would do nothing by default and that could be overridden in subclasses, that would be executed first. With that, I don't think we would need to change the existing API?

@martinRenou
Copy link
Member Author

Thanks for the comment, indeed, I'll try that

Copy link
Member

@davidbrochart davidbrochart left a comment

Choose a reason for hiding this comment

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

Thanks @martinRenou.
Strictly speaking I think this is still a breaking change, since the ydoc is now created asynchronously, so it will fail if you try to access it before waiting for ready, right?

@martinRenou
Copy link
Member Author

martinRenou commented Feb 7, 2025

Ah indeed, let's make a 0.4.0 just to be sure?

@davidbrochart
Copy link
Member

Yes, merging!

@davidbrochart davidbrochart merged commit 814b213 into main Feb 7, 2025
2 checks passed
@martinRenou martinRenou deleted the async_model branch February 7, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants