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

Re-add Partytown custom configuration to Script component documentation #68946

Merged
merged 5 commits into from
Aug 23, 2024

Conversation

guisehn
Copy link
Contributor

@guisehn guisehn commented Aug 15, 2024

What?

Add documentation about Partytown configuration on the Script documentation page.

Why?

The Script component with the strategy prop set to worker uses Partytown under the hood.

Users may need to customize Partytown options such as forward, loadScriptsOnMainThread, and resolveUrl, to allow for third party scripts such as Segment and Google Tag Manager to work properly.

This used to be documented on docs/basic-features/script.md, as you can see on the pull request that originally introduced the worker strategy, but this doc page was removed (potentially unintendedly) on #50701, and there's no longer mention of Partytown configuration in Next.js docs.

How?

Adding back the documentation text originally written by @housseindjirdeh in his pull request #34244

Fixes #68943

@ijjk ijjk added the Documentation Related to Next.js' official documentation. label Aug 15, 2024
@ijjk
Copy link
Member

ijjk commented Aug 15, 2024

Allow CI Workflow Run

  • approve CI run for commit: cc1605d

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@samcx
Copy link
Member

samcx commented Aug 21, 2024

@guisehn Let's wrap the new section with <PagesOnly>, as it only works in Pages Router. We don't have a <Head> component since it is incompatible with streaming in App Router.

@guisehn
Copy link
Contributor Author

guisehn commented Aug 23, 2024

@samcx Sounds good. I've added <PagesOnly> on 5c9ef5c

Copy link
Member

@samcx samcx left a comment

Choose a reason for hiding this comment

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

:lgtm:

@samcx samcx enabled auto-merge (squash) August 23, 2024 13:57
@samcx samcx merged commit 8d6f832 into vercel:canary Aug 23, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Related to Next.js' official documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: Missing custom Partytown configuration for Script with strategy="worker"
3 participants