Describe the bug
The Block Editor is pre-loading API requests into the store via this set of logic and this REST API function. This is a very good thing for initial editor load times, but it has a strange side-effect of triggering the full rendered post content to be preloaded with the request.
Loading in the rendered post content has some strange side effects and can cause unintended behavior. As an example, any shortcodes or dynamic blocks are fully rendered in this request. This means that any API requests or heavy computations that either undertake are performed on the server (affecting TTFB) and then again in ServerSideRender in the case of dynamic blocks. Additionally, it means that the blob sent to the client is significantly larger, but that's a much smaller issue.
This is likely not an easy fix and would involve adjusting the way that the REST API returns fields in a given context. It sounds like this may be somewhat in hand already after talking to @kadamwhite.
Related: #18394 is caused by this behavior and is a good example of unintended side effects.
Expected behavior
I would expect that post content is rendered only on the client side when editing a given post.
Describe the bug
The Block Editor is pre-loading API requests into the store via this set of logic and this REST API function. This is a very good thing for initial editor load times, but it has a strange side-effect of triggering the full rendered post content to be preloaded with the request.
Loading in the
renderedpost content has some strange side effects and can cause unintended behavior. As an example, any shortcodes or dynamic blocks are fully rendered in this request. This means that any API requests or heavy computations that either undertake are performed on the server (affecting TTFB) and then again inServerSideRenderin the case of dynamic blocks. Additionally, it means that the blob sent to the client is significantly larger, but that's a much smaller issue.This is likely not an easy fix and would involve adjusting the way that the REST API returns fields in a given context. It sounds like this may be somewhat in hand already after talking to @kadamwhite.
Related: #18394 is caused by this behavior and is a good example of unintended side effects.
Expected behavior
I would expect that post content is rendered only on the client side when editing a given post.