Comments (2)
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.
from yjs.
@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.
Thanks for all your hard work on this project!!
from yjs.
Related Issues (20)
- How to use YJS in a server written in Java language? HOT 3
- Delta embeds support HOT 2
- Is there a way to actively trigger garbage collection or actively discard some data HOT 1
- Allow subscribing to only updates with a specific origin on doc.on('update', () => {}) HOT 2
- Inconsistency in absolute position index across clients after an undo operation HOT 5
- @kangc/v-md-editor
- UndoManager: Undoing combination of Y.Map#set and deleting that Y.Map from parent Y.Array results in 1 client with invalid Y.Map HOT 4
- yjs v13.6.13 breaks `y-utility/y-multidoc-undomanager` HOT 1
- Cannot undo a change made from y-crdt in Yjs HOT 7
- `y-codemirror.next` stops syncing because `y-indexeddb` throws exception
- RangeError: Maximum call stack size exceeded
- events item order when undo
- Allow obfuscator to be used across multiple updates for the same document
- documentation is incomplete HOT 1
- Inconsistency when creating absolute position from a relative position
- Allow some origins to propagate HOT 1
- 在vue2中引入报错 HOT 2
- Test failed: error TS2694: Namespace ‘LinkifyIt’ has no exported member ‘LinkifyIt’ HOT 3
- `Y.diffUpdate` does not properly diff out deletions (but does diff out insertions) in `Y.Text` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yjs.