Closed (fixed)
Project:
BigPipe
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Reporter:
Created:
23 Feb 2016 at 21:43 UTC
Updated:
11 Mar 2016 at 07:04 UTC
Jump to comment: Most recent, Most recent file
Must verify:
#lazy_builder.| Comment | File | Size | Author |
|---|---|---|---|
| #16 | 2674334-16.patch | 23.72 KB | wim leers |
Comments
Comment #2
wim leersComment #3
wim leersComment #4
wim leersThis placeholder makes a ton of sense, and it's legible.
This placeholder on the other hand makes little sense, and is not really legible.
Let's fix that: let's make no-JS BigPipe placeholders also make sense.
Comment #5
wim leers#4 let me down a bit of a rabbit hole of inconsistencies.
I refactored the code generating #4.1 into a protected helper method so I can use it also for the no-JS case. No problem.
Then I noticed it was generating a "selector". But it's not really generating a selector, it's generating an identifier. As is evident from the fact that we send these generated selectors to the client side using
drupalSettings.bigPipePlaceholders, so that the JS has a whitelist to verify against:But note that this JS doesn't call it "selectors" anymore! This is very inconsistent and confusing.
If all this were called "placeholder IDs" instead of "selectors", none of this confusion would arise. So, let's do that renaming first.
Comment #6
wim leersAnd here we go, much saner placeholders + placeholder IDs for BigPipe no-JS placeholders, this addresses #4.2.
Comment #7
wim leersThose two @todos are technically out of scope here.
But…
These three expectations cement the current implementation in the test expectations: they cement the expectation that these placeholders which live in attribute values can in fact be HTML, which breaks response filters as the
@todoindicates.Conclusion: I think it makes sense to fix those todos here, to ensure the test expectations actually make sense.
Comment #8
wim leers#2674126: BigPipeResponseAttachmentsProcessor test coverage landed in the mean-time, so re-testing #6.
Comment #9
wim leersThe refactoring I did in #5 resulted in a new helper method (
generateBigPipePlaceholderId()), which also made me realize that one test case is still missing: one for a placeholder that does not use#lazy_builder. See #2469431-173: BigPipe for auth users: first send+render the cheap parts of the page, then the expensive parts.So, first adding test coverage for that.
In doing so, I also noticed that the number of passes did not reflect the number of individual things being tested. So I changed the assertions around a bit: they're now per-placeholder instead of for all placeholders at once. This also greatly simplifies debugging of this test/understanding what exactly is broken.
Comment #10
wim leersIS update for #9.
Comment #12
wim leersAnd finally, this implements #7.
Comment #14
wim leersI worked on #9 while working on #12, I didn't split them up correctly. Hence the failure in #9.
And in #12, I apparently introduced a typo at the very last minute.
Sorry for the confusion.
Comment #15
wim leersOops, this leftover file snuck in! It's not being run (so it's a "dead test" effectively), but it's making the patch looking much bigger than it is.
Comment #16
wim leers#2670462: Clean up, document & improve big_pipe.js landed, this needed to be rebased.
After a clean rebase, there was one more small change needed, and only that change is visible in this interdiff.
Comment #17
wim leersPer #7 and since #12, this fixes all remaining
@todos inBigPipeStrategy, updating title accordingly.Comment #19
wim leersI waited 24 hours to allow for reviews to come in. None happened, that's okay. I don't think there was any controversial change here. Just test coverage, clean-up and renaming.
Comment #20
fabianx commentedRTBC in retrospective
Comment #21
wim leersExcellent, thanks!