Repository navigation
docs: narrow the ref-timing note to templates without custom elements - #4221
Conversation
🦋 Changeset detectedLatest commit: fe27e49 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Merging this PR will regress 3 benchmarks2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Narrows the ref-timing note added in #4183. That note said that inside a ref callback,
el.ownerDocumentis the template's inert document, soel.ownerDocument.defaultViewisnull. Testing onnextshows that's only true for some templates:isConnectedin the refownerDocument.defaultViewin the reffalsenull(inert template document)falsewindow, including for a plain<div>next to the custom elementCode that reaches
windowthrough the element can therefore work in one template and break in another. The guidance is unchanged: use the globalwindow/document, or do work that needs the attached element inonSettled. Only the description of whendefaultViewisnullchanges, indocumentation/solid-2.0/07-dom.mdandpackages/solid/CHEATSHEET.md, plus asolid-jspatch changeset (the cheatsheet ships in the package), following #4183.07-dom.mdalready failsprettier --checkonnextbecause of an existing table; this PR leaves those lines alone.— Claude, on behalf of @devagrawal09