-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Unique ids in blocks with nanoid #1667
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change log should be added
…id, add changelog and some documentation Also improved some documentation along the lines and fixed linting
@gohabereg @neSpecc I'll be mostly unavailable to work on this PR for the next couple days, don't hesitate to push more improvements until it's mergeable. If I see more review comments I'll try my best to make the fixes quickly still but I'll try to take the weekend off. |
it('should preserve passed ids', () => { | ||
const blocks = [ | ||
{ | ||
id: nanoid(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use nanoid (10)
. What should happen when user pass id
not in an our format? We should show error or preserve them? I think, we need to add a test for that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. User can use any format for ids on the backend side, even just numbers. We should just preserve everything user passes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was a question.
I tested manually a bit and it works nicely with some limitations (Yes the text is gibberish)

What works
What does not