Skip to content

Commit

Permalink
Merge branch 'canary' into regexpescape
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Nov 30, 2021
2 parents 2c9faa4 + d2cef24 commit e19fb11
Show file tree
Hide file tree
Showing 17 changed files with 188 additions and 162 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"lint-staged": "lint-staged",
"next-with-deps": "./scripts/next-with-deps.sh",
"next": "node --trace-deprecation --enable-source-maps packages/next/dist/bin/next",
"next-react-18": "node --trace-deprecation --enable-source-maps -r ./test/integration/react-18/test/require-hook.js packages/next/dist/bin/next",
"next-no-sourcemaps": "node --trace-deprecation packages/next/dist/bin/next",
"clean-trace-jaeger": "rm -rf test/integration/basic/.next && TRACE_TARGET=JAEGER node --trace-deprecation --enable-source-maps packages/next/dist/bin/next build test/integration/basic",
"debug": "node --inspect packages/next/dist/bin/next",
Expand Down Expand Up @@ -138,9 +139,9 @@
"pretty-ms": "7.0.0",
"random-seed": "0.3.0",
"react": "17.0.2",
"react-18": "npm:[email protected]alpha-13455d26d-20211104",
"react-18": "npm:[email protected]beta-0cc724c77-20211125",
"react-dom": "17.0.2",
"react-dom-18": "npm:[email protected]alpha-13455d26d-20211104",
"react-dom-18": "npm:[email protected]beta-0cc724c77-20211125",
"react-ssr-prepass": "1.0.8",
"release": "6.3.0",
"request-promise-core": "1.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ export function getPageHandler(ctx: ServerlessHandlerCtx) {
locale: detectedLocale,
defaultLocale,
domainLocales: i18n?.domains,
optimizeImages: process.env.__NEXT_OPTIMIZE_IMAGES,
optimizeCss: process.env.__NEXT_OPTIMIZE_CSS,
concurrentFeatures: process.env.__NEXT_CONCURRENT_FEATURES,
crossOrigin: process.env.__NEXT_CROSS_ORIGIN,
},
options
)
Expand Down
19 changes: 14 additions & 5 deletions packages/next/client/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,18 @@ export default function Image({
}
}

let imageSrcSetPropName = 'imagesrcset'
let imageSizesPropName = 'imagesizes'
if (process.env.__NEXT_REACT_ROOT) {
imageSrcSetPropName = 'imageSrcSet'
imageSizesPropName = 'imageSizes'
}
const linkProps = {
// Note: imagesrcset and imagesizes are not in the link element type with react 17.
[imageSrcSetPropName]: imgAttributes.srcSet,
[imageSizesPropName]: imgAttributes.sizes,
}

return (
<span style={wrapperStyle}>
{hasSizer ? (
Expand Down Expand Up @@ -716,11 +728,8 @@ export default function Image({
rel="preload"
as="image"
href={imgAttributes.srcSet ? undefined : imgAttributes.src}
// @ts-ignore: imagesrcset is not yet in the link element type.
imagesrcset={imgAttributes.srcSet}
// @ts-ignore: imagesizes is not yet in the link element type.
imagesizes={imgAttributes.sizes}
></link>
{...linkProps}
/>
</Head>
) : null}
</span>
Expand Down
4 changes: 4 additions & 0 deletions packages/next/export/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,10 @@ export default async function exportApp(
// Exported pages do not currently support dynamic HTML.
supportsDynamicHTML: false,
concurrentFeatures: nextConfig.experimental.concurrentFeatures,
crossOrigin: nextConfig.crossOrigin,
optimizeCss: nextConfig.experimental.optimizeCss,
optimizeFonts: nextConfig.optimizeFonts,
optimizeImages: nextConfig.experimental.optimizeImages,
}

const { serverRuntimeConfig, publicRuntimeConfig } = nextConfig
Expand Down
Loading

0 comments on commit e19fb11

Please sign in to comment.