You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm sorry that this breaks your existing codebase. However, I don't want to revert to an untyped event system.
There is a big advantage in having typed events.
The only way I see to "fix" this is to allow user-defined events that you can define on Yjs using typescript. E.g. new Y.Doc<{ error: ErrorObject => void }>()
However, I also don't want to do that. There is a good chance that I eventually want to define the "error" event in Yjs. Now, if I allowed custom events, then I would break everyone's codebase whenever I added a new event. This would lock me in, making me unable to add custom events on the data type I maintain, while allowing only users to add new event types.
I also dislike it when it's not clearly defined who owns something (e.g., is the error event fired by you or by me?).
I didn't intend for users of Yjs to fire their own events using the Yjs object. Now, with the type event system it is made clear that this is not possible.
Therefore, I see the burden on you to build your own event system - possibly by wrapping Yjs in a custom datatype. I'm sorry, this is probably not what you wanted to hear.
@dmonad no problem at all, and the direction is understandable. I mainly only pointed it out because it happened in a patch version. Otherwise I wouldn't have.
Describe the bug
https://discuss.yjs.dev/t/breaking-change-introduced-in-v13-6-13/2599
The changes to the Doc Type breaks builds in code which was making use of the ability to create custom events on the doc.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
we are able to create custom events
Screenshots
![image](https://private-user-images.githubusercontent.com/34673206/324198477-804f4546-28ff-4424-be5f-da1cee2fc741.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2MjI3NDgsIm5iZiI6MTcxOTYyMjQ0OCwicGF0aCI6Ii8zNDY3MzIwNi8zMjQxOTg0NzctODA0ZjQ1NDYtMjhmZi00NDI0LWJlNWYtZGExY2VlMmZjNzQxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI5VDAwNTQwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZkNzBkOGE5NGM1N2YyZDc4MDBlZjM5YWQyZjI0NGE5NDQ1Yjc2NDM3NGI5NTI4ZjEyYzA5YmI0OTBiMGYxMWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.IePVy2V5ipcHfWC1met-CiVgWgQHECbGj1-z2u3nzOs)
Environment Information
The text was updated successfully, but these errors were encountered: