From d80ede5f980315f2a2533d1e6a8b4f326d295a03 Mon Sep 17 00:00:00 2001 From: Grayson Hicks Date: Mon, 6 Dec 2021 10:16:54 -0500 Subject: [PATCH 1/2] Clarify html.js vs. onPreRenderHTML Clarify a note that adding a script via html.js is the same as using onPreRenderHTML. --- docs/docs/how-to/performance/improving-site-performance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/how-to/performance/improving-site-performance.md b/docs/docs/how-to/performance/improving-site-performance.md index 0a85beacb7879..5c7648f6eb85e 100644 --- a/docs/docs/how-to/performance/improving-site-performance.md +++ b/docs/docs/how-to/performance/improving-site-performance.md @@ -79,7 +79,7 @@ There are a number of places to put an inlined script, depending whether you nee - _Some deferring_: You can place the script in [onClientEntry](/docs/browser-apis/#onClientEntry) to have it execute after page load, but before the browser renders the page. - _More deferring_: You can place the script in [onInitialClientRender](/docs/browser-apis/#onInitialClientRender) to have it execute after the browser renders the page. -Note that if you are using [html.js](/docs/custom-html/), you should modify that file to include your snippet instead of using `onPreRenderHTML`. +Note that if you are already using [html.js](/docs/custom-html/), you should modify that file to include your snippet instead of using `onPreRenderHTML`. This will have the same behavior. ### Reduce your JavaScript bundle cost From 8f0a31dec97c693e8abb06ba20940a00b61a8e78 Mon Sep 17 00:00:00 2001 From: gatsbybot Date: Mon, 6 Dec 2021 15:28:46 +0000 Subject: [PATCH 2/2] chore: format --- docs/docs/how-to/performance/improving-site-performance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/how-to/performance/improving-site-performance.md b/docs/docs/how-to/performance/improving-site-performance.md index 5c7648f6eb85e..df2f5dd584df3 100644 --- a/docs/docs/how-to/performance/improving-site-performance.md +++ b/docs/docs/how-to/performance/improving-site-performance.md @@ -79,7 +79,7 @@ There are a number of places to put an inlined script, depending whether you nee - _Some deferring_: You can place the script in [onClientEntry](/docs/browser-apis/#onClientEntry) to have it execute after page load, but before the browser renders the page. - _More deferring_: You can place the script in [onInitialClientRender](/docs/browser-apis/#onInitialClientRender) to have it execute after the browser renders the page. -Note that if you are already using [html.js](/docs/custom-html/), you should modify that file to include your snippet instead of using `onPreRenderHTML`. This will have the same behavior. +Note that if you are already using [html.js](/docs/custom-html/), you should modify that file to include your snippet instead of using `onPreRenderHTML`. This will have the same behavior. ### Reduce your JavaScript bundle cost