1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Rename NEXT_PAGE_LOADER into __NEXT_PAGE_LOADER__

This commit is contained in:
Arunoda Susiripala 2017-04-06 10:56:13 +05:30
parent 5aa02d0727
commit 32cdf3f2d0
3 changed files with 7 additions and 7 deletions

View file

@ -28,7 +28,7 @@ const {
location
} = window
const pageLoader = window.NEXT_PAGE_LOADER = new PageLoader(buildId)
const pageLoader = window.__NEXT_PAGE_LOADER__ = new PageLoader(buildId)
if (window.NEXT_LOADED_PAGES) {
window.NEXT_LOADED_PAGES.forEach((fn) => fn())
delete window.NEXT_LOADED_PAGES

View file

@ -18,10 +18,10 @@ export default class PagesPlugin {
const newContent = `
function loadPage () {
var comp = ${content}
window.NEXT_PAGE_LOADER.registerPage('${routeName}', null, comp.default)
window.__NEXT_PAGE_LOADER__.registerPage('${routeName}', null, comp.default)
}
if (window.NEXT_PAGE_LOADER) {
if (window.__NEXT_PAGE_LOADER__) {
loadPage()
} else {
window.NEXT_LOADED_PAGES = window.NEXT_LOADED_PAGES || []

View file

@ -135,10 +135,10 @@ export async function renderScriptError (req, res, page, error, customFields, op
var error = new Error('Page not exists: ${page}')
error.pageNotFound = true
error.statusCode = 404
NEXT_PAGE_LOADER.registerPage('${page}', error)
__NEXT_PAGE_LOADER__.registerPage('${page}', error)
}
if (window.NEXT_PAGE_LOADER) {
if (window.__NEXT_PAGE_LOADER__) {
loadPage()
} else {
window.NEXT_LOADED_PAGES = window.NEXT_LOADED_PAGES || []
@ -157,10 +157,10 @@ export async function renderScriptError (req, res, page, error, customFields, op
res.end(`
function loadPage () {
var error = ${JSON.stringify(errorJson)}
NEXT_PAGE_LOADER.registerPage('${page}', error)
__NEXT_PAGE_LOADER__.registerPage('${page}', error)
}
if (window.NEXT_PAGE_LOADER) {
if (window.__NEXT_PAGE_LOADER__) {
loadPage()
} else {
window.NEXT_LOADED_PAGES = window.NEXT_LOADED_PAGES || []