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(Script): allow passing defer=false to Script component #34850

Merged
merged 4 commits into from Mar 11, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/next/pages/_document.tsx
Expand Up @@ -81,7 +81,7 @@ function getPreNextScripts(context: HtmlProps, props: OriginProps) {
<script
{...scriptProps}
key={scriptProps.src || index}
defer={!disableOptimizedLoading}
defer={scriptProps.defer ?? !disableOptimizedLoading}
Copy link
Member

Choose a reason for hiding this comment

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

@janicklas-ralph can you review this. It looks fine to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@timneutkens Is there any chance to get this moving forward? We can't migrate to Script components because of this issue.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks good to me. We can merge this as soon as possible.

nonce={props.nonce}
data-nscript="beforeInteractive"
crossOrigin={props.crossOrigin || crossOrigin}
Expand Down