diff --git a/docs/api-reference/next/image.md b/docs/api-reference/next/image.md index 10662adc852594b..423d10c4248272b 100644 --- a/docs/api-reference/next/image.md +++ b/docs/api-reference/next/image.md @@ -49,7 +49,7 @@ export default Home - `width` - The intrinsic width of the source image in pixels. Must be an integer without a unit. Required unless `unsized` is true. - `height` - The intrinsic height of the source image, in pixels. Must be an integer without a unit. Required unless `unsized` is true. - `sizes` - Defines what proportion of the screen you expect the image to take up. Recommended, as it helps serve the correct sized image to each device. [More info](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-sizes). -- `quality` - The quality of the optimized image, an integer between 1 and 100 where 100 is the best quality. Default 100. +- `quality` - The quality of the optimized image, an integer between 1 and 100 where 100 is the best quality. Default 75. - `loading` - The loading behavior. When `lazy`, defer loading the image until it reaches a calculated distance from the viewport. When `eager`, load the image immediately. Default `lazy`. [More info](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading) - `priority` - When true, the image will be considered high priority and [preload](https://web.dev/preload-responsive-images/). - `unoptimized` - When true, the source image will be served as-is instead of resizing and changing quality. diff --git a/lerna.json b/lerna.json index a0c6944976a2327..b9218d314553f18 100644 --- a/lerna.json +++ b/lerna.json @@ -17,5 +17,5 @@ "registry": "https://registry.npmjs.org/" } }, - "version": "9.5.6-canary.16" + "version": "9.5.6-canary.17" } diff --git a/packages/create-next-app/package.json b/packages/create-next-app/package.json index 7757d36353d6a4c..3e8066fab93f818 100644 --- a/packages/create-next-app/package.json +++ b/packages/create-next-app/package.json @@ -1,6 +1,6 @@ { "name": "create-next-app", - "version": "9.5.6-canary.16", + "version": "9.5.6-canary.17", "keywords": [ "react", "next", diff --git a/packages/eslint-plugin-next/package.json b/packages/eslint-plugin-next/package.json index eb85b1a79c23baf..78c343968723617 100644 --- a/packages/eslint-plugin-next/package.json +++ b/packages/eslint-plugin-next/package.json @@ -1,6 +1,6 @@ { "name": "@next/eslint-plugin-next", - "version": "9.5.6-canary.16", + "version": "9.5.6-canary.17", "description": "ESLint plugin for NextJS.", "main": "lib/index.js", "license": "MIT", diff --git a/packages/next-bundle-analyzer/package.json b/packages/next-bundle-analyzer/package.json index 684268d1b806639..238bc217253cf5d 100644 --- a/packages/next-bundle-analyzer/package.json +++ b/packages/next-bundle-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@next/bundle-analyzer", - "version": "9.5.6-canary.16", + "version": "9.5.6-canary.17", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-codemod/package.json b/packages/next-codemod/package.json index 95f3075888b7780..ced740ed60a7ecc 100644 --- a/packages/next-codemod/package.json +++ b/packages/next-codemod/package.json @@ -1,6 +1,6 @@ { "name": "@next/codemod", - "version": "9.5.6-canary.16", + "version": "9.5.6-canary.17", "license": "MIT", "dependencies": { "chalk": "4.1.0", diff --git a/packages/next-env/package.json b/packages/next-env/package.json index 63cc5d7b874ee67..eae997e08f6745c 100644 --- a/packages/next-env/package.json +++ b/packages/next-env/package.json @@ -1,6 +1,6 @@ { "name": "@next/env", - "version": "9.5.6-canary.16", + "version": "9.5.6-canary.17", "keywords": [ "react", "next", diff --git a/packages/next-mdx/package.json b/packages/next-mdx/package.json index cae2904e09559ee..871b14869dd8115 100644 --- a/packages/next-mdx/package.json +++ b/packages/next-mdx/package.json @@ -1,6 +1,6 @@ { "name": "@next/mdx", - "version": "9.5.6-canary.16", + "version": "9.5.6-canary.17", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-plugin-google-analytics/package.json b/packages/next-plugin-google-analytics/package.json index 288f382b1d34830..03e4af29d89a122 100644 --- a/packages/next-plugin-google-analytics/package.json +++ b/packages/next-plugin-google-analytics/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-google-analytics", - "version": "9.5.6-canary.16", + "version": "9.5.6-canary.17", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-google-analytics" diff --git a/packages/next-plugin-sentry/package.json b/packages/next-plugin-sentry/package.json index 77fd3311870368d..e6b1f5ac0ae0764 100644 --- a/packages/next-plugin-sentry/package.json +++ b/packages/next-plugin-sentry/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-sentry", - "version": "9.5.6-canary.16", + "version": "9.5.6-canary.17", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-sentry" diff --git a/packages/next-plugin-storybook/package.json b/packages/next-plugin-storybook/package.json index 3ec335749bc7cf4..81c61e8c52c439f 100644 --- a/packages/next-plugin-storybook/package.json +++ b/packages/next-plugin-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-storybook", - "version": "9.5.6-canary.16", + "version": "9.5.6-canary.17", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-storybook" diff --git a/packages/next-polyfill-module/package.json b/packages/next-polyfill-module/package.json index ebe89716be94879..5f1f4decc64ff1b 100644 --- a/packages/next-polyfill-module/package.json +++ b/packages/next-polyfill-module/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-module", - "version": "9.5.6-canary.16", + "version": "9.5.6-canary.17", "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", diff --git a/packages/next-polyfill-nomodule/package.json b/packages/next-polyfill-nomodule/package.json index 4ab65f6ceec0491..f1d9bb2588ffae8 100644 --- a/packages/next-polyfill-nomodule/package.json +++ b/packages/next-polyfill-nomodule/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-nomodule", - "version": "9.5.6-canary.16", + "version": "9.5.6-canary.17", "description": "A polyfill for non-dead, nomodule browsers.", "main": "dist/polyfill-nomodule.js", "license": "MIT", diff --git a/packages/next/client/image.tsx b/packages/next/client/image.tsx index 78126b4fe97c876..083c26945781b23 100644 --- a/packages/next/client/image.tsx +++ b/packages/next/client/image.tsx @@ -444,5 +444,5 @@ function defaultLoader({ root, src, width, quality }: LoaderProps): string { } } - return `${root}?url=${encodeURIComponent(src)}&w=${width}&q=${quality || 100}` + return `${root}?url=${encodeURIComponent(src)}&w=${width}&q=${quality || 75}` } diff --git a/packages/next/package.json b/packages/next/package.json index 88f4ab1a906b77e..2cc097af730ecf8 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "next", - "version": "9.5.6-canary.16", + "version": "9.5.6-canary.17", "description": "The React Framework", "main": "./dist/server/next.js", "license": "MIT", @@ -79,10 +79,10 @@ "@babel/runtime": "7.11.2", "@babel/types": "7.11.5", "@hapi/accept": "5.0.1", - "@next/env": "9.5.6-canary.16", - "@next/polyfill-module": "9.5.6-canary.16", - "@next/react-dev-overlay": "9.5.6-canary.16", - "@next/react-refresh-utils": "9.5.6-canary.16", + "@next/env": "9.5.6-canary.17", + "@next/polyfill-module": "9.5.6-canary.17", + "@next/react-dev-overlay": "9.5.6-canary.17", + "@next/react-refresh-utils": "9.5.6-canary.17", "ast-types": "0.13.2", "babel-plugin-transform-define": "2.0.0", "babel-plugin-transform-react-remove-prop-types": "0.4.24", @@ -129,7 +129,7 @@ "sharp": "0.26.2" }, "devDependencies": { - "@next/polyfill-nomodule": "9.5.6-canary.16", + "@next/polyfill-nomodule": "9.5.6-canary.17", "@taskr/clear": "1.1.0", "@taskr/esnext": "1.1.0", "@taskr/watch": "1.1.0", diff --git a/packages/react-dev-overlay/package.json b/packages/react-dev-overlay/package.json index ffe0c500fdd57df..9ae126e414dc6e9 100644 --- a/packages/react-dev-overlay/package.json +++ b/packages/react-dev-overlay/package.json @@ -1,6 +1,6 @@ { "name": "@next/react-dev-overlay", - "version": "9.5.6-canary.16", + "version": "9.5.6-canary.17", "description": "A development-only overlay for developing React applications.", "repository": { "url": "vercel/next.js", diff --git a/packages/react-refresh-utils/package.json b/packages/react-refresh-utils/package.json index be6e5b03834718e..56317b293f97f4d 100644 --- a/packages/react-refresh-utils/package.json +++ b/packages/react-refresh-utils/package.json @@ -1,6 +1,6 @@ { "name": "@next/react-refresh-utils", - "version": "9.5.6-canary.16", + "version": "9.5.6-canary.17", "description": "An experimental package providing utilities for React Refresh.", "repository": { "url": "vercel/next.js", diff --git a/test/integration/image-component/default/test/index.test.js b/test/integration/image-component/default/test/index.test.js index c2c62f141278025..c2c6eda216076c6 100644 --- a/test/integration/image-component/default/test/index.test.js +++ b/test/integration/image-component/default/test/index.test.js @@ -22,6 +22,19 @@ const nextConfig = join(appDir, 'next.config.js') let appPort let app +async function hasImageMatchingUrl(browser, url) { + const links = await browser.elementsByCss('img') + let foundMatch = false + for (const link of links) { + const src = await link.getAttribute('src') + if (src === url) { + foundMatch = true + break + } + } + return foundMatch +} + function runTests(mode) { it('should load the images', async () => { let browser @@ -54,6 +67,16 @@ function runTests(mode) { return 'result-correct' }, /result-correct/) + + expect( + await hasImageMatchingUrl( + browser, + mode === 'serverless' + ? // FIXME: this is a bug + `http://localhost:${appPort}/_next/image/?url=%2Ftest.jpg&w=420&q=75` + : `http://localhost:${appPort}/_next/image?url=%2Ftest.jpg&w=420&q=75` + ) + ).toBe(true) } finally { if (browser) { await browser.close()