-
Notifications
You must be signed in to change notification settings - Fork 47
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
App router migration rollbar script #1118
Merged
eleanorreem
merged 13 commits into
chaynHQ:next-js-migration
from
boodland:app-router-migration-rollbar-script
Sep 20, 2024
Merged
App router migration rollbar script #1118
eleanorreem
merged 13 commits into
chaynHQ:next-js-migration
from
boodland:app-router-migration-rollbar-script
Sep 20, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@boodland is attempting to deploy a commit to the Chayn Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
eleanorreem
approved these changes
Sep 20, 2024
eleanorreem
pushed a commit
that referenced
this pull request
Oct 2, 2024
* Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Use script tag and set id * Add rollbar script to root layout * Make it beforeInteractive so it is included in the head * Move to _app as next/script is not working in _document
eleanorreem
added a commit
that referenced
this pull request
Oct 8, 2024
* Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Add new relic nextjs configuration * Create new relic configuration file * Use new relic configuration * Remove non required file * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * App router migration google tag manager script (#1117) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Add google tag manager to root layout * Change strategy as worker is experimental and is not including the script * Move gtm to body as next is including it in head properly * Add comment to tackle in the future * Move gtm script from _document to _app * App router migration rollbar script (#1118) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Use script tag and set id * Add rollbar script to root layout * Make it beforeInteractive so it is included in the head * Move to _app as next/script is not working in _document * App router migration opengraph metadata (#1120) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Move primary color to a constant so can be used in a server component (root layout) * Create rootMetadata * Fix format * Add metadata to root layout --------- Co-authored-by: eleanorreem <eleanor.reem@hotmail.co.uk> * App router migration error boundary component (#1121) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Make error boundary client component * Add ErrorBoundary component to root layout * Create app router error route test page --------- Co-authored-by: eleanorreem <eleanor.reem@hotmail.co.uk> * App router migration material UI configuration (#1122) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Create theme registry component * Add ThemeRegistry to root layout * Make theme client component * Install mui for app router --------- Co-authored-by: eleanorreem <eleanor.reem@hotmail.co.uk> * App router migration analytics (#1123) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Create Analytics component * Add analytics to root layout * Update layout.tsx --------- Co-authored-by: eleanorreem <eleanor.reem@hotmail.co.uk> --------- Co-authored-by: eleanorreem <eleanor.reem@hotmail.co.uk>
eleanorreem
pushed a commit
that referenced
this pull request
Oct 8, 2024
* Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Use script tag and set id * Add rollbar script to root layout * Make it beforeInteractive so it is included in the head * Move to _app as next/script is not working in _document
eleanorreem
added a commit
that referenced
this pull request
Oct 8, 2024
* Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Add new relic nextjs configuration * Create new relic configuration file * Use new relic configuration * Remove non required file * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * App router migration google tag manager script (#1117) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Add google tag manager to root layout * Change strategy as worker is experimental and is not including the script * Move gtm to body as next is including it in head properly * Add comment to tackle in the future * Move gtm script from _document to _app * App router migration rollbar script (#1118) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Use script tag and set id * Add rollbar script to root layout * Make it beforeInteractive so it is included in the head * Move to _app as next/script is not working in _document * App router migration opengraph metadata (#1120) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Move primary color to a constant so can be used in a server component (root layout) * Create rootMetadata * Fix format * Add metadata to root layout --------- Co-authored-by: eleanorreem <eleanor.reem@hotmail.co.uk> * App router migration error boundary component (#1121) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Make error boundary client component * Add ErrorBoundary component to root layout * Create app router error route test page --------- Co-authored-by: eleanorreem <eleanor.reem@hotmail.co.uk> * App router migration material UI configuration (#1122) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Create theme registry component * Add ThemeRegistry to root layout * Make theme client component * Install mui for app router --------- Co-authored-by: eleanorreem <eleanor.reem@hotmail.co.uk> * App router migration analytics (#1123) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Create Analytics component * Add analytics to root layout * Update layout.tsx --------- Co-authored-by: eleanorreem <eleanor.reem@hotmail.co.uk> --------- Co-authored-by: eleanorreem <eleanor.reem@hotmail.co.uk>
eleanorreem
pushed a commit
that referenced
this pull request
Oct 22, 2024
* Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Use script tag and set id * Add rollbar script to root layout * Make it beforeInteractive so it is included in the head * Move to _app as next/script is not working in _document
eleanorreem
added a commit
that referenced
this pull request
Oct 22, 2024
* Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Add new relic nextjs configuration * Create new relic configuration file * Use new relic configuration * Remove non required file * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * App router migration google tag manager script (#1117) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Add google tag manager to root layout * Change strategy as worker is experimental and is not including the script * Move gtm to body as next is including it in head properly * Add comment to tackle in the future * Move gtm script from _document to _app * App router migration rollbar script (#1118) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Use script tag and set id * Add rollbar script to root layout * Make it beforeInteractive so it is included in the head * Move to _app as next/script is not working in _document * App router migration opengraph metadata (#1120) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Move primary color to a constant so can be used in a server component (root layout) * Create rootMetadata * Fix format * Add metadata to root layout --------- Co-authored-by: eleanorreem <eleanor.reem@hotmail.co.uk> * App router migration error boundary component (#1121) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Make error boundary client component * Add ErrorBoundary component to root layout * Create app router error route test page --------- Co-authored-by: eleanorreem <eleanor.reem@hotmail.co.uk> * App router migration material UI configuration (#1122) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Create theme registry component * Add ThemeRegistry to root layout * Make theme client component * Install mui for app router --------- Co-authored-by: eleanorreem <eleanor.reem@hotmail.co.uk> * App router migration analytics (#1123) * Add basic Root Layout * Add metadata * Add reference included by next * Add comment to explain the default meta tags * Add public testing page to check the migration * Remove non required file * Create Analytics component * Add analytics to root layout * Update layout.tsx --------- Co-authored-by: eleanorreem <eleanor.reem@hotmail.co.uk> --------- Co-authored-by: eleanorreem <eleanor.reem@hotmail.co.uk>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue link / number:
#1083
What changes did you make?
Used Script nextjs tag
Set script strategy to beforeInteractive
Added rollbar configuration to root layout
Moved Script from _document to _app as seems to be an outdated pages router documentation bug see:
https://stackoverflow.com/questions/73813720/next-script-does-not-work-inside-document-js-file-nextjs
https://nextjs.org/docs/pages/api-reference/components/script#beforeinteractive
This documentation seems also wrong as next/script is not working on _document
https://nextjs.org/docs/messages/no-script-in-document
The following error is no longer triggered
https://nextjs.org/docs/messages/no-before-interactive-script-outside-document
Now the script is loaded in both pages and app router
Why did you make the changes?
In order to be able to have google tag manager within app router
Did you run tests?
Yes
Navigate to http://localhost:3000/ to check that the head rollbar script is added properly
Navigate to http://localhost:3000/public-route-test to check that the head rollbar script is added properly