Discussions related to Shared Editing, Distributed Apps, and Yjs. Questions about Yjs should go to discuss.yjs.dev. Bug reports to the issue tracker.
TypeError: Cannot read property 'encrypt' of undefined
Module.encrypt
49 | return /** @type {PromiseLike<Uint8Array>} */ (promise.resolve(data))
50 | }
51 | const iv = crypto.getRandomValues(new Uint8Array(12))
> 52 | return crypto.subtle.encrypt(
| ^ 53 | {
54 | name: 'AES-GCM',
55 | iv
Hey @cbenz_gitlab,
that's really funny and is actually what I thought when I started the project. I was a huge fan of Haskell, but that's pretty useless if you want to create collaborative applications. But why did it have to be JavaScript?? WHYYY JS!!
Now I really like JavaScript. It's a really fun language.
The actual reason is that I named the underlying CRDT algorithm YATA - Yet Another Transformation Approach. So Yjs is the js implementation of the Y(ATA) CRDT. Also, the Y kinda looks like two branches merging, which is what Yjs does. So when I name a variable ytext or ymodel, I immediately know that the data is observable and automatically merges with other peers :)
am I the only one facing this issue after updating y-webrtc?
TypeError: Cannot read property 'encrypt' of undefined Module.encrypt 49 | return /** @type {PromiseLike<Uint8Array>} */ (promise.resolve(data)) 50 | } 51 | const iv = crypto.getRandomValues(new Uint8Array(12)) > 52 | return crypto.subtle.encrypt( | ^ 53 | { 54 | name: 'AES-GCM', 55 | iv
[encrypt] this library only work for https
Hi All, I'm working with y-websocket right now, and i'm wondering if anyone has experience adding messages to the server. I want clients to be aware when someone adds another "room", so that an added room gets added to other connected clients. Initially I thought i could just use the same WebsocketProvider to wrap the other providers to sync the client state using custom message types. I've gotten started but i keep running into issues with the persistence layer and i feel stuck. Any ideas?
The issue is if i just send a regular message like Websocket.send("stateUpdate") the server crashes with an Index out of bounds error.
Y.Map
and have set up a Y.UndoManager
to track updates to it. I now make a series of, for instance, 20 adds, deletes and updates to the Y.Map
. Then I decide that I want to undo these most of these changes, back to, say, the 3rd change. I could do this by calling undoManager.undo
17 times, but is there any way to revert straight to the 3rd change (e.g. by saving a pointer to the undoManager
state before each change)? The use case is that I want to give the user a menu of the last n
changes, so that the user can revert straight back to a previous state, without having to unwind each action one at a time.
@micrology Sorry, i forgot to answer you. That would be possible. The UndoManager has a undo&redo stack that contains operations that already represent a range of changes (by default capturing all changes within 500ms, with a debounce after each change so that the "recording" stops when you stop typing). You could add a functionality to merge the operations and then hit undo once. You could also open a single transaction and undo 17-times using a helper method.
@TeemuKoivisto I think you are asking whether it is possible to rewind specific operations - that also should be possible. You need to find the right operation, move it to the top of the stack and then undo that.
The yjs.dev website contains a Google-Docs like track-changes feature for the Prosemirror editor. It is incomplete and I want to do a rewrite of the functionality. But even in the current state, it works really well. The downside is that it uses more memory than it should, which is the reason for the rewrite. But unless you are writing a book, you should be fine.
Hi, I'm working to adapt a y-prosemirror with the new version of tui.editor. Is it possible to rebuild ydoc('prosemirror') before the editor view ?
I have always this stacktrace :
n._item is null
absolutePositionToRelativePosition lib.js:96
getRelativeSelection sync-plugin.js:172
beforeAllTransactions sync-plugin.js:206
emit observable.js:73
emit observable.js:73
transact Transaction.js:386
toDelta YText.js:981
I had try to do after it's working but after init, the view isn't sync with the ydoc.