Skip to content

perf: non-blocking third-party script loading with next/script (#179)#222

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
softnationz:feat/179-third-party-script-loading
Apr 27, 2026
Merged

perf: non-blocking third-party script loading with next/script (#179)#222
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
softnationz:feat/179-third-party-script-loading

Conversation

@softnationz
Copy link
Copy Markdown
Contributor

Summary

Replace synchronous script loading with next/script to eliminate render-blocking behaviour.

Changes

  • Imported Script from next/script in src/app/layout.tsx
  • Added analytics scripts with strategy="lazyOnload" (loads after page is fully idle)
  • Guarded by NEXT_PUBLIC_ANALYTICS_ID env var — zero impact when unset

Notes

The inline theme <script> in <head> is intentionally kept synchronous to prevent flash of unstyled content (FOUC). This is correct behaviour and unrelated to this issue.

Testing

  • Page renders without blocking on script load
  • Analytics only fires when NEXT_PUBLIC_ANALYTICS_ID is set in env

Closes #179

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 27, 2026

@softnationz Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER RUKAYAT-CODER merged commit 553b922 into rinafcode:main Apr 27, 2026
1 of 4 checks passed
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.

Third-Party Script Loading

2 participants