Skip to content

Commit dbb6e75

Browse files
committed
chore(deps)!: Update to Next.js 12 and other dependencies
Next.js@12: Next.js 12 should provide better performance and stuffs. .babelrc: .babelrc has been removed to take advantage of Next.js' SWC backend (which offers faster build times) - if the file was still present, Babel would automatically be chosen over SWC. .yarnclean: Commented out the "images" yarnclean directive, as it was causing issues with Next.js. next-pwa: next-pwa has been updated, and next.config.js has been updated to use its newer API. react: React has been updated to React 18. The @types package could not use the latest version due to some issues with the package itself. rich-markdown-editor: rich-markdown-editor could not be updated due to issues with theming. BREAKING-CHANGE: Next.js and React have been upgraded to their later versions.
1 parent 7c57353 commit dbb6e75

7 files changed

+4167
-5217
lines changed

.babelrc

-4
This file was deleted.

.yarnclean

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ powered-test
88
docs
99
doc
1010
website
11-
images
11+
# images
1212
assets
1313

1414
# examples

next-env.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/// <reference types="next" />
2-
/// <reference types="next/types/global" />
32
/// <reference types="next/image-types/global" />
43

54
// NOTE: This file should not be edited

next.config.js

+11-13
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
const withPWA = require('next-pwa');
1+
const nextPWA = require('next-pwa');
22
const cache = require('./scripts/cache');
33

4-
const base = withPWA({
5-
target: process.env.NETLIFY ? 'serverless' : 'server',
4+
const withPWA = nextPWA({
5+
// target: process.env.NETLIFY ? 'serverless' : 'server',
6+
// mode: process.env.NODE_ENV ?? 'development',
7+
dest: 'public'
8+
});
9+
10+
module.exports = withPWA({
11+
swcMinify: true,
612

713
pwa: {
814
disable: process.env.NODE_ENV === 'development',
915
dest: 'public',
10-
runtimeCaching: cache,
11-
},
12-
});
13-
14-
const wp = base.webpack;
15-
module.exports = Object.assign(base, {
16-
webpack(config, options) {
17-
// In case it's required to change the webpack config
18-
return wp(config, options);
19-
},
16+
runtimeCaching: cache
17+
}
2018
});

package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"md5": "^2.3.0",
5555
"minio": "^7.0.18",
5656
"nanoid": "^3.1.22",
57-
"next": "^11.1.2",
57+
"next": "^12",
5858
"next-connect": "^0.10.1",
5959
"next-iron-session": "^4.1.11",
6060
"next-seo": "^4.24.0",
@@ -64,13 +64,14 @@
6464
"prosemirror-inputrules": "^1.1.3",
6565
"pupa": "^2.1.1",
6666
"qss": "^2.0.3",
67-
"react": "^17.0.2",
67+
"react": "^18.2.0",
6868
"react-div-100vh": "^0.5.6",
6969
"react-hotkeys-hook": "^3.3.1",
7070
"react-resize-detector": "^6.6.0",
7171
"react-split": "^2.0.9",
72+
"refractor": "^3.4.0",
7273
"remove-markdown": "^0.3.0",
73-
"rich-markdown-editor": "^11.17.4-0",
74+
"rich-markdown-editor": "11.17.4-0",
7475
"rosetta": "^1.1.0",
7576
"styled-components": "^5.2.1",
7677
"ua-parser-js": "^0.7.24",
@@ -91,7 +92,7 @@
9192
"@types/minio": "^7.0.7",
9293
"@types/node": "^12.12.21",
9394
"@types/prosemirror-inputrules": "^1.0.4",
94-
"@types/react": "^17.0.11",
95+
"@types/react": "18.0.1",
9596
"@types/react-dom": "^17.0.8",
9697
"@types/supertest": "^2.0.11",
9798
"@types/ua-parser-js": "^0.7.35",
@@ -110,12 +111,12 @@
110111
"i18n-extract": "^0.6.7",
111112
"jest": "^27.1.0",
112113
"lint-staged": "^10.5.4",
113-
"next-pwa": "^5.3.1",
114+
"next-pwa": "^5.6.0",
114115
"nightwind": "^1.1.6",
115116
"npm-run-all": "^4.1.5",
116117
"postcss": "^8.2.6",
117118
"prettier": "^2.2.1",
118-
"react-dom": "^17.0.2",
119+
"react-dom": "^18.2.0",
119120
"supertest": "^6.1.6",
120121
"tailwindcss": "^2.0.3",
121122
"typescript": "^4.3.4"

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"skipLibCheck": true,
1818
"strict": true,
1919
"target": "esnext",
20-
"baseUrl": "."
20+
"baseUrl": ".",
21+
"incremental": true
2122
},
2223
"exclude": ["node_modules"],
2324
"include": ["**/*.ts", "**/*.tsx", "additional.d.ts"]

0 commit comments

Comments
 (0)