Skip to content

Commit

Permalink
chore(docs): Add wrapRootElement limitation to off-main-thread (#37402)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyhopp authored Jan 4, 2023
1 parent 20ce44b commit 78324eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/docs/reference/built-in-components/gatsby-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,13 @@ You may need to adjust your dev tools to the verbose log level in order to see t

By leveraging [Partytown](https://partytown.builder.io), scripts that use the `off-main-thread` strategy must also be aware of the [limitations mentioned in the Partytown documentation](https://partytown.builder.io/trade-offs). While the strategy can be powerful, it may not be the best solution for all scenarios.

In addition, there are other limitations that require upstream changes from Partytown to enable:
These limitations require upstream changes from Partytown to enable:

- The `onLoad` and `onError` callbacks are not supported. See [discussion #199 in the Partytown repo](https://github.com/BuilderIO/partytown/discussions/199).
- Scripts load only on server-side rendering (SSR) navigation (e.g. regular `<a>` tag navigation), and not on client-side rendering (CSR) navigation (e.g. Gatsby `<Link>` navigation). See [issue #74 in the Partytown repo](https://github.com/BuilderIO/partytown/issues/74).

In addition, the `off-main-thread` strategy cannot be used in the `wrapRootElement` API since script collection depends on location providers. Use the `wrapPageElement` API instead.

## Usage in Gatsby SSR and Browser APIs

The Gatsby `<Script>` component can also be used in the following [Gatsby SSR](/docs/reference/config-files/gatsby-ssr/) and [Gatsby Browser](/docs/reference/config-files/gatsby-browser/) APIs:
Expand Down

0 comments on commit 78324eb

Please sign in to comment.