Skip to content

Commit

Permalink
Merge branch 'canary' into swc-up-3
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Mar 18, 2022
2 parents 8e07917 + f62766f commit 7a54f6a
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 25 deletions.
2 changes: 1 addition & 1 deletion examples/with-redux-saga/reducer.js
Expand Up @@ -9,7 +9,7 @@ const initialState = {
placeholderData: null,
}

function reducer(state, action) {
function reducer(state = initialState, action) {
switch (action.type) {
case HYDRATE: {
return { ...state, ...action.payload }
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "12.1.1-canary.14"
"version": "12.1.1-canary.15"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "12.1.1-canary.14",
"version": "12.1.1-canary.15",
"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.1.1-canary.14",
"version": "12.1.1-canary.15",
"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.14",
"@next/eslint-plugin-next": "12.1.1-canary.15",
"@rushstack/eslint-patch": "1.0.8",
"@typescript-eslint/parser": "5.10.1",
"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.1.1-canary.14",
"version": "12.1.1-canary.15",
"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.1.1-canary.14",
"version": "12.1.1-canary.15",
"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.1.1-canary.14",
"version": "12.1.1-canary.15",
"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.1.1-canary.14",
"version": "12.1.1-canary.15",
"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.1.1-canary.14",
"version": "12.1.1-canary.15",
"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.1.1-canary.14",
"version": "12.1.1-canary.15",
"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.1.1-canary.14",
"version": "12.1.1-canary.15",
"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.1.1-canary.14",
"version": "12.1.1-canary.15",
"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.1.1-canary.14",
"version": "12.1.1-canary.15",
"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.1.1-canary.14",
"version": "12.1.1-canary.15",
"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.14",
"@next/env": "12.1.1-canary.15",
"caniuse-lite": "^1.0.30001283",
"postcss": "8.4.5",
"styled-jsx": "5.0.1",
Expand Down Expand Up @@ -118,11 +118,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.14",
"@next/polyfill-nomodule": "12.1.1-canary.14",
"@next/react-dev-overlay": "12.1.1-canary.14",
"@next/react-refresh-utils": "12.1.1-canary.14",
"@next/swc": "12.1.1-canary.14",
"@next/polyfill-module": "12.1.1-canary.15",
"@next/polyfill-nomodule": "12.1.1-canary.15",
"@next/react-dev-overlay": "12.1.1-canary.15",
"@next/react-refresh-utils": "12.1.1-canary.15",
"@next/swc": "12.1.1-canary.15",
"@peculiar/webcrypto": "1.3.1",
"@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0",
Expand Down
9 changes: 7 additions & 2 deletions packages/next/pages/_document.tsx
Expand Up @@ -19,7 +19,7 @@ export { DocumentContext, DocumentInitialProps, DocumentProps }
export type OriginProps = {
nonce?: string
crossOrigin?: string
children?: React.ReactElement
children?: React.ReactNode
}

type DocumentFiles = {
Expand Down Expand Up @@ -72,6 +72,10 @@ function getPolyfillScripts(context: HtmlProps, props: OriginProps) {
))
}

function hasComponentProps(child: any): child is React.ReactElement {
return !!child && !!child.props
}

function getPreNextWorkerScripts(context: HtmlProps, props: OriginProps) {
const { assetPrefix, scriptLoader, crossOrigin, nextScriptWorkers } = context

Expand All @@ -88,7 +92,8 @@ function getPreNextWorkerScripts(context: HtmlProps, props: OriginProps) {

// Check to see if the user has defined their own Partytown configuration
const userDefinedConfig = children.find(
(child: React.ReactElement) =>
(child) =>
hasComponentProps(child) &&
child?.props?.dangerouslySetInnerHTML?.__html.length &&
'data-partytown-config' in child.props
)
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.1.1-canary.14",
"version": "12.1.1-canary.15",
"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.1.1-canary.14",
"version": "12.1.1-canary.15",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
Expand Down
16 changes: 16 additions & 0 deletions test/production/typescript-basic/app/pages/_document.tsx
@@ -0,0 +1,16 @@
import { Html, Head, Main, NextScript } from 'next/document'

export default function Document() {
return (
<Html>
<Head>
<meta property="og:url" content="https://nextjs.org/docs" />
<meta name="theme-color" content="#ffffff" />
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
}

0 comments on commit 7a54f6a

Please sign in to comment.