Add renderInto function to allow Lit templates to adopt existing DOM elements. [devtools/devtools-frontend : main]

0 views
Skip to first unread message

Danil Somsikov (Gerrit)

unread,
Mar 31, 2026, 9:05:47 AMMar 31
to Philip Pfaffe, Devtools-frontend LUCI CQ, AyeAye, devtools-rev...@chromium.org
Attention needed from Philip Pfaffe

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Philip Pfaffe
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: devtools/devtools-frontend
Gerrit-Branch: main
Gerrit-Change-Id: I5427bcc7a28f596227af8aeff799825635069617
Gerrit-Change-Number: 7716198
Gerrit-PatchSet: 1
Gerrit-Owner: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Attention: Philip Pfaffe <pfa...@chromium.org>
Gerrit-Comment-Date: Tue, 31 Mar 2026 13:05:40 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Danil Somsikov (Gerrit)

unread,
Mar 31, 2026, 9:08:08 AMMar 31
to Philip Pfaffe, Devtools-frontend LUCI CQ, AyeAye, devtools-rev...@chromium.org
Attention needed from Philip Pfaffe

Danil Somsikov voted

Auto-Submit+1
Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Philip Pfaffe
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: devtools/devtools-frontend
Gerrit-Branch: main
Gerrit-Change-Id: I5427bcc7a28f596227af8aeff799825635069617
Gerrit-Change-Number: 7716198
Gerrit-PatchSet: 2
Gerrit-Owner: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Attention: Philip Pfaffe <pfa...@chromium.org>
Gerrit-Comment-Date: Tue, 31 Mar 2026 13:08:04 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Philip Pfaffe (Gerrit)

unread,
Apr 2, 2026, 4:42:11 AMApr 2
to Danil Somsikov, Devtools-frontend LUCI CQ, AyeAye, devtools-rev...@chromium.org
Attention needed from Danil Somsikov

Philip Pfaffe added 2 comments

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Philip Pfaffe . unresolved

I understand the implementation, but this seems extremly complicated and risky. Why do we need this?

File front_end/ui/lit/render-into.ts
Line 16, Patchset 3 (Latest): const boundElement = (part as any).element as HTMLElement;
Philip Pfaffe . unresolved

Do we need the any cast? Risky

Open in Gerrit

Related details

