Skip to content

Commit

Permalink
Merge branch 'canary' into shu/8af8
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Mar 2, 2022
2 parents c32f72b + 1b17070 commit c70beed
Show file tree
Hide file tree
Showing 17 changed files with 56 additions and 23 deletions.
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": "12.1.1-canary.5"
"version": "12.1.1-canary.6"
}
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": "12.1.1-canary.5",
"version": "12.1.1-canary.6",
"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": "12.1.1-canary.5",
"version": "12.1.1-canary.6",
"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.1.1-canary.5",
"@next/eslint-plugin-next": "12.1.1-canary.6",
"@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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "12.1.1-canary.5",
"version": "12.1.1-canary.6",
"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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "12.1.1-canary.5",
"version": "12.1.1-canary.6",
"main": "index.js",
"license": "MIT",
"repository": {
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": "12.1.1-canary.5",
"version": "12.1.1-canary.6",
"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": "12.1.1-canary.5",
"version": "12.1.1-canary.6",
"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": "12.1.1-canary.5",
"version": "12.1.1-canary.6",
"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": "12.1.1-canary.5",
"version": "12.1.1-canary.6",
"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": "12.1.1-canary.5",
"version": "12.1.1-canary.6",
"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": "12.1.1-canary.5",
"version": "12.1.1-canary.6",
"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": "12.1.1-canary.5",
"version": "12.1.1-canary.6",
"private": true,
"scripts": {
"build-native": "napi build --platform --cargo-name next_swc_napi native",
Expand Down
2 changes: 1 addition & 1 deletion packages/next/client/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ export default function Image({
ref={imgRef}
style={{ ...imgStyle, ...blurStyle }}
/>
{isLazy && (
{(isLazy || placeholder === 'blur') && (
<noscript>
<img
{...rest}
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": "12.1.1-canary.5",
"version": "12.1.1-canary.6",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -69,7 +69,7 @@
]
},
"dependencies": {
"@next/env": "12.1.1-canary.5",
"@next/env": "12.1.1-canary.6",
"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": "2.4.4",
"@napi-rs/triples": "1.1.0",
"@next/polyfill-module": "12.1.1-canary.5",
"@next/polyfill-nomodule": "12.1.1-canary.5",
"@next/react-dev-overlay": "12.1.1-canary.5",
"@next/react-refresh-utils": "12.1.1-canary.5",
"@next/swc": "12.1.1-canary.5",
"@next/polyfill-module": "12.1.1-canary.6",
"@next/polyfill-nomodule": "12.1.1-canary.6",
"@next/react-dev-overlay": "12.1.1-canary.6",
"@next/react-refresh-utils": "12.1.1-canary.6",
"@next/swc": "12.1.1-canary.6",
"@peculiar/webcrypto": "1.1.7",
"@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": "12.1.1-canary.5",
"version": "12.1.1-canary.6",
"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": "12.1.1-canary.5",
"version": "12.1.1-canary.6",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
Expand Down
33 changes: 33 additions & 0 deletions test/unit/image-rendering.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,37 @@ describe('Image rendering', () => {
expect($2('noscript').length).toBe(0)
expect($lazy('noscript').length).toBe(1)
})

it('should render noscript element when placeholder=blur', async () => {
const element1 = React.createElement(Image, {
src: '/test.png',
width: 100,
height: 100,
loading: 'eager',
placeholder: 'blur',
blurDataURL: 'data:image/png;base64',
})
const element2 = React.createElement(Image, {
src: '/test.png',
width: 100,
height: 100,
placeholder: 'blur',
blurDataURL: 'data:image/png;base64',
loading: 'eager',
})
const element3 = React.createElement(Image, {
src: '/test.png',
width: 100,
height: 100,
placeholder: 'blur',
blurDataURL: 'data:image/png;base64',
priority: true,
})
const $1 = cheerio.load(ReactDOM.renderToString(element1))
const $2 = cheerio.load(ReactDOM.renderToString(element2))
const $3 = cheerio.load(ReactDOM.renderToString(element3))
expect($1('noscript').length).toBe(1)
expect($2('noscript').length).toBe(1)
expect($3('noscript').length).toBe(1)
})
})

0 comments on commit c70beed

Please sign in to comment.