Skip to content

Commit

Permalink
Stop exposing internal render and renderError methods from `next/…
Browse files Browse the repository at this point in the history
…client` (vercel#34069)

These should no longer need to be exposed.
  • Loading branch information
devknoll authored and natew committed Feb 16, 2022
1 parent faa0bae commit 130cd5c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/next/client/index.tsx
Expand Up @@ -434,7 +434,7 @@ export async function initNext(
render(renderCtx)
}

export async function render(renderingProps: RenderRouteInfo): Promise<void> {
async function render(renderingProps: RenderRouteInfo): Promise<void> {
if (renderingProps.err) {
await renderError(renderingProps)
return
Expand Down Expand Up @@ -462,7 +462,7 @@ export async function render(renderingProps: RenderRouteInfo): Promise<void> {
// This method handles all runtime and debug errors.
// 404 and 500 errors are special kind of errors
// and they are still handle via the main render method.
export function renderError(renderErrorProps: RenderErrorProps): Promise<any> {
function renderError(renderErrorProps: RenderErrorProps): Promise<any> {
const { App, err } = renderErrorProps

// In development runtime errors are caught by our overlay
Expand Down
4 changes: 1 addition & 3 deletions packages/next/client/next-dev.js
@@ -1,4 +1,4 @@
import { initNext, version, router, emitter, render, renderError } from './'
import { initNext, version, router, emitter } from './'
import initOnDemandEntries from './dev/on-demand-entries-client'
import initWebpackHMR from './dev/webpack-hot-middleware-client'
import initializeBuildWatcher from './dev/dev-build-watcher'
Expand Down Expand Up @@ -44,8 +44,6 @@ window.next = {
return router
},
emitter,
render,
renderError,
}
initNext({ webpackHMR, beforeRender: displayContent })
.then(() => {
Expand Down
4 changes: 1 addition & 3 deletions packages/next/client/next.js
@@ -1,4 +1,4 @@
import { initNext, version, router, emitter, render, renderError } from './'
import { initNext, version, router, emitter } from './'

window.next = {
version,
Expand All @@ -7,8 +7,6 @@ window.next = {
return router
},
emitter,
render,
renderError,
}

initNext().catch(console.error)

0 comments on commit 130cd5c

Please sign in to comment.