Attention is currently required from:
  • Danil Somsikov
Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: devtools/devtools-frontend
    Gerrit-Branch: main
    Gerrit-Change-Id: I5427bcc7a28f596227af8aeff799825635069617
    Gerrit-Change-Number: 7716198
    Gerrit-PatchSet: 3
    Gerrit-Owner: Danil Somsikov <d...@chromium.org>
    Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
    Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
    Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Attention: Danil Somsikov <d...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Apr 2026 08:42:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Danil Somsikov (Gerrit)

    unread,
    Apr 2, 2026, 11:18:23 AMApr 2
    to Philip Pfaffe, Devtools-frontend LUCI CQ, AyeAye, devtools-rev...@chromium.org
    Attention needed from Philip Pfaffe

    Danil Somsikov voted and added 1 comment

    Votes added by Danil Somsikov

    Auto-Submit+1

    1 comment

    Patchset-level comments
    Philip Pfaffe . unresolved

    I understand the implementation, but this seems extremly complicated and risky. Why do we need this?

    Danil Somsikov

    PTAL, I significantly reworked it so that it supports parent content and works properly with select.

    We need it, because we need an declarative way to update existing elements. Specifying jslog and classes in the Widget constructors let's us avoid the linter but doesn't still violates the separation of concerns. It is complex, but so is lit. Regarding riskiness, this is extensively tested, and I can add more if this will help address this concern.

    I'm not married to this solution, if you have a practical simpler alternative solution to this problem, I'd be happy to consider it.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Philip Pfaffe
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: devtools/devtools-frontend
    Gerrit-Branch: main
    Gerrit-Change-Id: I5427bcc7a28f596227af8aeff799825635069617
    Gerrit-Change-Number: 7716198
    Gerrit-PatchSet: 4
    Gerrit-Owner: Danil Somsikov <d...@chromium.org>
    Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
    Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
    Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Attention: Philip Pfaffe <pfa...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Apr 2026 15:18:19 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Philip Pfaffe <pfa...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Philip Pfaffe (Gerrit)

    unread,
    Apr 9, 2026, 9:30:39 AMĀ (10 days ago)Ā Apr 9
    to Danil Somsikov, Devtools-frontend LUCI CQ, AyeAye, devtools-rev...@chromium.org
    Attention needed from Danil Somsikov

    Philip Pfaffe added 1 comment

    Patchset-level comments
    Philip Pfaffe . unresolved

    I understand the implementation, but this seems extremly complicated and risky. Why do we need this?

    Danil Somsikov

    PTAL, I significantly reworked it so that it supports parent content and works properly with select.

    We need it, because we need an declarative way to update existing elements. Specifying jslog and classes in the Widget constructors let's us avoid the linter but doesn't still violates the separation of concerns. It is complex, but so is lit. Regarding riskiness, this is extensively tested, and I can add more if this will help address this concern.

    I'm not married to this solution, if you have a practical simpler alternative solution to this problem, I'd be happy to consider it.

    Philip Pfaffe

    The separation of concerns being that we have view-logic in the presenter constructor? Aren't there cheaper solutions for moving that over? Like having a utility that sets these on the target in a view function? We could wrap lit's render with a version that takes a widgetOptions object for example

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Danil Somsikov
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: devtools/devtools-frontend
    Gerrit-Branch: main
    Gerrit-Change-Id: I5427bcc7a28f596227af8aeff799825635069617
    Gerrit-Change-Number: 7716198
    Gerrit-PatchSet: 5
    Gerrit-Owner: Danil Somsikov <d...@chromium.org>
    Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
    Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
    Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Attention: Danil Somsikov <d...@chromium.org>
    Gerrit-Comment-Date: Thu, 09 Apr 2026 13:30:35 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Philip Pfaffe <pfa...@chromium.org>
    Comment-In-Reply-To: Danil Somsikov <d...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Danil Somsikov (Gerrit)

    unread,
    Apr 13, 2026, 10:55:17 AMĀ (6 days ago)Ā Apr 13
    to Philip Pfaffe, devtools-fro...@luci-project-accounts.iam.gserviceaccount.com, android-bu...@system.gserviceaccount.com, devtools-rev...@chromium.org
    Attention needed from Philip Pfaffe

    Danil Somsikov voted and added 2 comments

    Votes added by Danil Somsikov

    Auto-Submit+1

    2 comments

    Patchset-level comments
    Philip Pfaffe . unresolved

    I understand the implementation, but this seems extremly complicated and risky. Why do we need this?

    Danil Somsikov

    PTAL, I significantly reworked it so that it supports parent content and works properly with select.

    We need it, because we need an declarative way to update existing elements. Specifying jslog and classes in the Widget constructors let's us avoid the linter but doesn't still violates the separation of concerns. It is complex, but so is lit. Regarding riskiness, this is extensively tested, and I can add more if this will help address this concern.

    I'm not married to this solution, if you have a practical simpler alternative solution to this problem, I'd be happy to consider it.

    Philip Pfaffe

    The separation of concerns being that we have view-logic in the presenter constructor? Aren't there cheaper solutions for moving that over? Like having a utility that sets these on the target in a view function? We could wrap lit's render with a version that takes a widgetOptions object for example

    Danil Somsikov

    As discussed, implemented as extra options for the `render` function intead.

    File front_end/ui/lit/render-into.ts
    Line 16, Patchset 3: const boundElement = (part as any).element as HTMLElement;
    Philip Pfaffe . resolved

    Do we need the any cast? Risky

    Danil Somsikov

    Acknowledged

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Philip Pfaffe
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: devtools/devtools-frontend
    Gerrit-Branch: main
    Gerrit-Change-Id: I5427bcc7a28f596227af8aeff799825635069617
    Gerrit-Change-Number: 7716198
    Gerrit-PatchSet: 6
    Gerrit-Owner: Danil Somsikov <d...@chromium.org>
    Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
    Gerrit-Reviewer: Philip Pfaffe <pfa...@chromium.org>
    Gerrit-Attention: Philip Pfaffe <pfa...@chromium.org>
    Gerrit-Comment-Date: Mon, 13 Apr 2026 14:55:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages