Skip to content

Commit a79b684

Browse files
authored
Update Next.js to v15 (#792)
* bump caniuse db https://github.com/browserslist/browserslist#browsers-data-updating * fix sed command to work with both GNU and MacOS sed The sed command which replaces the markdown import in the api.js file was not working on MacOS because the `-i` flag requires an argument with the backup file extension. This commit adds the `.bak` extension to the sed command to make it work on both GNU and MacOS sed (and then removes the backup file). * Update to next.js 14 - "next build export" is replaced with an output config option https://nextjs.org/docs/app/building-your-application/deploying/static-exports - "next start" is not compatible with static exports and has been removed from the package scripts - blog rss feed is now generated to out/blog/index.xml instead of _next/static/feed.xml to work with the default output and the redirect in netlify.toml has been reversed so that rss feed requests are redirected to the new location * Upgrade to nextjs 15 - Use turbopack instead of webpack - User typescript instead of js for next config - silence deprecation warnings on bulma sass problems. Bulma 1.0.2 breaks a bunch of things that worked in 0.8 so it's difficult to update to without changing how the site looks.
1 parent 6f9c24c commit a79b684

File tree

9 files changed

+951
-329
lines changed

9 files changed

+951
-329
lines changed

components/layout.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ const Layout: FC<Props> = ({ title, blog, children }) => (
3232
></meta>
3333
<link rel="alternate icon" type="image/png" href="/favicon-32x32.png" />
3434
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
35-
<link
36-
rel="alternate"
37-
type="application/rss+xml"
38-
href="/_next/static/feed.xml"
39-
/>
35+
<link rel="alternate" type="application/rss+xml" href="/blog/index.xml" />
4036
</Head>
4137
<main className={roboto.className}>
4238
<Navigation blog={blog} />

netlify.toml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
# Settings in the [build] context are global and are applied to all contexts
22
# unless otherwise overridden by more specific contexts.
33
[build]
4-
# Directory that contains the deploy-ready HTML files and assets generated by
5-
# the build. This is relative to the base directory if one has been set, or the
6-
# root directory if a base has not been set. This sample publishes the
7-
# directory located at the absolute path "root/project/build-output"
8-
publish = "out/"
4+
# Directory that contains the deploy-ready HTML files and assets generated by
5+
# the build. This is relative to the base directory if one has been set, or the
6+
# root directory if a base has not been set. This sample publishes the
7+
# directory located at the absolute path "root/project/build-output"
8+
publish = "out/"
99

10-
# Default build command.
11-
command = "npm run build"
10+
# Default build command.
11+
command = "npm run build"
1212

1313
[build.environment]
14-
# Environment variables are set here
14+
# Environment variables are set here
1515

16-
NODE_VERSION = "20.18.0"
16+
NODE_VERSION = "20.18.0"
1717

18-
# For apps that use next export to generate static HTML
19-
# set the NETLIFY_NEXT_PLUGIN_SKIP to true.
20-
NETLIFY_NEXT_PLUGIN_SKIP="true"
18+
# For apps that use next export to generate static HTML
19+
# set the NETLIFY_NEXT_PLUGIN_SKIP to true.
20+
NETLIFY_NEXT_PLUGIN_SKIP = "true"
2121

2222
# Redirects and headers are GLOBAL for all builds – they do not get scoped to
2323
# contexts no matter where you define them in the file.
@@ -26,16 +26,15 @@
2626

2727
# A basic redirect rule
2828
[[redirects]]
29-
from = "/docs/overview"
30-
to = "/tokio/tutorial"
29+
from = "/docs/overview"
30+
to = "/tokio/tutorial"
3131

3232
# Redirect previous rss feed location
3333
[[redirects]]
34-
from = "/blog/index.xml"
35-
to = "/_next/static/feed.xml"
34+
from = "/_next/static/feed.xml"
35+
to = "/blog/index.xml"
3636

3737
# The bridging article was moved from tutorial to topics
3838
[[redirects]]
39-
from = "/tokio/tutorial/bridging"
40-
to = "/tokio/topics/bridging"
41-
39+
from = "/tokio/tutorial/bridging"
40+
to = "/tokio/topics/bridging"

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.

next.config.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

next.config.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { NextConfig } from "next";
2+
3+
const nextConfig: NextConfig = {
4+
output: "export",
5+
sassOptions: {
6+
// bulma 0.8 has a bunch of future deprecations, but the next version breaks a lot of stuff
7+
// so we ignore the deprecation warnings here. These
8+
silenceDeprecations: [
9+
"color-functions",
10+
"import",
11+
"global-builtin",
12+
"legacy-js-api",
13+
"slash-div",
14+
],
15+
quietDeps: true,
16+
},
17+
};
18+
19+
export default nextConfig;

0 commit comments

Comments
 (0)