Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Prefer rolling index over random key generation. Prefix editor key with #582

Closed

Conversation

khankuan
Copy link

@khankuan khankuan commented Aug 6, 2016

Summary

Ref: #385

The current key generation method prohibits server-side rendering to have the same checksum when the editor is re-rendered on client side. The solution here is to keep editorKey in editorState so that developers have some control to retain the same editor key by sending the serialized editorState to client side.

There is also a performance concern on the current method to generate random keys. The method allows up to 2^24 keys in the seenKeys map. During generation, the method retries if a key previously used is generated again. This causes the process to retry more often as more keys get generated (evenly freezing) and would be a huge concern on server side rendering. The proposed method is to use a non-random but incrementing variable.

@khankuan
Copy link
Author

khankuan commented Sep 8, 2016

@hellendag would be great to get comments on the PR :)

@ghost ghost added the CLA Signed label Sep 8, 2016
@khankuan
Copy link
Author

The PR might still be buggy for SSR so i'm dropping it first. Will look deeper into usage of random keys.

@khankuan khankuan closed this Sep 23, 2016
@ghost ghost added the CLA Signed label Sep 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant