Skip to content

Commit

Permalink
Merge branch 'canary' into fix/cache-preload-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Nov 22, 2022
2 parents ea79152 + ef7a6e1 commit 8a4fdab
Show file tree
Hide file tree
Showing 26 changed files with 54 additions and 50 deletions.
2 changes: 1 addition & 1 deletion examples/with-msw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start": "next start"
},
"dependencies": {
"msw": "0.47.3",
"msw": "^0.49.0",
"next": "latest",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
6 changes: 3 additions & 3 deletions examples/with-passport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"cookie": "0.4.1",
"next": "latest",
"next-connect": "0.8.1",
"passport": "0.4.1",
"passport-local": "1.0.0",
"passport": "^0.4.1",
"passport-local": "^1.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"swr": "^0.5.5",
"swr": "^1.3.0",
"uuid": "8.3.1"
}
}
2 changes: 1 addition & 1 deletion examples/with-redux-wrapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start": "next start"
},
"dependencies": {
"next": "9.4.1",
"next": "latest",
"next-redux-wrapper": "^7.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
3 changes: 2 additions & 1 deletion examples/with-styled-components-babel/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { AppProps } from 'next/app'
import { createGlobalStyle, ThemeProvider } from 'styled-components'

const GlobalStyle = createGlobalStyle`
Expand All @@ -20,7 +21,7 @@ const theme: ThemeInterface = {
},
}

export default function App({ Component, pageProps }) {
export default function App({ Component, pageProps }: AppProps) {
return (
<>
<GlobalStyle />
Expand Down
11 changes: 6 additions & 5 deletions examples/with-supertokens/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ export async function getServerSideProps(context) {
supertokensNode.init(backendConfig())
let session
try {
session = await Session.getSession(context.req, context.res)
session = await Session.getSession(context.req, context.res, {
overrideGlobalClaimValidators: async function () {
return []
},
})
} catch (err) {
if (err.type === Session.Error.TRY_REFRESH_TOKEN) {
return { props: { fromSupertokens: 'needs-refresh' } }
} else if (err.type === Session.Error.UNAUTHORISED) {
// this will force the frontend to try and refresh which will fail
// clearing all cookies and redirecting the user to the login screen.
return { props: { fromSupertokens: 'needs-refresh' } }
} else if (err.type === Session.Error.INVALID_CLAIMS) {
return { props: {} }
} else {
throw err
}
throw err
}

return {
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.0.5-canary.3"
"version": "13.0.5-canary.4"
}
4 changes: 3 additions & 1 deletion packages/create-next-app/helpers/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ export async function downloadAndExtractRepo(
strip: filePath ? filePath.split('/').length + 1 : 1,
filter: (p) =>
p.startsWith(
`${name}-${branch.replace(/\//g, '-')}${filePath ? `/${filePath}` : ''}`
`${name}-${branch.replace(/\//g, '-')}${
filePath ? `/${filePath}/` : '/'
}`
),
})

