Skip to content

Commit 7e95b5a

Browse files
committed
Upgrade Vite 8, Vitest 4.1, React 19.2, ReScript 12.2, React Router 7.14, tsdown 0.21
Vite ecosystem: - vite: ^7.0.6 -> ^8.0.3 - @vitejs/plugin-react: ^4.7.0 -> ^6.0.1 - @tailwindcss/vite: ^4.1.13 -> ^4.2.2 - vite-plugin-page-reload: ^0.2.2 -> ^0.2.3 Vitest ecosystem: - vitest: ^4.0.18 -> ^4.1.2 - @vitest/browser-playwright: ^4.0.18 -> ^4.1.2 - vitest-browser-react: ^2.0.5 -> ^2.2.0 React: - react: ^19.1.0 -> ^19.2.4 - react-dom: ^19.1.0 -> ^19.2.4 - @types/react: ^19.2.2 -> ^19.2.14 ReScript: - rescript: ^12.0.0 -> ^12.2.0 - @rescript/react: ^0.14.0 -> ^0.14.2 - Migrate Exn.Error -> JsExn (deprecated in 12.2) React Router: - react-router: ^7.12.0 -> ^7.14.0 - react-router-dom: ^7.9.4 -> ^7.14.0 - @react-router/node: ^7.8.1 -> ^7.14.0 - @react-router/dev: ^7.8.1 -> ^7.14.0 tsdown: 0.20.0 -> 0.21.7 (in build:scripts)
1 parent a3ed0b8 commit 7e95b5a

6 files changed

Lines changed: 821 additions & 898 deletions

File tree

app/routes.res

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ let blogArticleRoutes =
3333
route(path, "./routes/BlogArticleRoute.jsx", ~options={id: path})
3434
)
3535

