Skip to content

Commit afb3485

Browse files
xavivarswardpeet
authored andcommitted
fix(gatsby): always use publicLoader for window.___loader (#16122)
This reverts commit f6aa41e.
1 parent 828a266 commit afb3485

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

packages/gatsby/cache-dir/app.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import domReady from "@mikaelkristiansson/domready"
55
import socketIo from "./socketIo"
66
import emitter from "./emitter"
77
import { apiRunner, apiRunnerAsync } from "./api-runner-browser"
8-
import { setLoader } from "./loader"
8+
import { setLoader, publicLoader } from "./loader"
99
import DevLoader from "./dev-loader"
1010
import syncRequires from "./sync-requires"
1111
// Generated during bootstrap
@@ -17,6 +17,8 @@ const loader = new DevLoader(syncRequires, matchPaths)
1717
setLoader(loader)
1818
loader.setApiRunner(apiRunner)
1919

20+
window.___loader = publicLoader
21+
2022
// Let the site/plugins run code very early.
2123
apiRunnerAsync(`onClientEntry`).then(() => {
2224
// Hook up the client to socket.io on server

packages/gatsby/cache-dir/loader.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ export const publicLoader = {
387387
prefetch: rawPath => instance.prefetch(rawPath),
388388
isPageNotFound: rawPath => instance.isPageNotFound(rawPath),
389389
hovering: rawPath => instance.hovering(rawPath),
390-
findMatchPath: rawPath => instance.findMatchPath(rawPath),
391390
}
392391

393392
export default publicLoader

packages/gatsby/cache-dir/navigation.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ function init() {
151151
// Temp hack while awaiting https://github.com/reach/router/issues/119
152152
window.__navigatingToLink = false
153153

154-
window.___loader = loader
155154
window.___push = to => navigate(to, { replace: false })
156155
window.___replace = to => navigate(to, { replace: true })
157156
window.___navigate = (to, options) => navigate(to, options)

packages/gatsby/cache-dir/production-app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
import emitter from "./emitter"
1313
import PageRenderer from "./page-renderer"
1414
import asyncRequires from "./async-requires"
15-
import { setLoader, ProdLoader } from "./loader"
15+
import { setLoader, ProdLoader, publicLoader } from "./loader"
1616
import EnsureResources from "./ensure-resources"
1717
import stripPrefix from "./strip-prefix"
1818

@@ -25,7 +25,7 @@ loader.setApiRunner(apiRunner)
2525

2626
window.asyncRequires = asyncRequires
2727
window.___emitter = emitter
28-
window.___loader = loader
28+
window.___loader = publicLoader
2929
window.___webpackCompilationHash = window.webpackCompilationHash
3030

3131
navigationInit()

0 commit comments

Comments
 (0)