Skip to content
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

Merged
merged 4 commits into from
May 29, 2024

Conversation

scottnath
Copy link
Contributor

Changes

Deprecated API

  • Removes a deprecated API in lit plugin's client-shim which is causing a big hit to page insights.

Chrome's deprecation info:
https://chromestatus.com/feature/5116094370283520

Related story:
#11160

Deprecated Attribute

  • Removes the shadowroot attribute which was deprecated by chrome and not needed by other browsers

Deprecation 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 haslit` components in it

Docs

Should not change the user experience. Worked for me with both local dev server and build/preview

Copy link

changeset-bot bot commented May 29, 2024

🦋 Changeset detected

Latest 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

@github-actions github-actions bot added pkg: lit Related to Lit (scope) pkg: integration Related to any renderer integration (scope) labels May 29, 2024
Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@matthewp matthewp merged commit cf9b2ff into withastro:main May 29, 2024
13 checks passed
@astrobot-houston astrobot-houston mentioned this pull request May 29, 2024
Comment on lines -10 to +11
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>`)
Copy link

@jrencz jrencz May 29, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope) pkg: lit Related to Lit (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants