Skip to content

Commit bb35aee

Browse files
authored
chore: Update dependencies to latest versions (#1229)
* 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) * update @node-cli/static-server * Upgrade glob ^7.1.4 -> ^13.0.6 to fix audit vulnerability Migrate glob.sync() calls to named globSync import (breaking API change in glob v9+). Updated scripts: - scripts/extract-syntax.mjs - scripts/test-examples.mjs * Bump remaining outdated dependencies and upgrade Yarn 4.13 Yarn: - packageManager: 4.12.0 -> 4.13.0 Babel: - @babel/generator: ^7.24.7 -> ^7.29.1 - @babel/parser: ^7.24.7 -> ^7.29.2 - @babel/traverse: ^7.24.7 -> ^7.29.0 CodeMirror: - @codemirror/commands: ^6.9.0 -> ^6.10.3 - @codemirror/lang-javascript: ^6.2.4 -> ^6.2.5 - @codemirror/language: ^6.11.3 -> ^6.12.3 - @codemirror/lint: ^6.9.0 -> ^6.9.5 - @codemirror/search: ^6.5.11 -> ^6.6.0 - @codemirror/state: ^6.5.2 -> ^6.6.0 - @codemirror/view: ^6.38.5 -> ^6.41.0 - @lezer/highlight: ^1.2.1 -> ^1.2.3 UI: - @docsearch/react: ^4.3.1 -> ^4.6.2 - @headlessui/react: ^2.2.4 -> ^2.2.9 Build tooling: - @prettier/plugin-oxc: ^0.0.4 -> ^0.1.3 - lightningcss: ^1.30.1 -> ^1.32.0 - prettier: ^3.6.2 -> ^3.8.1 - lefthook: ^2.0.4 -> ^2.1.4 - auto-image-converter: ^2.1.2 -> ^2.2.0 - playwright: ^1.58.2 -> ^1.59.1 - wrangler: ^4.63.0 -> ^4.80.0 - dotenv: ^16.4.7 -> ^16.6.1 Other: - fuse.js: ^6.4.3 -> ^6.6.2 - isbot: ^5 -> ^5.1.37 - mdast-util-from-markdown: ^2.0.2 -> ^2.0.3 - vfile-matter: ^5.0.0 -> ^5.0.1 * fix formatting * Replace glob with tinyglobby tinyglobby is a fast, minimal glob library with only 2 subdependencies (vs glob's larger dependency tree). It's already a transitive dependency of Vite and Vitest in this project. Migrated scripts to use tinyglobby's globSync with cwd/absolute options instead of baking absolute paths into glob patterns.
1 parent a3ed0b8 commit bb35aee

File tree

12 files changed

+2342
-2731
lines changed

12 files changed

+2342
-2731
lines changed

.yarn/releases/yarn-4.12.0.cjs

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

.yarn/releases/yarn-4.13.0.cjs

Lines changed: 940 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
nodeLinker: node-modules
22

3-
yarnPath: .yarn/releases/yarn-4.12.0.cjs
3+
yarnPath: .yarn/releases/yarn-4.13.0.cjs

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"),

markdown-pages/blog/release-11-1-0.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,14 @@ Console.log(buttonCss)
9797
```
9898

9999
```js
100-
import * as MyCssCss from "./myCss.css" with { type: "css", "some-identifier": "yep" };
101-
import MyJsonJson from "./myJson.json" with { type: "json", "some-identifier": "yep" };
100+
import * as MyCssCss from "./myCss.css" with {
101+
type: "css",
102+
"some-identifier": "yep",
103+
};
104+
import MyJsonJson from "./myJson.json" with {
105+
type: "json",
106+
"some-identifier": "yep",
107+
};
102108

103109
var myJson = MyJsonJson;
104110
console.log(myJson);

package.json

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"engines": {
88
"node": ">=22"
99
},
10-
"packageManager": "yarn@4.12.0",
10+
"packageManager": "yarn@4.13.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",
@@ -34,42 +34,41 @@
3434
"vitest:update": "vitest --run --browser.headless --update"
3535
},
3636
"dependencies": {
37-
"@babel/generator": "^7.24.7",
38-
"@babel/parser": "^7.24.7",
39-
"@babel/traverse": "^7.24.7",
37+
"@babel/generator": "^7.29.1",
38+
"@babel/parser": "^7.29.2",
39+
"@babel/traverse": "^7.29.0",
4040
"@cloudflare/pages-plugin-vercel-og": "^0.1.2",
41-
"@codemirror/commands": "^6.9.0",
42-
"@codemirror/lang-javascript": "^6.2.4",
43-
"@codemirror/language": "^6.11.3",
44-
"@codemirror/lint": "^6.9.0",
45-
"@codemirror/search": "^6.5.11",
46-
"@codemirror/state": "^6.5.2",
47-
"@codemirror/view": "^6.38.5",
48-
"@docsearch/react": "^4.3.1",
49-
"@headlessui/react": "^2.2.4",
50-
"@lezer/highlight": "^1.2.1",
41+
"@codemirror/commands": "^6.10.3",
42+
"@codemirror/lang-javascript": "^6.2.5",
43+
"@codemirror/language": "^6.12.3",
44+
"@codemirror/lint": "^6.9.5",
45+
"@codemirror/search": "^6.6.0",
46+
"@codemirror/state": "^6.6.0",
47+
"@codemirror/view": "^6.41.0",
48+
"@docsearch/react": "^4.6.2",
49+
"@headlessui/react": "^2.2.9",
50+
"@lezer/highlight": "^1.2.3",
5151
"@mdx-js/mdx": "^3.1.1",
52-
"@node-cli/static-server": "^3.1.4",
53-
"@react-router/node": "^7.8.1",
52+
"@node-cli/static-server": "^3.1.10",
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",
59-
"fuse.js": "^6.4.3",
60-
"glob": "^7.1.4",
59+
"fuse.js": "^6.6.2",
6160
"highlight.js": "^11.11.1",
6261
"highlightjs-rescript": "^0.2.2",
63-
"isbot": "^5",
62+
"isbot": "^5.1.37",
6463
"lz-string": "^1.5.0",
65-
"mdast-util-from-markdown": "^2.0.2",
64+
"mdast-util-from-markdown": "^2.0.3",
6665
"mdast-util-to-string": "^4.0.0",
6766
"mdast-util-toc": "^7.1.0",
68-
"react": "^19.1.0",
69-
"react-dom": "^19.1.0",
67+
"react": "^19.2.4",
68+
"react-dom": "^19.2.4",
7069
"react-markdown": "^10.1.0",
71-
"react-router": "^7.12.0",
72-
"react-router-dom": "^7.9.4",
70+
"react-router": "^7.14.0",
71+
"react-router-dom": "^7.14.0",
7372
"react-router-mdx": "patch:react-router-mdx@npm%3A1.0.8#~/.yarn/patches/react-router-mdx-npm-1.0.8-d4402c3003.patch",
7473
"rehype-slug": "^6.0.0",
7574
"rehype-stringify": "^10.0.1",
@@ -78,36 +77,37 @@
7877
"remark-frontmatter": "^5.0.0",
7978
"remark-gfm": "^4.0.1",
8079
"remark-validate-links": "^13.1.0",
81-
"rescript": "^12.0.0",
80+
"rescript": "^12.2.0",
81+
"tinyglobby": "^0.2.15",
8282
"unified": "^11.0.5",
83-
"vfile-matter": "^5.0.0"
83+
"vfile-matter": "^5.0.1"
8484
},
8585
"devDependencies": {
86-
"@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",
92-
"auto-image-converter": "^2.1.2",
86+
"@prettier/plugin-oxc": "^0.1.3",
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",
92+
"auto-image-converter": "^2.2.0",
9393
"chokidar": "^4.0.3",
94-
"dotenv": "^16.4.7",
94+
"dotenv": "^16.6.1",
9595
"jsdom": "^26.1.0",
96-
"lefthook": "^2.0.4",
97-
"lightningcss": "^1.30.1",
98-
"playwright": "^1.58.2",
99-
"prettier": "^3.6.2",
96+
"lefthook": "^2.1.4",
97+
"lightningcss": "^1.32.0",
98+
"playwright": "^1.59.1",
99+
"prettier": "^3.8.1",
100100
"remark-cli": "^12.0.1",
101101
"search-insights": "^2.17.3",
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",
111-
"wrangler": "^4.63.0"
108+
"vite-plugin-page-reload": "^0.2.3",
109+
"vitest": "^4.1.2",
110+
"vitest-browser-react": "^2.2.0",
111+
"wrangler": "^4.80.0"
112112
}
113113
}

