Problem/Motivation

We use mutation observers to detect and load pieces of html to process with bigpipe. We can let HTML do the job with a tiny onload attribute on an <object> element.

Steps to reproduce

Proposed resolution

Add

<object onload="Drupal.bigPipeLoad(this.previousElementSibling)" height="0" type="text/plain" data="data:text/plain,"></object>

To trigger the processing of a pieces of bigpipe content instead of tying to guess when it's loaded though mutation events.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3526447

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nod_ created an issue. See original summary.

nod_’s picture

Status: Active » Needs review
godotislate’s picture

I was curious about the test failures in BigPipeRegressionTest, and I think a large contributing factor is that using load events instead of the mutation observer causes the page to load much more slowly.

Not scientific, but on my local ddev with standard profile and the big_pipe_regression_test module installed:

  • On HEAD, load time for /big_pipe_test_multiple_replacements was roughly 1m 13 sec
  • On the MR branch, load time for /big_pipe_test_multiple_replacements was roughly 14m 06 sec

I think this is happening because event handling is synchronous and blocking, while the mutation observer works asynchronously.

nod_’s picture

Status: Needs review » Closed (won't fix)

I profiled the change and this is a terrible, terrible idea. it's 10x slower and uses 10x the memory.

It's broken in a way that can't be saved