question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CRUD via block ID

See original GitHub issue

Hi,

First of all, I’d like to thank you for creating such a fantastic tool. It has been the core of my bachelor’s degree, and I’m profoundly thankful for that. Currently, I’ve decided to combine CRDT (YJs) with editor.js as my degree thesis, but I’m facing some blockers now.

As the title suggests, I’m interested in having the opportunity to perform CRUD operations based on ID. This is vital, as the ID is the key in the YMap data structure shared across various clients. So, on the update triggered remotely, I have to propagate this update to the editor.js instance and, specifically, swap the block content. This is not possible with the current Core API (Blocks manipulation). It exposes only the getById() [#1667]. I reckon this might be in the nearest roadmap, as the creation, update, and deletion via ID will be the right step towards concurrent editing. Please let me know if this is feasible in the nearest future; I’m currently blocked, and I might have to consider alternatives.

By briefly analysing the codebase, most of the logic already has been implemented, and the Blocks Core API lacks the BlockManager.insert() invocation with id (and replace boolean - ideally used to signify replacement by id and not by index) - for the creation (and update).

Alternatively, as I’m facing time constraints, maybe you could recognise a different (faster) approach, as my thesis is the POC, and time is of significant importance to me. Any ideas would be welcome.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ChasLuicommented, May 23, 2021

Thanks, @ChasLui and @neSpecc, for providing more context. I have been considering ProseMirror as an alternative, and comment from @ChasLui only cemented my decision.

Unfortunately, even after implementing other methods, I’d still need to take care of cursors, which seems to require more effort than implementing methods that use block ID. I wish I could pick this ticket, but I’ve got only a few weeks left. Consequently, I won’t be of any help in the nearest future.

We have implemented our own selection-based collaborative cursor, but we have also modified a lot of editorjs source code, making it impossible to merge the latest version of editorjs. image

0reactions
wmoneckecommented, Jul 31, 2021

@ChasLui Hi there! Would you share your fork of editor.js with collaboration support?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is CRUD? - Codecademy
Create, Read, Update, and Delete (CRUD) are the four basic functions that ... Additionally, the new entry is assigned a unique id ,...
Read more >
What Is CRUD? Create, Read, Update, and Delete | CrowdStrike
CRUD stands for CREATE, READ, UPDATE, and DELETE. These terms describe the four essential operations for creating and managing persistent ...
Read more >
Provide CRUD (Create, Read, Update, Delete) Data Form ...
This method will be invoked when the /Dinners/Edit/[id] URL is requested. ... It then renders a View template using the Dinner object.
Read more >
CRUD (Reference) - Prisma
The user's id is auto-generated, and your schema determines which fields are mandatory. Create a single record using generated types. The following example ......
Read more >
CrudRepository (Spring Data Core 3.0.0 API)
Interface CrudRepository<T,ID> ... Interface for generic CRUD operations on a repository for a specific type. Author: Oliver Gierke, Eberhard Wolff, Jens Schauder ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found