Review main Merged

80192[TASK] Reactivate usage of constructable stylesheets for icon element

Benjamin Franzke CR +2 V +2 Easy +4 −5 updated 07/28/23, 17:02

Commit message

With #100270 stylesheets in icon elements have been inlined instead of
using the style abstraction of lit which uses constructable stylesheets
if available.

Inline stylesheets need to be parsed over and over again, whenever a
web component is used multiple times.
The icon element is supposed to be used very often, which is why this
matters. Constructable stylesheets are cached and therefore do only
need to be parsed once, regardless how often a web component is used.

Per issue description this has been done because browsers throw a
DOMException in some (probably cross-iframe usage) situations:
> Failed to set the 'adoptedStyleSheets' property on 'ShadowRoot':
> Sharing constructed stylesheets in multiple documents is not allowed

These situations can not be reproduced right now and web components
that use shadow dom with constructable stylesheets will continue
having to cope with this limitation, which is why we need to load the
javascript modules into the document (frame) where the component
is supposed to be used and define it in there.
We've got API like `topLevelModuleImport` to do so; also see the
following upstream comment for a similar suggestion:
https://github.com/lit/lit/issues/2068#issuecomment-906671997)

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Andreas Kienast +1
    • Benjamin Kott +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Andreas Kienast +1
    • Benjamin Kott +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 1216

  1. Benjamin Franzke uploaded patch set 1 07/27/23, 19:56

  2. Benjamin Franzke wrote 07/27/23, 19:56

    Topic set to lit
  3. Benjamin Franzke updated the commit message in patch set 2 07/27/23, 19:59

  4. core-ci voted on patch set 1 V +1 07/27/23, 20:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44630

  5. core-ci voted on patch set 2 V +1 07/27/23, 20:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44631

  6. Benjamin Franzke commented on patch set 2 CR -1 07/27/23, 20:39

    Blocking this myself for now in order to await feedback by Benji – cause here filed https://forge.typo3.org/issues/100270
  7. Benjamin Franzke uploaded patch set 3 07/28/23, 08:31

    Copied Votes: * Code-Review-1 (copy condition: "changekind:NO_CHANGE OR is:MIN") * Verified+1 (copy condition: "changekind:NO_CHANGE")
  8. core-ci voted on patch set 3 V +1 07/28/23, 08:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44658

  9. Benjamin Kott commented on patch set 3 V +1 CR +1 07/28/23, 09:01

    cannot reproduce the original issue anymore. as mentioned in the introducing patch it was a workaround since this variant produced the error.
  10. Benjamin Franzke uploaded patch set 4 CR +1 V +1 07/28/23, 09:02

  11. Benjamin Kott voted on patch set 4 V +1 CR +1 07/28/23, 09:03

  12. Benjamin Kott commented on patch set 4 07/28/23, 09:03

    Reply

    Done
  13. core-ci voted on patch set 4 V +1 07/28/23, 09:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44660

  14. Andreas Kienast voted on patch set 4 V +1 CR +1 07/28/23, 12:59

  15. Benjamin Franzke voted on patch set 4 V +2 CR +2 07/28/23, 17:02

  16. Benjamin Franzke merged patch set 5 07/28/23, 17:02