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

Adding index.tsx with the third party components #3

Open
wants to merge 2 commits into
base: tpc
Choose a base branch
from

Conversation

janicklas-ralph
Copy link
Owner

No description provided.

Copy link

@housseindjirdeh housseindjirdeh left a comment

Choose a reason for hiding this comment

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

This is great. Just minor suggestions overall

@@ -0,0 +1,51 @@
# `@next/third-parties`

Choose a reason for hiding this comment

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

Let's add a note at the top that says this is still experimental or early in development, just so folks are aware :)

# `@next/third-parties`

`@next/third-parties` is collection of components that can be used to efficiently load third party libraries into your Next.js application.
This package is the Next.js implementation of the [Third Party Capital](https://github.com/GoogleChromeLabs/third-party-capital/) loading recommendations.

Choose a reason for hiding this comment

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

Suggested change
This package is the Next.js implementation of the [Third Party Capital](https://github.com/GoogleChromeLabs/third-party-capital/) loading recommendations.
This package uses [Third Party Capital](https://github.com/GoogleChromeLabs/third-party-capital/) under the hood to fetch the best loading recommendations.

Or something like that


## Google Analytics

The `GoogleAnalytics` component loads a Google Analytics 4 tag into the page and off-loaded the execution to a web worker using Partytown. This includes the 83 kB gtag script that is required.

Choose a reason for hiding this comment

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

Suggested change
The `GoogleAnalytics` component loads a Google Analytics 4 tag into the page and off-loaded the execution to a web worker using Partytown. This includes the 83 kB gtag script that is required.
The `GoogleAnalytics` component loads a Google Analytics 4 tag into the page and off-loads the execution to a web worker using Partytown. This includes the 83 kB gtag script that is required.

Also I think we'll have to mention that nextScriptWorkers will have to be enabled for this to work (otherwise it'll fallback to loading after the page is interactive) and that it's not yet supported in the App directory: https://nextjs.org/docs/pages/building-your-application/optimizing/scripts#offloading-scripts-to-a-web-worker-experimental


## Youtube Embed

The `YoutubeEmbed` component is used to load and display a Youtube embed. This component loads approximately 224× faster by using [lite-youtube-embed](https://github.com/paulirish/lite-youtube-embed) under the hood.

Choose a reason for hiding this comment

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

Suggested change
The `YoutubeEmbed` component is used to load and display a Youtube embed. This component loads approximately 224× faster by using [lite-youtube-embed](https://github.com/paulirish/lite-youtube-embed) under the hood.
The `YoutubeEmbed` component is used to load and display a YouTube embed. This component loads approximately 224× faster by using [lite-youtube-embed](https://github.com/paulirish/lite-youtube-embed) under the hood.


## Google Maps Embed

The `GoogleMapsEmbed` component can be used to lazy load a Google Maps Embed using the loading attribute.

Choose a reason for hiding this comment

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

Suggested change
The `GoogleMapsEmbed` component can be used to lazy load a Google Maps Embed using the loading attribute.
The `GoogleMapsEmbed` component can be used to include a [Google Maps Embed](https://developers.google.com/maps/documentation/embed/get-started) to your page. By default, it uses the `loading` attribute to lazy-load below the fold.

}
```

Check out the [demo](https://test-next-script-housseindjirdeh.vercel.app/)

Choose a reason for hiding this comment

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

Suggested change
Check out the [demo](https://test-next-script-housseindjirdeh.vercel.app/)
To get a better idea of how these components work, take a look at this [demo](https://test-next-script-housseindjirdeh.vercel.app/).

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.

2 participants