Skip to content

Commit

Permalink
Merge branch 'canary' into feat/update-fauna-fql-10
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadid12 authored Oct 4, 2023
2 parents d4b2d0b + 28767ad commit b98372e
Show file tree
Hide file tree
Showing 24 changed files with 65 additions and 51 deletions.
2 changes: 1 addition & 1 deletion docs/02-app/02-api-reference/04-functions/redirect.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: API Reference for the redirect function.

The `redirect` function allows you to redirect the user to another URL. `redirect` can be used in Server Components, Client Components, [Route Handlers](/docs/app/building-your-application/routing/route-handlers), and [Server Actions](/docs/app/building-your-application/data-fetching/forms-and-mutations).

When used in a streaming context, this will insert a meta tag to emit the redirect on the client side. Otherwise, it will serve a 307 HTTP redirect response to the caller.
When used in a [streaming context](/docs/app/building-your-application/routing/loading-ui-and-streaming#what-is-streaming), this will insert a meta tag to emit the redirect on the client side. Otherwise, it will serve a 307 HTTP redirect response to the caller.

If a resource doesn't exist, you can use the [`notFound` function](/docs/app/api-reference/functions/not-found) instead.

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "13.5.5-canary.0"
"version": "13.5.5-canary.1"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "13.5.5-canary.0",
"version": "13.5.5-canary.1",
"keywords": [
"react",
"next",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "13.5.5-canary.0",
"version": "13.5.5-canary.1",
"description": "ESLint configuration used by Next.js.",
"main": "index.js",
"license": "MIT",
Expand All @@ -10,7 +10,7 @@
},
"homepage": "https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-config",
"dependencies": {
"@next/eslint-plugin-next": "13.5.5-canary.0",
"@next/eslint-plugin-next": "13.5.5-canary.1",
"@rushstack/eslint-patch": "^1.3.3",
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0",
"eslint-import-resolver-node": "^0.3.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "13.5.5-canary.0",
"version": "13.5.5-canary.1",
"description": "ESLint plugin for Next.js.",
"main": "dist/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/font/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/font",
"version": "13.5.5-canary.0",
"version": "13.5.5-canary.1",
"repository": {
"url": "vercel/next.js",
"directory": "packages/font"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "13.5.5-canary.0",
"version": "13.5.5-canary.1",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "13.5.5-canary.0",
"version": "13.5.5-canary.1",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "13.5.5-canary.0",
"version": "13.5.5-canary.1",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "13.5.5-canary.0",
"version": "13.5.5-canary.1",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "13.5.5-canary.0",
"version": "13.5.5-canary.1",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "13.5.5-canary.0",
"version": "13.5.5-canary.1",
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
"main": "dist/polyfill-module.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "13.5.5-canary.0",
"version": "13.5.5-canary.1",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/swc",
"version": "13.5.5-canary.0",
"version": "13.5.5-canary.1",
"private": true,
"scripts": {
"clean": "node ../../scripts/rm.mjs native",
Expand Down
14 changes: 7 additions & 7 deletions packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "13.5.5-canary.0",
"version": "13.5.5-canary.1",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -90,7 +90,7 @@
]
},
"dependencies": {
"@next/env": "13.5.5-canary.0",
"@next/env": "13.5.5-canary.1",
"@swc/helpers": "0.5.2",
"busboy": "1.6.0",
"caniuse-lite": "^1.0.30001406",
Expand Down Expand Up @@ -144,11 +144,11 @@
"@mswjs/interceptors": "0.23.0",
"@napi-rs/cli": "2.16.2",
"@napi-rs/triples": "1.1.0",
"@next/polyfill-module": "13.5.5-canary.0",
"@next/polyfill-nomodule": "13.5.5-canary.0",
"@next/react-dev-overlay": "13.5.5-canary.0",
"@next/react-refresh-utils": "13.5.5-canary.0",
"@next/swc": "13.5.5-canary.0",
"@next/polyfill-module": "13.5.5-canary.1",
"@next/polyfill-nomodule": "13.5.5-canary.1",
"@next/react-dev-overlay": "13.5.5-canary.1",
"@next/react-refresh-utils": "13.5.5-canary.1",
"@next/swc": "13.5.5-canary.1",
"@opentelemetry/api": "1.4.1",
"@playwright/test": "^1.35.1",
"@segment/ajv-human-errors": "2.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const nextEdgeFunctionLoader: webpack.LoaderDefinitionFunction<EdgeFunctionLoade
throw new Error('The Edge Function "pages${page}" must export a \`default\` function');
}
export default function (opts) {
export default function nHandler (opts) {
return adapter({
...opts,
IncrementalCache,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,6 @@ const edgeSSRLoader: webpack.LoaderDefinitionFunction<EdgeSSRLoaderQuery> =
}
const nextFontManifest = maybeJSONParse(self.__NEXT_FONT_MANIFEST)
globalThis.__next_private_global_wait_until__ = []
const render = getRender({
pagesType,
dev: ${dev},
Expand Down Expand Up @@ -257,22 +255,12 @@ const edgeSSRLoader: webpack.LoaderDefinitionFunction<EdgeSSRLoaderQuery> =
export const ComponentMod = pageMod
export default async function(opts, event) {
const res = await adapter({
export default function nHandler (opts, event) {
return adapter({
...opts,
IncrementalCache,
handler: render
})
if (event && event.waitUntil) {
event.waitUntil(
Promise.all(
[res?.waitUntil, ...globalThis.__next_private_global_wait_until__]
)
)
}
return res
}`

return transformed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { BuildManifest } from '../../../../server/get-page-files'
import type { ReactLoadableManifest } from '../../../../server/load-components'
import type { ClientReferenceManifest } from '../../plugins/flight-manifest-plugin'
import type { NextFontManifest } from '../../plugins/next-font-manifest-plugin'
import type { NextFetchEvent } from '../../../../server/web/spec-extension/fetch-event'

import WebServer from '../../../../server/web-server'
import {
Expand All @@ -16,6 +17,15 @@ import { PrerenderManifest } from '../../..'
import { normalizeAppPath } from '../../../../shared/lib/router/utils/app-paths'
import { SizeLimit } from '../../../../../types'

const NEXT_PRIVATE_GLOBAL_WAIT_UNTIL = Symbol.for(
'__next_private_global_wait_until__'
)

// @ts-ignore
globalThis[NEXT_PRIVATE_GLOBAL_WAIT_UNTIL] =
// @ts-ignore
globalThis[NEXT_PRIVATE_GLOBAL_WAIT_UNTIL] || []

export function getRender({
dev,
page,
Expand Down Expand Up @@ -143,13 +153,20 @@ export function getRender({

const handler = server.getRequestHandler()

return async function render(request: Request) {
return async function render(request: Request, event: NextFetchEvent) {
const extendedReq = new WebNextRequest(request)
const extendedRes = new WebNextResponse()

handler(extendedReq, extendedRes)
const result = await extendedRes.toResponse()

if (event && event.waitUntil) {
event.waitUntil(
// @ts-ignore
Promise.all([...globalThis[NEXT_PRIVATE_GLOBAL_WAIT_UNTIL]])
)
}

// fetchMetrics is attached to the web request that going through the server,
// wait for the handler result is ready and attach it back to the original request.
;(request as any).fetchMetrics = extendedReq.fetchMetrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default function middlewareLoader(this: any) {
throw new Error('The Middleware "pages${page}" must export a \`middleware\` or a \`default\` function');
}
export default function (opts) {
export default function nHandler(opts) {
return adapter({
...opts,
page: ${JSON.stringify(page)},
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dev-overlay/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/react-dev-overlay",
"version": "13.5.5-canary.0",
"version": "13.5.5-canary.1",
"description": "A development-only overlay for developing React applications.",
"repository": {
"url": "vercel/next.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-refresh-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/react-refresh-utils",
"version": "13.5.5-canary.0",
"version": "13.5.5-canary.1",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/third-parties/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/third-parties",
"version": "13.5.5-canary.0",
"version": "13.5.5-canary.1",
"private": true,
"repository": {
"url": "vercel/next.js",
Expand All @@ -23,7 +23,7 @@
"third-party-capital": "1.0.20"
},
"devDependencies": {
"next": "13.5.5-canary.0",
"next": "13.5.5-canary.1",
"outdent": "0.8.0",
"prettier": "2.5.1"
},
Expand Down
16 changes: 8 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions test/e2e/app-dir/app/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ createNextDescribe(
},
({ next, isNextDev: isDev, isNextStart, isNextDeploy }) => {
if (isNextStart && !process.env.NEXT_EXPERIMENTAL_COMPILE) {
it('should not have loader generated function for edge runtime', async () => {
expect(
await next.readFile('.next/server/app/dashboard/page.js')
).not.toContain('_stringifiedConfig')
expect(await next.readFile('.next/server/middleware.js')).not.toContain(
'_middlewareConfig'
)
})

it('should use RSC prefetch data from build', async () => {
expect(
await next.readFile('.next/server/app/linking.prefetch.rsc')
Expand Down

0 comments on commit b98372e

Please sign in to comment.