From a81d7620a40b2006cb6726236402fc3f82f65ab8 Mon Sep 17 00:00:00 2001 From: Jeremy Stucki Date: Fri, 27 Mar 2020 13:23:53 +0100 Subject: [PATCH 01/13] docs: Replace micro-cors with cors middleware (#11395) --- docs/api-routes/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-routes/introduction.md b/docs/api-routes/introduction.md index e8411d08bf..7e828e06a0 100644 --- a/docs/api-routes/introduction.md +++ b/docs/api-routes/introduction.md @@ -48,7 +48,7 @@ export default (req, res) => { To fetch API endpoints, take a look into any of the examples at the start of this section. -> API Routes [do not specify CORS headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), meaning they are **same-origin only** by default. You can customize such behavior by wrapping the request handler with [micro-cors](/docs/api-routes/api-middlewares.md#micro-support). +> API Routes [do not specify CORS headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), meaning they are **same-origin only** by default. You can customize such behavior by wrapping the request handler with the [cors middleware](/docs/api-routes/api-middlewares.md#connectexpress-middleware-support). > API Routes do not increase your client-side bundle size. They are server-side only bundles. From 8fdc13afa4e11302c6db96582fad45ffe81a7fd1 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Fri, 27 Mar 2020 14:23:36 +0100 Subject: [PATCH 02/13] Add support for comments in tsconfig.json (#11392) Fixes #11390 --- packages/next/build/webpack-config.ts | 11 ++++- packages/next/package.json | 2 +- .../typescript-paths/tsconfig.json | 2 + yarn.lock | 47 ++++++++++++++----- 4 files changed, 47 insertions(+), 15 deletions(-) diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index 1660209d9b..ed56a51302 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -11,6 +11,7 @@ import { PAGES_DIR_ALIAS, } from '../lib/constants' import { fileExists } from '../lib/file-exists' +import { readFileSync } from 'fs' import { resolveRequest } from '../lib/resolve-request' import { CLIENT_STATIC_FILES_RUNTIME_MAIN, @@ -58,6 +59,12 @@ const escapePathVariables = (value: any) => { : value } +function parseJsonFile(path: string) { + const JSON5 = require('json5') + const contents = readFileSync(path) + return JSON5.parse(contents) +} + function getOptimizedAliases(isServer: boolean): { [pkg: string]: string } { if (isServer) { return {} @@ -221,12 +228,12 @@ export default async function getBaseWebpackConfig( let jsConfig // jsconfig is a subset of tsconfig if (useTypeScript) { - jsConfig = require(tsConfigPath) + jsConfig = parseJsonFile(tsConfigPath) } const jsConfigPath = path.join(dir, 'jsconfig.json') if (!useTypeScript && (await fileExists(jsConfigPath))) { - jsConfig = require(jsConfigPath) + jsConfig = parseJsonFile(jsConfigPath) } let resolvedBaseUrl diff --git a/packages/next/package.json b/packages/next/package.json index 73233d64ba..c1c0de3530 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -108,7 +108,7 @@ "is-docker": "2.0.0", "is-wsl": "2.1.1", "jest-worker": "24.9.0", - "json5": "2.1.1", + "json5": "2.1.2", "jsonwebtoken": "8.5.1", "launch-editor": "2.2.1", "loader-utils": "2.0.0", diff --git a/test/integration/typescript-paths/tsconfig.json b/test/integration/typescript-paths/tsconfig.json index ce26ae348d..5578956b9b 100644 --- a/test/integration/typescript-paths/tsconfig.json +++ b/test/integration/typescript-paths/tsconfig.json @@ -1,3 +1,4 @@ +/* This is a single line comment to check if that works */ { "compilerOptions": { "baseUrl": ".", @@ -10,6 +11,7 @@ "components/alias-to-d-ts.d.ts", "components/alias-to-d-ts.tsx" ] + // This is a single line comment to check if that works }, "esModuleInterop": true, "module": "esnext", diff --git a/yarn.lock b/yarn.lock index 6e0f5a5a9d..37126cab5e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4157,7 +4157,7 @@ browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" -browserslist@4.8.3, browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6, browserslist@^4.0.0, browserslist@^4.3.6, browserslist@^4.6.0, browserslist@^4.6.4, browserslist@^4.8.0, browserslist@^4.8.2, browserslist@^4.8.3: +browserslist@4.8.3, browserslist@^4.0.0, browserslist@^4.3.6, browserslist@^4.6.0, browserslist@^4.6.4, browserslist@^4.8.0, browserslist@^4.8.2, browserslist@^4.8.3: version "4.8.3" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.8.3.tgz#65802fcd77177c878e015f0e3189f2c4f627ba44" integrity sha512-iU43cMMknxG1ClEZ2MDKeonKE1CCrFVkQK2AqO2YWFmvIrx4JWrvQ4w4hQez6EpVI8rHTtqh/ruHHDHSOKxvUg== @@ -4166,6 +4166,14 @@ browserslist@4.8.3, browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7. electron-to-chromium "^1.3.322" node-releases "^1.1.44" +browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6: + version "1.7.7" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.7.7.tgz#0bd76704258be829b2398bb50e4b62d1a166b0b9" + integrity sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk= + dependencies: + caniuse-db "^1.0.30000639" + electron-to-chromium "^1.2.7" + browserstack-local@1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/browserstack-local/-/browserstack-local-1.4.0.tgz#d979cac056f57b9af159b3bcd7fdc09b4354537c" @@ -4469,11 +4477,21 @@ caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634: resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30001023.tgz#f856f71af16a5a44e81f1fcefc1673912a43da72" integrity sha512-EnlshvE6oAum+wWwKmJNVaoqJMjIc0bLUy4Dj77VVnz1o6bzSPr1Ze9iPy6g5ycg1xD6jGU6vBmo7pLEz2MbCQ== -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001012, caniuse-lite@^1.0.30001017, caniuse-lite@^1.0.30001019, caniuse-lite@^1.0.30001020: +caniuse-db@^1.0.30000639: + version "1.0.30001038" + resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30001038.tgz#439606cdafff1e10e0a795a7ff72fe26965fe8ba" + integrity sha512-yeQ2l99M9upOgMIRfZEdes6HuPbQiRZIMBumUwdXeEQz+faSXUZtZ8xeyEdU+TlJckH09M5NtM038sjKsRa2ow== + +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001012, caniuse-lite@^1.0.30001017, caniuse-lite@^1.0.30001019: version "1.0.30001019" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001019.tgz#857e3fccaad2b2feb3f1f6d8a8f62d747ea648e1" integrity sha512-6ljkLtF1KM5fQ+5ZN0wuyVvvebJxgJPTmScOMaFuQN2QuOzvRJnWSKfzQskQU5IOU4Gap3zasYPIinzwUjoj/g== +caniuse-lite@^1.0.30001020: + version "1.0.30001038" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001038.tgz#44da3cbca2ab6cb6aa83d1be5d324e17f141caff" + integrity sha512-zii9quPo96XfOiRD4TrfYGs+QsGZpb2cGiMAzPjtf/hpFgB6zCPZgJb7I1+EATeMw/o+lG8FyRAnI+CWStHcaQ== + capitalize@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/capitalize/-/capitalize-1.0.0.tgz#dc802c580aee101929020d2ca14b4ca8a0ae44be" @@ -6275,6 +6293,11 @@ ejs@^2.6.1: resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.7.4.tgz#48661287573dcc53e366c7a1ae52c3a120eec9ba" integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA== +electron-to-chromium@^1.2.7: + version "1.3.387" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.387.tgz#420677629c9791b5d36fc8847c8cc11c0934a6cb" + integrity sha512-jjQ6WkxrOu0rtGqY9/74Z+UEVQ7YmJU2rCX6kH4eidKP0ZK0VKB3/i1avXQ+EDwJAABKGaOAbJrcyz18P8E3aA== + electron-to-chromium@^1.3.322: version "1.3.327" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.327.tgz#516f28b4271727004362b4ac814494ae64d9dde7" @@ -9641,12 +9664,12 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -json5@2.1.1, json5@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.1.tgz#81b6cb04e9ba496f1c7005d07b4368a2638f90b6" - integrity sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ== +json5@2.1.2, json5@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.2.tgz#43ef1f0af9835dd624751a6b7fa48874fb2d608e" + integrity sha512-MoUOQ4WdiN3yxhm7NEVJSJrieAo5hNSLQ5sj05OTRHPL9HOBy8u4Bu88jsC1jvqAdN+E1bJmsUcZH+1HQxliqQ== dependencies: - minimist "^1.2.0" + minimist "^1.2.5" json5@^1.0.1: version "1.0.1" @@ -9655,12 +9678,12 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -json5@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.2.tgz#43ef1f0af9835dd624751a6b7fa48874fb2d608e" - integrity sha512-MoUOQ4WdiN3yxhm7NEVJSJrieAo5hNSLQ5sj05OTRHPL9HOBy8u4Bu88jsC1jvqAdN+E1bJmsUcZH+1HQxliqQ== +json5@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.1.tgz#81b6cb04e9ba496f1c7005d07b4368a2638f90b6" + integrity sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ== dependencies: - minimist "^1.2.5" + minimist "^1.2.0" jsonfile@^4.0.0: version "4.0.0" From 2b818a1e8b53fed72ddea139c2f2f3e75ff32399 Mon Sep 17 00:00:00 2001 From: MichelleLucero <31500626+MichelleLucero@users.noreply.github.com> Date: Sat, 28 Mar 2020 13:57:19 -0400 Subject: [PATCH 03/13] fixed typo: libraray -> library (#11435) Co-authored-by: Michelle Lucero <31500626+mlucero4607@users.noreply.github.com> --- examples/custom-server-actionhero/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/custom-server-actionhero/README.md b/examples/custom-server-actionhero/README.md index a41794570d..e67268f48a 100644 --- a/examples/custom-server-actionhero/README.md +++ b/examples/custom-server-actionhero/README.md @@ -103,7 +103,7 @@ module.exports = class CreateChatRoom extends Action { 3. Tell ActionHero to use the api rather than the file server as the top-level route in `api.config.servers.web.rootEndpointType = 'api'`. This will allows "/" to listen to API requests. Also update `api.config.general.paths.public = [ path.join(__dirname, '/../static') ]`. In this configuration, the next 'static' renderer will take priority over the ActionHero 'public file' api. Note that any static assets (CSS, fonts, etc) will need to be in "./static" rather than "./public". -Note that this is where the websocket server, if you enable it, will place the `ActionheroWebsocketClient` libraray.
+Note that this is where the websocket server, if you enable it, will place the `ActionheroWebsocketClient` library.
4. Configure a wild-card route at the lowest priority of your GET handler to catch all web requests that aren't caught by other actions: From 39a70d8eb176364c3ecfac9c1c6fedcc5e040bb1 Mon Sep 17 00:00:00 2001 From: liulanz <37808313+liulanz@users.noreply.github.com> Date: Sat, 28 Mar 2020 13:58:42 -0400 Subject: [PATCH 04/13] Minor change in README.md (#11434) * changed link for JOIN THE COMMUNITY * Update packages/next/README.md Co-Authored-By: Luis Alvarez D. Co-authored-by: Luis Alvarez D. --- packages/next/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/README.md b/packages/next/README.md index 1696181cd3..e65bf65b80 100644 --- a/packages/next/README.md +++ b/packages/next/README.md @@ -10,7 +10,7 @@ - +

From 48650a7d5dcba96cbdd9b031b4579864ebd1edf4 Mon Sep 17 00:00:00 2001 From: sdhani <31454777+sdhani@users.noreply.github.com> Date: Sat, 28 Mar 2020 14:02:12 -0400 Subject: [PATCH 05/13] Fix with-aphrodite readme typo (#11436) --- examples/with-aphrodite/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/with-aphrodite/README.md b/examples/with-aphrodite/README.md index 7fec568c53..4c96feb95f 100644 --- a/examples/with-aphrodite/README.md +++ b/examples/with-aphrodite/README.md @@ -1,6 +1,6 @@ # Example app with aphrodite -This example features how yo use a different styling solution than [styled-jsx](https://github.com/zeit/styled-jsx) that also supports universal styles. That means we can serve the required styles for the first render within the HTML and then load the rest in the client. In this case we are using [Aphrodite](https://github.com/Khan/aphrodite/). +This example features how to use a different styling solution than [styled-jsx](https://github.com/zeit/styled-jsx) that also supports universal styles. That means we can serve the required styles for the first render within the HTML and then load the rest in the client. In this case we are using [Aphrodite](https://github.com/Khan/aphrodite/). For this purpose we are extending the `` and injecting the server side rendered styles into the ``. From 9e2ae6997334917eeb1af0b4fb4e462f6b450b62 Mon Sep 17 00:00:00 2001 From: Jazib Jafri <42325130+JazibJafri@users.noreply.github.com> Date: Sat, 28 Mar 2020 23:27:17 +0500 Subject: [PATCH 06/13] Update api-rest-example to SSG (#11362) * Update api-rest-example to SSG * Use SWR for data fetching * Updated pages Co-authored-by: Luis Alvarez --- examples/api-routes-rest/package.json | 4 +-- examples/api-routes-rest/pages/api/users.js | 8 +---- examples/api-routes-rest/pages/index.js | 36 ++++++++++----------- examples/api-routes-rest/pages/user/[id].js | 18 ++++++----- 4 files changed, 31 insertions(+), 35 deletions(-) diff --git a/examples/api-routes-rest/package.json b/examples/api-routes-rest/package.json index 581d565303..2ccd1a3e68 100644 --- a/examples/api-routes-rest/package.json +++ b/examples/api-routes-rest/package.json @@ -7,10 +7,10 @@ "start": "next start" }, "dependencies": { - "isomorphic-unfetch": "3.0.0", "next": "latest", "react": "^16.8.6", - "react-dom": "^16.8.6" + "react-dom": "^16.8.6", + "swr": "^0.1.18" }, "license": "ISC" } diff --git a/examples/api-routes-rest/pages/api/users.js b/examples/api-routes-rest/pages/api/users.js index a15d5b5540..288d6f4229 100644 --- a/examples/api-routes-rest/pages/api/users.js +++ b/examples/api-routes-rest/pages/api/users.js @@ -1,11 +1,5 @@ // Fake users data -const users = [ - { - id: 1, - }, - { id: 2 }, - { id: 3 }, -] +const users = [{ id: 1 }, { id: 2 }, { id: 3 }] export default (req, res) => { // Get data from your database diff --git a/examples/api-routes-rest/pages/index.js b/examples/api-routes-rest/pages/index.js index c07b7eff60..861919c5e3 100644 --- a/examples/api-routes-rest/pages/index.js +++ b/examples/api-routes-rest/pages/index.js @@ -1,23 +1,23 @@ -import fetch from 'isomorphic-unfetch' +import useSwr from 'swr' import Link from 'next/link' -const Index = ({ users }) => ( - -) +const fetcher = url => fetch(url).then(res => res.json()) -Index.getInitialProps = async () => { - const response = await fetch('http://localhost:3000/api/users') - const users = await response.json() +export default function Index() { + const { data, error } = useSwr('/api/users', fetcher) - return { users } + if (error) return
Failed to load users
+ if (!data) return
Loading...
+ + return ( + + ) } - -export default Index diff --git a/examples/api-routes-rest/pages/user/[id].js b/examples/api-routes-rest/pages/user/[id].js index 5a52a78e6a..ab8bcfde79 100644 --- a/examples/api-routes-rest/pages/user/[id].js +++ b/examples/api-routes-rest/pages/user/[id].js @@ -1,12 +1,14 @@ -import fetch from 'isomorphic-unfetch' +import { useRouter } from 'next/router' +import useSwr from 'swr' -const User = ({ user }) =>
{user.name}
+const fetcher = url => fetch(url).then(res => res.json()) -User.getInitialProps = async ({ query: { id } }, res) => { - const response = await fetch(`http://localhost:3000/api/user/${id}`) - const user = await response.json() +export default function User() { + const router = useRouter() + const { data, error } = useSwr(`/api/user/${router.query.id}`, fetcher) - return { user } + if (error) return
Failed to load user
+ if (!data) return
Loading...
+ + return
{data.name}
} - -export default User From 8d63330c15e2ff9755406fc9f407bbcc385fc72b Mon Sep 17 00:00:00 2001 From: Eugene Dzhumak Date: Sat, 28 Mar 2020 23:20:48 +0400 Subject: [PATCH 07/13] Change mdx options description (#11409) * Change mdx options description https://mdxjs.com/advanced/plugins#using-remark-and-rehype-plugins * Change descriptions of next-mdx --- packages/next-mdx/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/next-mdx/readme.md b/packages/next-mdx/readme.md index a45f28cef0..2f2345949d 100644 --- a/packages/next-mdx/readme.md +++ b/packages/next-mdx/readme.md @@ -24,14 +24,14 @@ const withMDX = require('@next/mdx')() module.exports = withMDX() ``` -Optionally you can provide [MDX options](https://github.com/mdx-js/mdx#options): +Optionally you can provide [MDX plugins](https://mdxjs.com/advanced/plugins#plugins): ```js // next.config.js const withMDX = require('@next/mdx')({ options: { - mdPlugins: [], - hastPlugins: [], + remarkPlugins: [], + rehypePlugins: [], }, }) module.exports = withMDX() From 41764b28dc296718356e71b034328bd9f23ce4c3 Mon Sep 17 00:00:00 2001 From: Ren Adachi <49895682+moeyashi@users.noreply.github.com> Date: Sun, 29 Mar 2020 04:35:20 +0900 Subject: [PATCH 08/13] Update .gitignore (#11421) add node_modules/ --- examples/with-firebase-hosting-and-typescript/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/with-firebase-hosting-and-typescript/.gitignore b/examples/with-firebase-hosting-and-typescript/.gitignore index 2000558786..ce9cfd8b57 100644 --- a/examples/with-firebase-hosting-and-typescript/.gitignore +++ b/examples/with-firebase-hosting-and-typescript/.gitignore @@ -1,4 +1,5 @@ dist/ +node_modules/ # Firebase cache .firebase/ From fc946053fd45fdde18912060faae20aaee9f202a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Sat, 28 Mar 2020 20:41:31 +0100 Subject: [PATCH 09/13] Update emotion dependencies in with-emotion-11 (#11414) --- examples/with-emotion-11/package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/with-emotion-11/package.json b/examples/with-emotion-11/package.json index b3faae9168..9f7a375c62 100644 --- a/examples/with-emotion-11/package.json +++ b/examples/with-emotion-11/package.json @@ -12,11 +12,11 @@ "author": "Thomas Greco", "license": "ISC", "dependencies": { - "@emotion/cache": "11.0.0-next.10", - "@emotion/css": "11.0.0-next.10", - "@emotion/react": "11.0.0-next.10", - "@emotion/server": "11.0.0-next.10", - "@emotion/styled": "11.0.0-next.10", + "@emotion/cache": "11.0.0-next.12", + "@emotion/css": "11.0.0-next.12", + "@emotion/react": "11.0.0-next.12", + "@emotion/server": "11.0.0-next.12", + "@emotion/styled": "11.0.0-next.12", "next": "latest", "react": "^16.7.0", "react-dom": "^16.7.0" From 6f27e21f8aa1587e882067f02f466ce98a16f7fd Mon Sep 17 00:00:00 2001 From: David D Date: Mon, 30 Mar 2020 09:53:09 +0200 Subject: [PATCH 10/13] Fix #11396 (#11397) Co-authored-by: Tim Neutkens --- packages/next/types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/types/index.d.ts b/packages/next/types/index.d.ts index 271e1b532d..4d0aefcf43 100644 --- a/packages/next/types/index.d.ts +++ b/packages/next/types/index.d.ts @@ -5,7 +5,7 @@ import React from 'react' import { ParsedUrlQuery } from 'querystring' import { IncomingMessage, ServerResponse } from 'http' -import { Env } from '../lib/load-env-config' +import { Env } from '../dist/lib/load-env-config' import { NextPageContext, From d3d0b936a421a5ae1c6daba613cacf2821d44b62 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 30 Mar 2020 10:02:36 +0200 Subject: [PATCH 11/13] Fix type ignore (#11479) --- packages/next/types/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/next/types/index.d.ts b/packages/next/types/index.d.ts index 4d0aefcf43..b74271a2b8 100644 --- a/packages/next/types/index.d.ts +++ b/packages/next/types/index.d.ts @@ -5,6 +5,7 @@ import React from 'react' import { ParsedUrlQuery } from 'querystring' import { IncomingMessage, ServerResponse } from 'http' +// @ts-ignore This path is generated at build time and conflicts otherwise import { Env } from '../dist/lib/load-env-config' import { From a55376851457a28e05e0ed6cd90e366661b796c2 Mon Sep 17 00:00:00 2001 From: chislee0708 <60354073+chislee0708@users.noreply.github.com> Date: Mon, 30 Mar 2020 04:54:06 -0400 Subject: [PATCH 12/13] =?UTF-8?q?Typos=20fixed:=20overriden=20-->=20overri?= =?UTF-8?q?dden=20and=20innaccurate=20-->inacc=E2=80=A6=20(#11454)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/with-sentry-simple/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/with-sentry-simple/README.md b/examples/with-sentry-simple/README.md index e003c93a87..a0c6ee6a3e 100644 --- a/examples/with-sentry-simple/README.md +++ b/examples/with-sentry-simple/README.md @@ -46,7 +46,7 @@ Deploy it to the cloud with [ZEIT Now](https://zeit.co/import?filter=next.js&utm This is a simple example showing how to use [Sentry](https://sentry.io) to catch & report errors on both client + server side. - `_app.js` renders on both the server and client. It initializes Sentry to catch any unhandled exceptions -- `_error.js` is rendered by Next.js while handling certain types of exceptions for you. It is overriden so those exceptions can be passed along to Sentry +- `_error.js` is rendered by Next.js while handling certain types of exceptions for you. It is overridden so those exceptions can be passed along to Sentry - `next.config.js` enables source maps in production for Sentry and swaps out `@sentry/node` for `@sentry/browser` when building the client bundle **Note**: Source maps will not be sent to Sentry when running locally (because Sentry cannot access your `localhost`). To accurately test client-side source maps, please deploy to Now. @@ -84,7 +84,7 @@ Sentry.init({ ### Hosting source maps vs. uploading them to Sentry -This example shows how to generate your own source maps, which are hosted alongside your JavaScript bundles in production. But that has the potential for innaccurate results in Sentry. +This example shows how to generate your own source maps, which are hosted alongside your JavaScript bundles in production. But that has the potential for inaccurate results in Sentry. Sentry will attempt to [fetch the source map](https://docs.sentry.io/platforms/javascript/sourcemaps/#hosting--uploading) when it is processing an exception, as long as the "Enable JavaScript source fetching" setting is turned on for your Sentry project. From e4bf0d4c909dcac601d540e38cfb445ec72ba0eb Mon Sep 17 00:00:00 2001 From: Josh Pullen Date: Mon, 30 Mar 2020 05:45:11 -0400 Subject: [PATCH 13/13] Fix small punctuation issue (#11439) --- docs/routing/dynamic-routes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/routing/dynamic-routes.md b/docs/routing/dynamic-routes.md index a8c9f9e271..1d64d9d670 100644 --- a/docs/routing/dynamic-routes.md +++ b/docs/routing/dynamic-routes.md @@ -11,7 +11,7 @@ description: Dynamic Routes are pages that allow you to add custom params to you -Defining routes by using predefined paths is not always enough for complex applications, in Next.js you can add brackets to a page (`[param]`) to create a dynamic route (a.k.a. url slugs, pretty urls, and others). +Defining routes by using predefined paths is not always enough for complex applications. In Next.js you can add brackets to a page (`[param]`) to create a dynamic route (a.k.a. url slugs, pretty urls, and others). Consider the following page `pages/post/[pid].js`: