Skip to content

Commit

Permalink
Merge branch 'canary' into fix/minimal-mode-streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] committed Feb 11, 2022
2 parents 8a7f741 + 516e113 commit 957ae00
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 32 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "12.0.11-canary.12"
"version": "12.0.11-canary.13"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "12.0.11-canary.12",
"version": "12.0.11-canary.13",
"keywords": [
"react",
"next",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "12.0.11-canary.12",
"version": "12.0.11-canary.13",
"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": "12.0.11-canary.12",
"@next/eslint-plugin-next": "12.0.11-canary.13",
"@rushstack/eslint-patch": "^1.0.8",
"@typescript-eslint/parser": "^5.0.0",
"eslint-import-resolver-node": "^0.3.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "12.0.11-canary.12",
"version": "12.0.11-canary.13",
"description": "ESLint plugin for NextJS.",
"main": "lib/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "12.0.11-canary.12",
"version": "12.0.11-canary.13",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "12.0.11-canary.12",
"version": "12.0.11-canary.13",
"license": "MIT",
"dependencies": {
"chalk": "4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "12.0.11-canary.12",
"version": "12.0.11-canary.13",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "12.0.11-canary.12",
"version": "12.0.11-canary.13",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "12.0.11-canary.12",
"version": "12.0.11-canary.13",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "12.0.11-canary.12",
"version": "12.0.11-canary.13",
"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
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "12.0.11-canary.12",
"version": "12.0.11-canary.13",
"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
@@ -1,6 +1,6 @@
{
"name": "@next/swc",
"version": "12.0.11-canary.12",
"version": "12.0.11-canary.13",
"private": true,
"scripts": {
"build-native": "napi build --platform --cargo-name next_swc_napi native",
Expand Down
14 changes: 7 additions & 7 deletions packages/next/package.json
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "12.0.11-canary.12",
"version": "12.0.11-canary.13",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -69,7 +69,7 @@
]
},
"dependencies": {
"@next/env": "12.0.11-canary.12",
"@next/env": "12.0.11-canary.13",
"caniuse-lite": "^1.0.30001283",
"postcss": "8.4.5",
"styled-jsx": "5.0.0",
Expand Down Expand Up @@ -117,11 +117,11 @@
"@hapi/accept": "5.0.2",
"@napi-rs/cli": "1.2.1",
"@napi-rs/triples": "1.0.3",
"@next/polyfill-module": "12.0.11-canary.12",
"@next/polyfill-nomodule": "12.0.11-canary.12",
"@next/react-dev-overlay": "12.0.11-canary.12",
"@next/react-refresh-utils": "12.0.11-canary.12",
"@next/swc": "12.0.11-canary.12",
"@next/polyfill-module": "12.0.11-canary.13",
"@next/polyfill-nomodule": "12.0.11-canary.13",
"@next/react-dev-overlay": "12.0.11-canary.13",
"@next/react-refresh-utils": "12.0.11-canary.13",
"@next/swc": "12.0.11-canary.13",
"@peculiar/webcrypto": "1.1.7",
"@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0",
Expand Down
31 changes: 22 additions & 9 deletions packages/next/server/image-optimizer.ts
Expand Up @@ -240,14 +240,18 @@ export class ImageOptimizerCache {
Math.max(revalidate, this.nextConfig.images.minimumCacheTTL) * 1000 +
Date.now()

await writeToCacheDir(
join(this.cacheDir, cacheKey),
value.extension,
revalidate,
expireAt,
value.buffer,
value.etag
)
try {
await writeToCacheDir(
join(this.cacheDir, cacheKey),
value.extension,
revalidate,
expireAt,
value.buffer,
value.etag
)
} catch (err) {
console.error(`Failed to write image to cache ${cacheKey}`, err)
}
}
}
export class ImageError extends Error {
Expand Down Expand Up @@ -543,7 +547,16 @@ async function writeToCacheDir(
etag: string
) {
const filename = join(dir, `${maxAge}.${expireAt}.${etag}.${extension}`)
await promises.rmdir(dir, { recursive: true })

// Added in: v14.14.0 https://nodejs.org/api/fs.html#fspromisesrmpath-options
// attempt cleaning up existing stale cache
if ((promises as any).rm) {
await (promises as any)
.rm(dir, { force: true, recursive: true })
.catch(() => {})
} else {
await promises.rmdir(dir, { recursive: true }).catch(() => {})
}
await promises.mkdir(dir, { recursive: true })
await promises.writeFile(filename, buffer)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/next/server/next-server.ts
Expand Up @@ -1335,7 +1335,7 @@ export default class NextNodeServer extends BaseServer {

if (missingKeys.length > 0) {
Log.warn(
`Query params are no longer automatically merged for rewrites in middleware, see more info here: https://nextjs.org/docs/messages/errors/deleting-query-params-in-middlewares`
`Query params are no longer automatically merged for rewrites in middleware, see more info here: https://nextjs.org/docs/messages/deleting-query-params-in-middlewares`
)
this.warnIfQueryParametersWereDeleted = () => {}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dev-overlay/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/react-dev-overlay",
"version": "12.0.11-canary.12",
"version": "12.0.11-canary.13",
"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
@@ -1,6 +1,6 @@
{
"name": "@next/react-refresh-utils",
"version": "12.0.11-canary.12",
"version": "12.0.11-canary.13",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
Expand Down

0 comments on commit 957ae00

Please sign in to comment.