Skip to content

Tweak how Torque cache is moved

Justin Reese requested to merge avoid-redundant-ids into main

I was a bad teammate and didn't review !15 (merged) in time. This MR contains what would have been my suggested changes:

  1. Changes the technique so that the lfc--outside-cache and lfc--inside-cache elements don't share the same id attribute, as that's not valid HTML. Instead, lfc--outside-cache will populate a data-id attribute. This requires changes to the markup generation not covered by this MR (as I don't know where that happens).
  2. Protects against an lfc--outside-cache element with a missing data-id attribute.
  3. Rather than append to the destination element -- which implicitly signals it may contain content we need to preserve -- overwrite its contents entirely.
  4. Add some comments to the CSS.

Again, apologies for not reviewing this properly before!

Merge request reports