[BUGFIX] Shadow DOM support — {{#in-element}} with ShadowRoot/DocumentFragment and declarative shadow DOM via compiler#21217
[BUGFIX] Shadow DOM support — {{#in-element}} with ShadowRoot/DocumentFragment and declarative shadow DOM via compiler#21217
{{#in-element}} with ShadowRoot/DocumentFragment and declarative shadow DOM via compiler#21217Conversation
Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
{{#in-element}} with ShadowRoot/DocumentFragment and enable declarative shadow DOM
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
{{#in-element}} with ShadowRoot/DocumentFragment and enable declarative shadow DOM{{#in-element}} with ShadowRoot/DocumentFragment and enable declarative shadow DOM
…add new tests Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
packages/@glimmer-workspace/integration-tests/lib/suites/in-element-shadow-root.ts
Outdated
Show resolved
Hide resolved
packages/@glimmer-workspace/integration-tests/lib/suites/in-element-shadow-root.ts
Show resolved
Hide resolved
packages/@glimmer-workspace/integration-tests/lib/suites/in-element-shadow-root.ts
Outdated
Show resolved
Hide resolved
…d document fragment suite Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
I think these tests are all good
This comment was marked as resolved.
This comment was marked as resolved.
…uous test assertions Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Agent-Logs-Url: https://github.com/emberjs/ember.js/sessions/72b301d3-7084-474d-8483-18367cfc2fe6
… tests Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Agent-Logs-Url: https://github.com/emberjs/ember.js/sessions/b893cd15-386a-4913-8907-af52f66f8772
…uite (jitSuite is browser-only) Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Agent-Logs-Url: https://github.com/emberjs/ember.js/sessions/b893cd15-386a-4913-8907-af52f66f8772
…for existingShadowRoot path Agent-Logs-Url: https://github.com/emberjs/ember.js/sessions/423b5a29-b3fe-40d7-b47f-bf00050510c5 Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
|
|
||
| @test | ||
| '<template shadowrootmode="open"> as component root with tracked state re-renders into same shadow root'() { | ||
| class Counter extends GlimmerishComponent { |
There was a problem hiding this comment.
@copilot since this test is changing state via rerender, we'll need another test that actually uses a tracked count + button that increments the property. no data should be passed in to render/rerender
There was a problem hiding this comment.
Done in afb21ff. Added '<template shadowrootmode="open"> as component root re-renders via internal @tracked property (no rerender args)' — the Counter class owns @tracked count = 0, the template uses {{this.count}}, nothing is passed to render() or rerender(). The test captures the instance, mutates instance.captured.count = 1, calls this.rerender() with no args, and asserts both the updated content and that the same shadow root instance is reused.
…erender args) Agent-Logs-Url: https://github.com/emberjs/ember.js/sessions/18abc746-893e-4d7c-bba1-09d382f0b3ca Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
…ng assert.step Agent-Logs-Url: https://github.com/emberjs/ember.js/sessions/3810a6db-ae5e-4396-9f63-baf5a7164f82 Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
|
I extracted fragment support to here: #21253 because I want this PR more focused and easier to review |
shadow-dom.tsattachShadowguards fromShadowDOMSuitetestsin-element-shadow-root.ts/in-element-document-fragment.tstest suiteselement-builder.tscomment explaining the extra pop for shadow rootsquerySelector('template')assertions inshadow-dom.tsdom.ts@tracked count = 0fromCounterclass in shadow-dom.ts test 5true → false → trueround-trip test that directly exercises theexistingShadowRoot.replaceChildren()path inVM_ATTACH_SHADOW_ROOT_OP@trackedproperty (no data passed torender()/rerender())@trackedstate rendered into the same shadow root; usesassert.step/assert.verifyStepsto prove only the component whose state changed re-rendersOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.