scripts/extract-syntax.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import glob from "glob";
1+
import { globSync } from "tinyglobby";
22
import path from "path";
33
import fs from "fs";
44
import { URL } from "url";
@@ -46,7 +46,10 @@ const extractSyntax = async (version) => {
4646
__dirname,
4747
"../index_data/syntax_index.json",
4848
);
49-
const syntaxFiles = glob.sync(`${SYNTAX_MD_DIR}/*.md?(x)`);
49+
const syntaxFiles = globSync(["*.md", "*.mdx"], {
50+
cwd: SYNTAX_MD_DIR,
51+
absolute: true,
52+
});
5053
const syntaxIndex = syntaxFiles
5154
.map(processFile)
5255
.filter(Boolean)

scripts/test-examples.mjs

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import fs from "fs";
2-
import glob from "glob";
2+
import { globSync } from "tinyglobby";
33
import path from "path";
44
import { URL } from "url";
55
import child_process from "child_process";
@@ -97,26 +97,27 @@ fs.writeFileSync(tempFileName, "");
9797

9898
let success = true;
9999

100-
glob
101-
.sync(__dirname + "/../markdown-pages/docs/{manual,react}/**/*.mdx")
102-
.forEach((file) => {
103-
let content = fs.readFileSync(file, { encoding: "utf-8" });
104-
let parsedResult = parseFile(content);
105-
if (parsedResult != null) {
106-
fs.writeFileSync(tempFileName, parsedResult);
107-
try {
108-
console.log("testing examples in", file);
109-
// -109 for suppressing `Toplevel expression is expected to have unit type.`
110-
// Most doc snippets do e.g. `Belt.Array.length(["test"])`, which triggers this
111-
child_process.execSync("npm exec rescript build ./temp -- --quiet", {
112-
stdio: "inherit",
113-
});
114-
} catch (e) {
115-
// process.stdout.write(postprocessOutput(file, e));
116-
success = false;
117-
}
100+
globSync("{manual,react}/**/*.mdx", {
101+
cwd: path.join(__dirname, "../markdown-pages/docs"),
102+
absolute: true,
103+
}).forEach((file) => {
104+
let content = fs.readFileSync(file, { encoding: "utf-8" });
105+
let parsedResult = parseFile(content);
106+
if (parsedResult != null) {
107+
fs.writeFileSync(tempFileName, parsedResult);
108+
try {
109+
console.log("testing examples in", file);
110+
// -109 for suppressing `Toplevel expression is expected to have unit type.`
111+
// Most doc snippets do e.g. `Belt.Array.length(["test"])`, which triggers this
112+
child_process.execSync("npm exec rescript build ./temp -- --quiet", {
113+
stdio: "inherit",
114+
});
115+
} catch (e) {
116+
// process.stdout.write(postprocessOutput(file, e));
117+
success = false;
118118
}
119-
});
119+
}
120+
});
120121

121122
fs.unlinkSync(tempFileName);
122123
process.exit(success ? 0 : 1);

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

0 commit comments

Comments
 (0)