gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Classic block: Browser hangs when converting large amounts of content to blocks

Open stevegrunwell opened this issue 8 years ago • 4 comments

Describe the bug When converting an especially long document (1,050,212 characters, attached), the browser tab hangs and/or crashes when attempting to convert the single "Classic" block to modern Gutenberg blocks.

To Reproduce Steps to reproduce the behavior:

  1. Disable the Gutenberg plugin, then create a new post with the following content pasted into the "text" tab within TinyMCE: sample-text-with-markup.txt
  1. Re-enable Gutenberg and attempt to edit the post using the Gutenberg editor
  • You should see a single, "Classic" block containing the post content.
  1. Click the "kebab menu" (three vertically-stacked circles) icon next to the block header to reveal the "More Options" menu, then select "Convert to Blocks"
  2. Wait 30 seconds or so before your browser either crashes the tab or the UI otherwise becomes frozen.

Expected behavior I would expect that the document would be converted to blocks (as it does with other posts).

If the editor is unable to handle that much content, I'd expect to receive some sort of feedback indicating that the block cannot be converted, ideally with alternate instructions.

Environment:

  • OS: macOS 10.12.6
  • Browser: Google Chrome version 68.0.3440.84 (Official Build) (64-bit)
  • WordPress 4.9.8, Gutenberg 3.4.0.

Refs #8368.

stevegrunwell avatar Aug 08 '18 16:08 stevegrunwell

I tried this as well and experienced the same.

My setup:

  • OS: Windows 10 64-bit
  • Browser: Firefox Quantum 64.0.1 (64-bit) & Chrome Version 68.0.3440.84 (Official Build) (64-bit)
  • WordPress 4.9.8, Gutenberg 3.4.0.

Slightly different results on each browser.

Firefox says: A web page is slowing down your browser. What would you like to do? Stop it / Wait

If you stop it, the browser appears to have converted the top paragraph to a block and then just becomes unresponsive. Reloading just makes the Classic block reappear.

Chrome says: Page Unresponsive You can wait for it to become responsive or exit the page Wait / Exit page

Exiting the page gives the Aw, Snap! Reload it - all content back in a Classic block

By the way, that text is 147, 068 words (!)

abrightclearweb avatar Aug 08 '18 19:08 abrightclearweb

I spent some time debugging this last week. It deserves another closer look, but from what I was seeing through performance snapshots was a significant amount of time being spent in initializing TinyMCE for each of the paragraph blocks. This may warrant a reconsideration of the idea proposed in #341 (cc @iseulde).

Also discussed today in core-editor Slack: https://wordpress.slack.com/archives/C02QB2JS7/p1534171728000242

aduth avatar Aug 13 '18 15:08 aduth

Yes, so this is the same issue as #8822? Whether you paste or load the page with the converted same blocks, it's really slow.

ellatrix avatar Aug 13 '18 17:08 ellatrix

Yes, I imagine this is effectively the same as #8822. Let's close this one as there's a decent amount of analysis already in the other issue.

aduth avatar Aug 13 '18 18:08 aduth