Skip to content
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

RichText: completely controlled #14641

Closed
wants to merge 5 commits into from
Closed

Conversation

ellatrix
Copy link
Member

@ellatrix ellatrix commented Mar 26, 2019

Description

Splitting this out from #14640.

This makes RichText a completely controlled component: changes in props or state are always reconciled with the DOM.

This eliminates a lot of logic trying to figure out of the DOM should be reconciled or not. It's easier to just do it: the DOM won't be touched if no changes need to be made.

How has this been tested?

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@ellatrix ellatrix added [Status] In Progress Tracking issues with work in progress [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable labels Mar 26, 2019
@ellatrix
Copy link
Member Author

Expecting one e2e test to fail. Let's see if there are more.

@ellatrix ellatrix force-pushed the try/controlled-rich-text branch from 1760050 to c6e4842 Compare March 27, 2019 08:08
@ellatrix ellatrix requested a review from atimmer as a code owner March 27, 2019 10:19
@ellatrix
Copy link
Member Author

@atimmer As part of this, I'm rewriting preparing editable tree etc. a bit. I'm avoiding passing arrays and objects as props to RichText as we can check more easily what changed. This also means that we can get rid of the use of memize, which is a concern as we never clear the cache. I'll assume that, if tests pass, everything still works correctly. :)

@ellatrix
Copy link
Member Author

Going to split it into smaller PRs, one of which is ready: #14664.

@ellatrix ellatrix closed this Mar 28, 2019
@ellatrix ellatrix deleted the try/controlled-rich-text branch March 28, 2019 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant