File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed
packages/gatsby/cache-dir Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import DevLoader from "./dev-loader"
1212import syncRequires from "$virtual/sync-requires"
1313// Generated during bootstrap
1414import matchPaths from "$virtual/match-paths.json"
15+ import { LoadingIndicatorEventHandler } from "./loading-indicator"
1516
1617if ( process . env . GATSBY_HOT_LOADER === `fast-refresh` && module . hot ) {
1718 module . hot . accept ( `$virtual/sync-requires` , ( ) => {
@@ -164,6 +165,23 @@ apiRunnerAsync(`onClientEntry`).then(() => {
164165
165166 renderer ( < Root /> , rootElement , ( ) => {
166167 apiRunner ( `onInitialClientRender` )
168+
169+ // Render query on demand overlay
170+ if (
171+ process . env . GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR &&
172+ process . env . GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR === `true`
173+ ) {
174+ const indicatorMountElement = document . createElement ( `div` )
175+ indicatorMountElement . setAttribute (
176+ `id` ,
177+ `query-on-demand-indicator-element`
178+ )
179+ document . body . append ( indicatorMountElement )
180+ ReactDOM . render (
181+ < LoadingIndicatorEventHandler /> ,
182+ indicatorMountElement
183+ )
184+ }
167185 } )
168186 } )
169187 } )
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import loader from "./loader"
1212import { PageQueryStore , StaticQueryStore } from "./query-result-store"
1313import EnsureResources from "./ensure-resources"
1414import FastRefreshOverlay from "./fast-refresh-overlay"
15-
1615import { reportError , clearError } from "./error-overlay-handler"
1716import { LoadingIndicatorEventHandler } from "./loading-indicator"
1817
@@ -148,9 +147,5 @@ const ConditionalFastRefreshOverlay = ({ children }) => {
148147export default ( ) => (
149148 < ConditionalFastRefreshOverlay >
150149 < StaticQueryStore > { WrappedRoot } </ StaticQueryStore >
151- { process . env . GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND &&
152- process . env . GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR === `true` && (
153- < LoadingIndicatorEventHandler />
154- ) }
155150 </ ConditionalFastRefreshOverlay >
156151)
You can’t perform that action at this time.
0 commit comments