Expand Down
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.0.5-canary.3",
"version": "13.0.5-canary.4",
"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.0.5-canary.3",
"version": "13.0.5-canary.4",
"description": "ESLint configuration used by NextJS.",
"main": "index.js",
"license": "MIT",
Expand All @@ -9,7 +9,7 @@
"directory": "packages/eslint-config-next"
},
"dependencies": {
"@next/eslint-plugin-next": "13.0.5-canary.3",
"@next/eslint-plugin-next": "13.0.5-canary.4",
"@rushstack/eslint-patch": "^1.1.3",
"@typescript-eslint/parser": "^5.42.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.0.5-canary.3",
"version": "13.0.5-canary.4",
"description": "ESLint plugin for NextJS.",
"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.0.5-canary.3",
"version": "13.0.5-canary.4",
"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.0.5-canary.3",
"version": "13.0.5-canary.4",
"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.0.5-canary.3",
"version": "13.0.5-canary.4",
"license": "MIT",
"dependencies": {
"chalk": "4.1.0",
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.0.5-canary.3",
"version": "13.0.5-canary.4",
"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.0.5-canary.3",
"version": "13.0.5-canary.4",
"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.0.5-canary.3",
"version": "13.0.5-canary.4",
"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.0.5-canary.3",
"version": "13.0.5-canary.4",
"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.0.5-canary.3",
"version": "13.0.5-canary.4",
"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.0.5-canary.3",
"version": "13.0.5-canary.4",
"private": true,
"scripts": {
"build-native": "napi build --platform -p next-swc-napi --cargo-name next_swc_napi --features plugin --js false native",
Expand Down
4 changes: 2 additions & 2 deletions packages/next/build/webpack/plugins/flight-types-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ interface LayoutProps {
params: any
}
type PageComponent = (props: PageProps) => React.ReactNode | Promise<React.ReactNode>
type LayoutComponent = (props: LayoutProps) => React.ReactNode | Promise<React.ReactNode>
export type PageComponent = (props: PageProps) => React.ReactNode | Promise<React.ReactNode>
export type LayoutComponent = (props: LayoutProps) => React.ReactNode | Promise<React.ReactNode>
interface IEntry {
${
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function tryApplyUpdates(
return
}

function handleApplyUpdates(err: any, updatedModules: any) {
function handleApplyUpdates(err: any, updatedModules: any[] | null) {
if (err || RuntimeErrorHandler.hadRuntimeError || !updatedModules) {
if (err) {
console.warn(
Expand All @@ -144,7 +144,7 @@ function tryApplyUpdates(
return
}

const hasUpdates = Boolean(updatedModules.length)
const hasUpdates = Boolean(updatedModules?.length)
if (typeof onHotUpdateSuccess === 'function') {
// Maybe we want to do something.
onHotUpdateSuccess(hasUpdates)
Expand Down Expand Up @@ -175,8 +175,8 @@ function tryApplyUpdates(
// @ts-expect-error module.hot exists
module.hot
.check(/* autoApply */ false)
.then((updatedModules: any) => {
const hasUpdates = Boolean(updatedModules.length)
.then((updatedModules: any[] | null) => {
const hasUpdates = Boolean(updatedModules?.length)
if (typeof onBeforeUpdate === 'function') {
onBeforeUpdate(hasUpdates)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/next/client/dev/error-overlay/hot-dev-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ function tryApplyUpdates(onBeforeHotUpdate, onHotUpdateSuccess) {
return
}

const hasUpdates = Boolean(updatedModules.length)
const hasUpdates = Boolean(updatedModules?.length)
if (typeof onHotUpdateSuccess === 'function') {
// Maybe we want to do something.
onHotUpdateSuccess(hasUpdates)
Expand Down Expand Up @@ -368,7 +368,7 @@ function tryApplyUpdates(onBeforeHotUpdate, onHotUpdateSuccess) {
.check(/* autoApply */ false)
.then((updatedModules) => {
if (typeof onBeforeHotUpdate === 'function') {
const hasUpdates = Boolean(updatedModules.length)
const hasUpdates = Boolean(updatedModules?.length)
onBeforeHotUpdate(hasUpdates)
}
return module.hot.apply()
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.0.5-canary.3",
"version": "13.0.5-canary.4",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -75,7 +75,7 @@
]
},
"dependencies": {
"@next/env": "13.0.5-canary.3",
"@next/env": "13.0.5-canary.4",
"@swc/helpers": "0.4.14",
"caniuse-lite": "^1.0.30001406",
"postcss": "8.4.14",
Expand Down Expand Up @@ -126,11 +126,11 @@
"@hapi/accept": "5.0.2",
"@napi-rs/cli": "2.12.0",
"@napi-rs/triples": "1.1.0",
"@next/polyfill-module": "13.0.5-canary.3",
"@next/polyfill-nomodule": "13.0.5-canary.3",
"@next/react-dev-overlay": "13.0.5-canary.3",
"@next/react-refresh-utils": "13.0.5-canary.3",
"@next/swc": "13.0.5-canary.3",
"@next/polyfill-module": "13.0.5-canary.4",
"@next/polyfill-nomodule": "13.0.5-canary.4",
"@next/react-dev-overlay": "13.0.5-canary.4",
"@next/react-refresh-utils": "13.0.5-canary.4",
"@next/swc": "13.0.5-canary.4",
"@segment/ajv-human-errors": "2.1.2",
"@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0",
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.0.5-canary.3",
"version": "13.0.5-canary.4",
"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.0.5-canary.3",
"version": "13.0.5-canary.4",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
Expand Down
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

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

0 comments on commit 8a4fdab

Please sign in to comment.