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

[fix] register custom service worker for AMP #2265

Merged
merged 5 commits into from
Nov 22, 2021

Conversation

asendia
Copy link
Contributor

@asendia asendia commented Aug 22, 2021

Fixes #2264

An attempt to fix invalid service-worker script tag in AMP as described in the issue
I am still not sure what is the best way to set data-iframe-src since it must include the full domain name.

@changeset-bot
Copy link

changeset-bot bot commented Aug 22, 2021

🦋 Changeset detected

Latest commit: 102f40e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

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

@asendia asendia changed the title Fix and enable service-worker for AMP [fix] Service-worker for AMP Aug 22, 2021
Copy link
Member

@ignatiusmb ignatiusmb left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, but I don't think this is quite right

packages/kit/src/runtime/server/page/render.js Outdated Show resolved Hide resolved
packages/kit/src/runtime/server/page/render.js Outdated Show resolved Hide resolved
Copy link
Member

@ignatiusmb ignatiusmb left a comment

Choose a reason for hiding this comment

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

Looks good enough, not sure about the actual usage, hoping others with more experience on amp would chime in

@ignatiusmb ignatiusmb changed the title [fix] Service-worker for AMP [fix] register custom service worker for AMP Aug 23, 2021
@asendia
Copy link
Contributor Author

asendia commented Aug 24, 2021

Looks good enough, not sure about the actual usage, hoping others with more experience on amp would chime in

Sorry if this is a stupid question since I am new to this, it seems like the test is failing on node 12 ubuntu-latest. Is this due to flaky test or something? 🙇🏼

@ignatiusmb
Copy link
Member

Yes, it should be fine

@Rich-Harris Rich-Harris merged commit 1b021b5 into sveltejs:master Nov 22, 2021
@Rich-Harris
Copy link
Member

(belatedly) this is great, thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Service worker breaks AMP validation
3 participants