-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 removed deprecated items from lit integration #11164
Conversation
🦋 Changeset detectedLatest commit: 034e325 The changes in this PR will be included in the next version bump. 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
const polyfillCheckEl = new DOMParser() | ||
.parseFromString( | ||
`<p><template shadowroot="open" shadowrootmode="open"></template></p>`, | ||
'text/html', | ||
{ | ||
includeShadowRoots: true, | ||
} | ||
) | ||
const polyfillCheckEl = Document | ||
.parseHTMLUnsafe(`<p><template shadowrootmode="open"></template></p>`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
May I ask about the compatibility?
parseFromString
is there in basically every browser (https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString) while parseHTMLUnsafe
is not yet well supported (https://caniuse.com/mdn-api_document_parsehtmlunsafe_static today reports global of just under 58%)
Won't that be a problem?
Changes
Deprecated API
Chrome's deprecation info:
https://chromestatus.com/feature/5116094370283520
Related story:
#11160
Deprecated Attribute
shadowroot
attribute which was deprecated by chrome and not needed by other browsersDeprecation info:
https://chromestatus.com/feature/6239658726391808
Testing
The original file did not include tests so I installed
client-shim
and client-shim-minlocally and tested them with the latest astro install I have, which has
lit` components in itDocs
Should not change the user experience. Worked for me with both local dev server and build/preview