36-
let mdxRoutes =
37-
mdxRoutes("./routes/MdxRoute.jsx")->Array.filter(r =>
38-
!(r.path
39-
->Option.map(path => path === "blog" || String.startsWith(path, "blog/"))
40-
->Option.getOr(false)
41-
)
36+
let mdxRoutes = mdxRoutes("./routes/MdxRoute.jsx")->Array.filter(r =>
37+
!(
38+
r.path
39+
->Option.map(path => path === "blog" || String.startsWith(path, "blog/"))
40+
->Option.getOr(false)
4241
)
42+
)
4343

4444
let default = [
4545
index("./routes/LandingPageRoute.jsx"),

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"packageManager": "yarn@4.12.0",
1111
"type": "module",
1212
"scripts": {
13-
"build:scripts": "yarn dlx tsdown@0.20.0 scripts/*.jsx -d _scripts --no-clean --ext .mjs",
13+
"build:scripts": "yarn dlx tsdown@0.21.7 scripts/*.jsx -d _scripts --no-clean --ext .mjs",
1414
"build:generate-llms": "node _scripts/generate_llms.mjs",
1515
"build:res": "rescript build --warn-error +3+8+11+12+26+27+31+32+33+34+35+39+44+45+110",
1616
"build:sync-bundles": "node scripts/sync-playground-bundles.mjs",
@@ -50,9 +50,9 @@
5050
"@lezer/highlight": "^1.2.1",
5151
"@mdx-js/mdx": "^3.1.1",
5252
"@node-cli/static-server": "^3.1.4",
53-
"@react-router/node": "^7.8.1",
53+
"@react-router/node": "^7.14.0",
5454
"@replit/codemirror-vim": "^6.3.0",
55-
"@rescript/react": "^0.14.0",
55+
"@rescript/react": "^0.14.2",
5656
"@rescript/webapi": "0.1.0-experimental-29db5f4",
5757
"@tsnobip/rescript-lezer": "^0.8.0",
5858
"docson": "^2.1.0",
@@ -65,11 +65,11 @@
6565
"mdast-util-from-markdown": "^2.0.2",
6666
"mdast-util-to-string": "^4.0.0",
6767
"mdast-util-toc": "^7.1.0",
68-
"react": "^19.1.0",
69-
"react-dom": "^19.1.0",
68+
"react": "^19.2.4",
69+
"react-dom": "^19.2.4",
7070
"react-markdown": "^10.1.0",
71-
"react-router": "^7.12.0",
72-
"react-router-dom": "^7.9.4",
71+
"react-router": "^7.14.0",
72+
"react-router-dom": "^7.14.0",
7373
"react-router-mdx": "patch:react-router-mdx@npm%3A1.0.8#~/.yarn/patches/react-router-mdx-npm-1.0.8-d4402c3003.patch",
7474
"rehype-slug": "^6.0.0",
7575
"rehype-stringify": "^10.0.1",
@@ -78,17 +78,17 @@
7878
"remark-frontmatter": "^5.0.0",
7979
"remark-gfm": "^4.0.1",
8080
"remark-validate-links": "^13.1.0",
81-
"rescript": "^12.0.0",
81+
"rescript": "^12.2.0",
8282
"unified": "^11.0.5",
8383
"vfile-matter": "^5.0.0"
8484
},
8585
"devDependencies": {
8686
"@prettier/plugin-oxc": "^0.0.4",
87-
"@react-router/dev": "^7.8.1",
88-
"@tailwindcss/vite": "^4.1.13",
89-
"@types/react": "^19.2.2",
90-
"@vitejs/plugin-react": "^4.7.0",
91-
"@vitest/browser-playwright": "^4.0.18",
87+
"@react-router/dev": "^7.14.0",
88+
"@tailwindcss/vite": "^4.2.2",
89+
"@types/react": "^19.2.14",
90+
"@vitejs/plugin-react": "^6.0.1",
91+
"@vitest/browser-playwright": "^4.1.2",
9292
"auto-image-converter": "^2.1.2",
9393
"chokidar": "^4.0.3",
9494
"dotenv": "^16.4.7",
@@ -102,12 +102,12 @@
102102
"tailwindcss": "^4",
103103
"to-vfile": "^8.0.0",
104104
"vfile-reporter": "^8.1.1",
105-
"vite": "^7.0.6",
105+
"vite": "^8.0.3",
106106
"vite-plugin-devtools-json": "^1.0.0",
107107
"vite-plugin-env-compatible": "^2.0.1",
108-
"vite-plugin-page-reload": "^0.2.2",
109-
"vitest": "^4.0.18",
110-
"vitest-browser-react": "^2.0.5",
108+
"vite-plugin-page-reload": "^0.2.3",
109+
"vitest": "^4.1.2",
110+
"vitest-browser-react": "^2.2.0",
111111
"wrangler": "^4.63.0"
112112
}
113113
}

src/MdxFile.res

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,15 @@ let resolveFilePath = (pathname, ~dir, ~alias) => {
3030
} else {
3131
pathname
3232
}
33-
let relativePath =
34-
if path->String.startsWith(alias ++ "/") {
35-
let rest = path->String.slice(~start=String.length(alias) + 1, ~end=String.length(path))
36-
Node.Path.join2(dir, rest)
37-
} else if path->String.startsWith(alias) {
38-
let rest = path->String.slice(~start=String.length(alias), ~end=String.length(path))
39-
Node.Path.join2(dir, rest)
40-
} else {
41-
path
42-
}
33+
let relativePath = if path->String.startsWith(alias ++ "/") {
34+
let rest = path->String.slice(~start=String.length(alias) + 1, ~end=String.length(path))
35+
Node.Path.join2(dir, rest)
36+
} else if path->String.startsWith(alias) {
37+
let rest = path->String.slice(~start=String.length(alias), ~end=String.length(path))
38+
Node.Path.join2(dir, rest)
39+
} else {
40+
path
41+
}
4342
relativePath ++ ".mdx"
4443
}
4544

src/common/HighlightJs.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let renderHLJS = (~highlightedLines=[], ~darkmode=false, ~code: string, ~lang: s
1010
// If the language couldn't be parsed, we will fall back to text
1111
let options = {language: lang}
1212
let (lang, highlighted) = try (lang, highlight(~code, ~options)->valueGet) catch {
13-
| Exn.Error(_) => ("text", code)
13+
| JsExn(_) => ("text", code)
1414
}
1515

1616
// Add line highlighting as well

src/components/Search.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ let transformItems = (items: DocSearch.transformItems) => {
5151
items
5252
->Array.filterMap(item => {
5353
let url = try WebAPI.URL.make(~url=item.url)->Some catch {
54-
| Exn.Error(obj) =>
54+
| JsExn(obj) =>
5555
Console.error2(`Failed to parse URL ${item.url}`, obj)
5656
None
5757
}

0 commit comments

Comments
 (0)