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

Improve types for Y.Map's public interface #614

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Smona
Copy link

@Smona Smona commented Feb 25, 2024

@Smona Smona changed the title Improve types for map public interface Improve types for Y.Map's public interface Feb 25, 2024
@@ -74,7 +99,7 @@ export class YMap extends AbstractType {
*/
_integrate (y, item) {
super._integrate(y, item)
;/** @type {Map<string, any>} */ (this._prelimContent).forEach((value, key) => {
this._prelimContent?.forEach((value, key) => {
Copy link
Author

Choose a reason for hiding this comment

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

note this logic change, but if _prelimContent was null previously then this would have created a runtime error.

@dmonad
Copy link
Member

dmonad commented Feb 25, 2024

Thanks for the PR!

This is on the roadmap for v14, as it is a breaking change.

However, this feature is not "enough" for a new v14 release. I don't want to create too many releases for Yjs.

I'll keep this PR around for now.

Note: I dislike the .ts file (this could be done in JavaScript and included in the tests).

@Smona
Copy link
Author

Smona commented Feb 25, 2024

Feel free to point me towards the v14 roadmap (couldn't find it with a cursory search) -- I'd be happy to assist with any other (potentially breaking) type improvements you would like to include. These are just the main type issues I'm aware of.

In the meantime, I'll try to get the TS file migrated to JS and included in npm run lint so this is ready when you are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants