Skip to content

Commit 72951d3

Browse files
authored
Upgrade to Next.js v10.2 (#313)
1 parent ac38db0 commit 72951d3

File tree

3 files changed

+63
-66
lines changed

3 files changed

+63
-66
lines changed

next.config.js

+15-7
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,20 @@ module.exports = withBundleAnalyzer(withSourceMaps({
179179
return redirects;
180180
},
181181

182+
future: {
183+
// See https://nextjs.org/docs/messages/webpack5
184+
// Necessary to manually specify to use webpack 5, because we use a custom "webpack" config (see below)
185+
webpack5: true,
186+
},
187+
188+
resolve: {
189+
fallback: {
190+
// Fixes npm packages that depend on `fs` module
191+
fs: false,
192+
},
193+
},
194+
182195
/**
183-
*
184196
* The webpack function is executed twice, once for the server and once for the client.
185197
* This allows you to distinguish between client and server configuration using the isServer property.
186198
*
@@ -200,7 +212,8 @@ module.exports = withBundleAnalyzer(withSourceMaps({
200212

201213
const APP_VERSION_RELEASE = APP_RELEASE_TAG || buildId;
202214
config.plugins.map((plugin, i) => {
203-
if (plugin.definitions) { // If it has a "definitions" key, then we consider it's the DefinePlugin where ENV vars are stored
215+
// Inject custom environment variables in "DefinePlugin" - See https://webpack.js.org/plugins/define-plugin/
216+
if (plugin.__proto__.constructor.name === 'DefinePlugin') {
204217
// Dynamically add some "public env" variables that will be replaced during the build through "DefinePlugin"
205218
// Those variables are considered public because they are available at build time and at run time (they'll be replaced during initial build, by their value)
206219
plugin.definitions['process.env.NEXT_PUBLIC_APP_BUILD_ID'] = JSON.stringify(buildId);
@@ -212,11 +225,6 @@ module.exports = withBundleAnalyzer(withSourceMaps({
212225
console.debug(`[webpack] Building release "${APP_VERSION_RELEASE}" using NODE_ENV="${process.env.NODE_ENV}" ${process.env.IS_SERVER_INITIAL_BUILD ? 'with IS_SERVER_INITIAL_BUILD="1"' : ''}`);
213226
}
214227

215-
// Fixes npm packages that depend on `fs` module
216-
config.node = {
217-
fs: 'empty',
218-
};
219-
220228
// XXX See https://github.com/vercel/next.js/blob/canary/examples/with-sentry-simple/next.config.js
221229
// In `pages/_app.js`, Sentry is imported from @sentry/node. While
222230
// @sentry/browser will run in a Node.js environment, @sentry/node will use

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
"lodash.startswith": "4.2.1",
161161
"lodash.xorby": "4.7.0",
162162
"markdown-to-jsx": "7.1.2",
163-
"next": "10.1.2",
163+
"next": "10.2.0",
164164
"next-cookies": "2.0.3",
165165
"prop-types": "15.7.2",
166166
"rc-tooltip": "5.1.0",

yarn.lock

+47-58
Original file line numberDiff line numberDiff line change
@@ -2308,20 +2308,20 @@
23082308
dependencies:
23092309
webpack-bundle-analyzer "4.3.0"
23102310

2311-
"@next/env@10.1.2":
2312-
version "10.1.2"
2313-
resolved "https://registry.yarnpkg.com/@next/env/-/env-10.1.2.tgz#04888eb7115a5b0633dc59e321e5c952917a39d5"
2314-
integrity sha512-G6kEq7dr7f+unVTUL74lIaB6njB73vEMVi7AhujaNnNZr6z8jQ43jCjNyawQsNyoNWsRo/9x6x9W72PbrGmy/w==
2311+
"@next/env@10.2.0":
2312+
version "10.2.0"
2313+
resolved "https://registry.yarnpkg.com/@next/env/-/env-10.2.0.tgz#154dbce2efa3ad067ebd20b7d0aa9aed775e7c97"
2314+
integrity sha512-tsWBsn1Rb6hXRaHc/pWMCpZ4Ipkf3OCbZ54ef5ukgIyEvzzGdGFXQshPP2AF7yb+8yMpunWs7vOMZW3e8oPF6A==
23152315

2316-
"@next/polyfill-module@10.1.2":
2317-
version "10.1.2"
2318-
resolved "https://registry.yarnpkg.com/@next/polyfill-module/-/polyfill-module-10.1.2.tgz#0cad99af18da0f90a63a25b60602ab46650017e6"
2319-
integrity sha512-9+xXb33HIPCrV0yM79blqwgLa+fkvm0gYs/wUDI0pPBCHkMpCZA/SWUeF/yKDY6qWO79H3B5pWTziLmzycQPWA==
2316+
"@next/polyfill-module@10.2.0":
2317+
version "10.2.0"
2318+
resolved "https://registry.yarnpkg.com/@next/polyfill-module/-/polyfill-module-10.2.0.tgz#61f41110c4b465cc26d113e2054e205df61c3594"
2319+
integrity sha512-Nl3GexIUXsmuggkUqrRFyE/2k7UI44JaVzSywtXEyHzxpZm2a5bdMaWuC89pgLiFDDOqmbqyLAbtwm5lNxa7Eg==
23202320

2321-
"@next/react-dev-overlay@10.1.2":
2322-
version "10.1.2"
2323-
resolved "https://registry.yarnpkg.com/@next/react-dev-overlay/-/react-dev-overlay-10.1.2.tgz#e98edfdc7fbed4d0cb333594469c7fa62f96e6df"
2324-
integrity sha512-B81nhgkWr+MbDAXN9I38WIdhAKayfIzrnOXXF2MS4VgxyHBvYQQfmobNNE0XBByyDn0+Ww5s9xg3L6Shh9kWKA==
2321+
"@next/react-dev-overlay@10.2.0":
2322+
version "10.2.0"
2323+
resolved "https://registry.yarnpkg.com/@next/react-dev-overlay/-/react-dev-overlay-10.2.0.tgz#4220121abac7e3404cbaf467784aeecca8be46cf"
2324+
integrity sha512-PRIAoWog41hLN4iJ8dChKp4ysOX0Q8yiNQ/cwzyqEd3EjugkDV5OiKl3mumGKaApJaIra1MX6j1wgQRuLhuWMA==
23252325
dependencies:
23262326
"@babel/code-frame" "7.12.11"
23272327
anser "1.4.9"
@@ -2335,10 +2335,10 @@
23352335
stacktrace-parser "0.1.10"
23362336
strip-ansi "6.0.0"
23372337

2338-
"@next/react-refresh-utils@10.1.2":
2339-
version "10.1.2"
2340-
resolved "https://registry.yarnpkg.com/@next/react-refresh-utils/-/react-refresh-utils-10.1.2.tgz#1c60150bb3f004fb9dd02db387a952483e6e2e4c"
2341-
integrity sha512-SQvtCt6nNOkGKddidQehxtJKMkoapg/kbLy/HwrqU8WdVrVVAk8JQw/QjDHVEsdezRxspeNKbho4L+3jl4c9rw==
2338+
"@next/react-refresh-utils@10.2.0":
2339+
version "10.2.0"
2340+
resolved "https://registry.yarnpkg.com/@next/react-refresh-utils/-/react-refresh-utils-10.2.0.tgz#55953b697769c6647f371bc6bcd865a24e1a22e9"
2341+
integrity sha512-3I31K9B4hEQRl7yQ44Umyz+szHtuMJrNdwsgJGhoEnUCXSBRHp5wv5Zv8eDa2NewSbe53b2C0oOpivrzmdBakw==
23422342

23432343
"@nodelib/fs.scandir@2.1.4":
23442344
version "2.1.4"
@@ -6246,6 +6246,11 @@ caniuse-lite@^1.0.30001125, caniuse-lite@^1.0.30001173, caniuse-lite@^1.0.300011
62466246
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001205.tgz#d79bf6a6fb13196b4bb46e5143a22ca0242e0ef8"
62476247
integrity sha512-TL1GrS5V6LElbitPazidkBMD9sa448bQDDLrumDqaggmKFcuU2JW1wTOHJPukAcOMtEmLcmDJEzfRrf+GjM0Og==
62486248

6249+
caniuse-lite@^1.0.30001202:
6250+
version "1.0.30001223"
6251+
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001223.tgz#39b49ff0bfb3ee3587000d2f66c47addc6e14443"
6252+
integrity sha512-k/RYs6zc/fjbxTjaWZemeSmOjO0JJV+KguOBA3NwPup8uzxM1cMhR2BD9XmO86GuqaqTCO8CgkgH9Rz//vdDiA==
6253+
62496254
capture-exit@^2.0.0:
62506255
version "2.0.0"
62516256
resolved "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4"
@@ -7117,21 +7122,19 @@ cssesc@^3.0.0:
71177122
resolved "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee"
71187123
integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==
71197124

7120-
cssnano-preset-simple@1.2.2:
7121-
version "1.2.2"
7122-
resolved "https://registry.yarnpkg.com/cssnano-preset-simple/-/cssnano-preset-simple-1.2.2.tgz#c631bf79ffec7fdfc4069e2f2da3ca67d99d8413"
7123-
integrity sha512-gtvrcRSGtP3hA/wS8mFVinFnQdEsEpm3v4I/s/KmNjpdWaThV/4E5EojAzFXxyT5OCSRPLlHR9iQexAqKHlhGQ==
7125+
cssnano-preset-simple@^2.0.0:
7126+
version "2.0.0"
7127+
resolved "https://registry.yarnpkg.com/cssnano-preset-simple/-/cssnano-preset-simple-2.0.0.tgz#b55e72cb970713f425560a0e141b0335249e2f96"
7128+
integrity sha512-HkufSLkaBJbKBFx/7aj5HmCK9Ni/JedRQm0mT2qBzMG/dEuJOLnMt2lK6K1rwOOyV4j9aSY+knbW9WoS7BYpzg==
71247129
dependencies:
7125-
caniuse-lite "^1.0.30001179"
7126-
postcss "^7.0.32"
7130+
caniuse-lite "^1.0.30001202"
71277131

7128-
cssnano-simple@1.2.2:
7129-
version "1.2.2"
7130-
resolved "https://registry.yarnpkg.com/cssnano-simple/-/cssnano-simple-1.2.2.tgz#72c2c3970e67123c3b4130894a30dc1050267007"
7131-
integrity sha512-4slyYc1w4JhSbhVX5xi9G0aQ42JnRyPg+7l7cqoNyoIDzfWx40Rq3JQZnoAWDu60A4AvKVp9ln/YSUOdhDX68g==
7132+
cssnano-simple@2.0.0:
7133+
version "2.0.0"
7134+
resolved "https://registry.yarnpkg.com/cssnano-simple/-/cssnano-simple-2.0.0.tgz#930d9dcd8ba105c5a62ce719cb00854da58b5c05"
7135+
integrity sha512-0G3TXaFxlh/szPEG/o3VcmCwl0N3E60XNb9YZZijew5eIs6fLjJuOPxQd9yEBaX2p/YfJtt49i4vYi38iH6/6w==
71327136
dependencies:
7133-
cssnano-preset-simple "1.2.2"
7134-
postcss "^7.0.32"
7137+
cssnano-preset-simple "^2.0.0"
71357138

71367139
csso@^4.0.2:
71377140
version "4.2.0"
@@ -11548,14 +11551,6 @@ levn@~0.3.0:
1154811551
prelude-ls "~1.1.2"
1154911552
type-check "~0.3.2"
1155011553

11551-
line-column@^1.0.2:
11552-
version "1.0.2"
11553-
resolved "https://registry.npmjs.org/line-column/-/line-column-1.0.2.tgz#d25af2936b6f4849172b312e4792d1d987bc34a2"
11554-
integrity sha1-0lryk2tvSEkXKzEuR5LR2Ye8NKI=
11555-
dependencies:
11556-
isarray "^1.0.0"
11557-
isobject "^2.0.0"
11558-
1155911554
lines-and-columns@^1.1.6:
1156011555
version "1.1.6"
1156111556
resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00"
@@ -12501,11 +12496,6 @@ nan@^2.12.1:
1250112496
resolved "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19"
1250212497
integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==
1250312498

12504-
nanoid@^3.1.16:
12505-
version "3.1.20"
12506-
resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz#badc263c6b1dcf14b71efaa85f6ab4c1d6cfc788"
12507-
integrity sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==
12508-
1250912499
nanoid@^3.1.22:
1251012500
version "3.1.22"
1251112501
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.22.tgz#b35f8fb7d151990a8aebd5aa5015c03cf726f844"
@@ -12578,17 +12568,17 @@ next-unused@0.0.6:
1257812568
ts-loader "^7.0.0"
1257912569
typescript "^4.2.3"
1258012570

12581-
next@10.1.2:
12582-
version "10.1.2"
12583-
resolved "https://registry.yarnpkg.com/next/-/next-10.1.2.tgz#2c508cc2982077f0bad6863be020c10c1d059970"
12584-
integrity sha512-S2KYS8NXeFmaJd8EyoC/kWi3uIlNz3PghnpDWYwy5dxhbtyaozK7fVpXmDcOTQEyYq3BZG5ph0B+hOsAwMdYfQ==
12571+
next@10.2.0:
12572+
version "10.2.0"
12573+
resolved "https://registry.yarnpkg.com/next/-/next-10.2.0.tgz#6654cc925d8abcb15474fa062fc6b3ee527dd6dc"
12574+
integrity sha512-PKDKCSF7s82xudu3kQhOEaokxggpbLEWouEUtzP6OqV0YqKYHF+Ff+BFLycEem8ixtTM2M6ElN0VRJcskJfxPQ==
1258512575
dependencies:
1258612576
"@babel/runtime" "7.12.5"
1258712577
"@hapi/accept" "5.0.1"
12588-
"@next/env" "10.1.2"
12589-
"@next/polyfill-module" "10.1.2"
12590-
"@next/react-dev-overlay" "10.1.2"
12591-
"@next/react-refresh-utils" "10.1.2"
12578+
"@next/env" "10.2.0"
12579+
"@next/polyfill-module" "10.2.0"
12580+
"@next/react-dev-overlay" "10.2.0"
12581+
"@next/react-refresh-utils" "10.2.0"
1259212582
"@opentelemetry/api" "0.14.0"
1259312583
assert "2.0.0"
1259412584
ast-types "0.13.2"
@@ -12600,7 +12590,7 @@ next@10.1.2:
1260012590
chokidar "3.5.1"
1260112591
constants-browserify "1.0.0"
1260212592
crypto-browserify "3.12.0"
12603-
cssnano-simple "1.2.2"
12593+
cssnano-simple "2.0.0"
1260412594
domain-browser "4.19.0"
1260512595
encoding "0.1.13"
1260612596
etag "1.8.1"
@@ -12616,7 +12606,7 @@ next@10.1.2:
1261612606
p-limit "3.1.0"
1261712607
path-browserify "1.0.1"
1261812608
pnp-webpack-plugin "1.6.4"
12619-
postcss "8.1.7"
12609+
postcss "8.2.13"
1262012610
process "0.11.10"
1262112611
prop-types "15.7.2"
1262212612
querystring-es3 "0.2.1"
@@ -13670,14 +13660,13 @@ postcss-values-parser@^2.0.1:
1367013660
indexes-of "^1.0.1"
1367113661
uniq "^1.0.1"
1367213662

13673-
postcss@8.1.7:
13674-
version "8.1.7"
13675-
resolved "https://registry.npmjs.org/postcss/-/postcss-8.1.7.tgz#ff6a82691bd861f3354fd9b17b2332f88171233f"
13676-
integrity sha512-llCQW1Pz4MOPwbZLmOddGM9eIJ8Bh7SZ2Oj5sxZva77uVaotYDsYTch1WBTNu7fUY0fpWp0fdt7uW40D4sRiiQ==
13663+
postcss@8.2.13:
13664+
version "8.2.13"
13665+
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.2.13.tgz#dbe043e26e3c068e45113b1ed6375d2d37e2129f"
13666+
integrity sha512-FCE5xLH+hjbzRdpbRb1IMCvPv9yZx2QnDarBEYSN0N0HYk+TcXsEhwdFcFb+SRWOKzKGErhIEbBK2ogyLdTtfQ==
1367713667
dependencies:
13678-
colorette "^1.2.1"
13679-
line-column "^1.0.2"
13680-
nanoid "^3.1.16"
13668+
colorette "^1.2.2"
13669+
nanoid "^3.1.22"
1368113670
source-map "^0.6.1"
1368213671

1368313672
postcss@^7.0.14, postcss@^7.0.26, postcss@^7.0.32, postcss@^7.0.35, postcss@^7.0.5, postcss@^7.0.6:

0 commit comments

Comments
 (0)