Skip to content

Commit

Permalink
Merge branch 'canary' of github.com:vercel/next.js into add/jaeger-im…
Browse files Browse the repository at this point in the history
…provements

# Conflicts:
#	packages/next/telemetry/trace/report/index.ts
#	packages/next/telemetry/trace/report/to-jaeger.ts
  • Loading branch information
timneutkens committed Aug 16, 2021
2 parents 94d2310 + 5313426 commit 3616da1
Show file tree
Hide file tree
Showing 26 changed files with 101 additions and 62 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/build_native.yml
Expand Up @@ -50,7 +50,15 @@ jobs:
uses: actions/cache@v2
with:
path: packages/next/native/**
key: next-swc-nightly-2021-03-25-${{ matrix.target }}-${{ hashFiles('packages/next/build/swc/**') }}
key: next-swc-nightly-2021-03-25-${{ matrix.target }}-${{ hashFiles('.github/workflows/build_native.yml', 'packages/next/build/swc/**') }}
- name: Cross build aarch64 setup
if: ${{ matrix.target == 'aarch64-apple-darwin' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
run: |
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
export CC=$(xcrun -f clang);
export CXX=$(xcrun -f clang++);
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
- name: 'Build'
if: steps.binary-cache.outputs.cache-hit != true
run: yarn build-native --target ${{ matrix.target }}
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/build_test_deploy.yml
Expand Up @@ -352,7 +352,15 @@ jobs:
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
with:
path: packages/next/native/next-swc.*.node
key: next-swc-nightly-2021-03-25-${{ matrix.target }}-${{ hashFiles('packages/next/build/swc/**') }}
key: next-swc-nightly-2021-03-25-${{ matrix.target }}-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }}
- name: Cross build aarch64 setup
if: ${{ matrix.target == 'aarch64-apple-darwin' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
run: |
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
export CC=$(xcrun -f clang);
export CXX=$(xcrun -f clang++);
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
- name: 'Build'
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
run: yarn build-native --target ${{ matrix.target }}
Expand Down
8 changes: 4 additions & 4 deletions docs/api-reference/next.config.js/react-strict-mode.md
Expand Up @@ -6,7 +6,9 @@ description: The complete Next.js runtime is now Strict Mode-compliant, learn ho

> **Suggested**: We strongly suggest you enable Strict Mode in your Next.js application to better prepare your application for the future of React.
The Next.js runtime is now Strict Mode-compliant. To opt-in to Strict Mode, configure the following option in your `next.config.js`:
React's [Strict Mode](https://reactjs.org/docs/strict-mode.html) is a development mode only feature for highlighting potential problems in an application. It helps to identify unsafe lifecycles, legacy API usage, and a number of other features.

The Next.js runtime is Strict Mode-compliant. To opt-in to Strict Mode, configure the following option in your `next.config.js`:

```js
// next.config.js
Expand All @@ -15,9 +17,7 @@ module.exports = {
}
```

If you or your team are not ready to use Strict Mode in your entire application, that's OK! You can incrementally migrate on a page-by-page basis [using `<React.StrictMode>`](https://reactjs.org/docs/strict-mode.html).

React's Strict Mode is a development mode only feature for highlighting potential problems in an application. It helps to identify unsafe lifecycles, legacy API usage, and a number of other features.
If you or your team are not ready to use Strict Mode in your entire application, that's OK! You can incrementally migrate on a page-by-page basis using `<React.StrictMode>`.

## Related

Expand Down
2 changes: 1 addition & 1 deletion docs/authentication.md
Expand Up @@ -101,7 +101,7 @@ const Profile = ({ user }) => {
export default Profile
```

An advantage of this pattern is preventing a flash of unauthenticated content before redirecting. It's important to note fetching user data in `getServerSideProps` will block rendering until the request to your authentication provider resolves. To prevent creating a bottleneck and decreasing your TTFB ([Time to First Byte](https://web.dev/time-to-first-byte/)), you should ensure your authentication lookup is fast. Otherwise, consider [static generation](#authenticating-statically-generated-pages).
An advantage of this pattern is preventing a flash of unauthenticated content before redirecting. It's important to note fetching user data in `getServerSideProps` will block rendering until the request to your authentication provider resolves. To prevent creating a bottleneck and increasing your TTFB ([Time to First Byte](https://web.dev/time-to-first-byte/)), you should ensure your authentication lookup is fast. Otherwise, consider [static generation](#authenticating-statically-generated-pages).

## Authentication Providers

Expand Down
6 changes: 1 addition & 5 deletions examples/with-loading/pages/_app.js
@@ -1,8 +1,8 @@
import { useEffect } from 'react'
import Link from 'next/link'
import Head from 'next/head'
import { useRouter } from 'next/router'
import NProgress from 'nprogress'
import '../public/nprogress.css'

export default function App({ Component, pageProps }) {
const router = useRouter()
Expand All @@ -29,10 +29,6 @@ export default function App({ Component, pageProps }) {

return (
<>
<Head>
{/* Import CSS for nprogress */}
<link rel="stylesheet" type="text/css" href="/nprogress.css" />
</Head>
<nav>
<style jsx>{`
a {
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Expand Up @@ -17,5 +17,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "11.1.1-canary.7"
"version": "11.1.1-canary.8"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "11.1.1-canary.7",
"version": "11.1.1-canary.8",
"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": "11.1.1-canary.7",
"version": "11.1.1-canary.8",
"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": "11.1.1-canary.7",
"@next/eslint-plugin-next": "11.1.1-canary.8",
"@rushstack/eslint-patch": "^1.0.6",
"@typescript-eslint/parser": "^4.20.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": "11.1.1-canary.7",
"version": "11.1.1-canary.8",
"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": "11.1.1-canary.7",
"version": "11.1.1-canary.8",
"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": "11.1.1-canary.7",
"version": "11.1.1-canary.8",
"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": "11.1.1-canary.7",
"version": "11.1.1-canary.8",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "11.1.1-canary.7",
"version": "11.1.1-canary.8",
"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": "11.1.1-canary.7",
"version": "11.1.1-canary.8",
"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": "11.1.1-canary.7",
"version": "11.1.1-canary.8",
"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": "11.1.1-canary.7",
"version": "11.1.1-canary.8",
"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/client/link.tsx
Expand Up @@ -237,7 +237,7 @@ function Link(props: React.PropsWithChildren<LinkProps>) {
throw new Error(
`Multiple children were passed to <Link> with \`href\` of \`${props.href}\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` +
(typeof window !== 'undefined'
? "\nOpen your browser's console to view the Component stack trace."
? " \nOpen your browser's console to view the Component stack trace."
: '')
)
}
Expand Down
12 changes: 6 additions & 6 deletions packages/next/package.json
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "11.1.1-canary.7",
"version": "11.1.1-canary.8",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -65,10 +65,10 @@
"dependencies": {
"@babel/runtime": "7.12.5",
"@hapi/accept": "5.0.2",
"@next/env": "11.1.1-canary.7",
"@next/polyfill-module": "11.1.1-canary.7",
"@next/react-dev-overlay": "11.1.1-canary.7",
"@next/react-refresh-utils": "11.1.1-canary.7",
"@next/env": "11.1.1-canary.8",
"@next/polyfill-module": "11.1.1-canary.8",
"@next/react-dev-overlay": "11.1.1-canary.8",
"@next/react-refresh-utils": "11.1.1-canary.8",
"@node-rs/helper": "1.2.1",
"assert": "2.0.0",
"ast-types": "0.13.2",
Expand Down Expand Up @@ -153,7 +153,7 @@
"@babel/traverse": "^7.12.10",
"@babel/types": "7.12.12",
"@napi-rs/cli": "1.1.0",
"@next/polyfill-nomodule": "11.1.1-canary.7",
"@next/polyfill-nomodule": "11.1.1-canary.8",
"@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0",
"@taskr/watch": "1.1.0",
Expand Down
1 change: 0 additions & 1 deletion packages/next/shared/lib/dynamic.tsx
Expand Up @@ -122,7 +122,6 @@ export default function dynamic<P = {}>(
`Disallowed suspense option usage with next/dynamic in blocking mode`
)
}
suspenseOptions.suspense = false
}
if (suspenseOptions.suspense) {
return loadableFn(suspenseOptions)
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dev-overlay/package.json
@@ -1,6 +1,6 @@
{
"name": "@next/react-dev-overlay",
"version": "11.1.1-canary.7",
"version": "11.1.1-canary.8",
"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": "11.1.1-canary.7",
"version": "11.1.1-canary.8",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
Expand Down
10 changes: 10 additions & 0 deletions test/acceptance/ReactRefreshLogBox.dev.test.js
Expand Up @@ -1130,6 +1130,16 @@ test('<Link> with multiple children', async () => {
expect(await session.getRedboxDescription()).toMatchInlineSnapshot(
`"Error: Multiple children were passed to <Link> with \`href\` of \`/\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children"`
)
expect(
await session.evaluate(
() =>
document
.querySelector('body > nextjs-portal')
.shadowRoot.querySelector(
'#nextjs__container_errors_desc a:nth-of-type(1)'
).href
)
).toMatch('https://nextjs.org/docs/messages/link-multiple-children')

await cleanup()
})
Expand Down
2 changes: 1 addition & 1 deletion test/integration/basic/test/index.test.js
Expand Up @@ -3,7 +3,7 @@
import { join } from 'path'
import { renderViaHTTP, findPort, launchApp, killApp } from 'next-test-utils'

// test suits
// test suites
import hmr from './hmr'
import errorRecovery from './error-recovery'
import dynamic from './dynamic'
Expand Down
13 changes: 11 additions & 2 deletions test/integration/react-18/app/pages/suspense/unwrapped.js
@@ -1,10 +1,19 @@
import React from 'react'
import React, { Suspense } from 'react'
import dynamic from 'next/dynamic'

// flag for testing
const wrapped = true

const Hello = dynamic(() => import('../../components/hello'), {
suspense: true,
})

export default function Unwrapped() {
return <Hello />
if (!wrapped) return <Hello />

return (
<Suspense fallback={`loading`}>
<Hello />
</Suspense>
)
}
4 changes: 1 addition & 3 deletions test/integration/react-18/test/blocking.js
Expand Up @@ -20,8 +20,6 @@ export default (context, render) => {
const $ = await get$('/suspense/thrown')
const html = $('body').html()
expect(html).toContain('loading')
expect(
JSON.parse($('#__NEXT_DATA__').text()).dynamicIds
).not.toBeUndefined()
expect(JSON.parse($('#__NEXT_DATA__').text()).dynamicIds).toBeUndefined()
})
}

0 comments on commit 3616da1

Please sign in to comment.