Repository navigation
[FSSDK-13476] Update dev dependencies to fix Dependabot alerts - #360
Esra Kartal (esrakartalOpt) wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Alex Yong (alexjoeyyong)
left a comment
There was a problem hiding this comment.
Verdict: approve. I rebuilt it twice, on Node 18 and 22, against both master and this branch and compared the results; the shipped bundle is byte-identical and every claim in the description checks out. The only open item is not code: three serialize-javascript alerts need dismissing by someone with Dependabot rights.
TL;DR
- The published package is unchanged. I compared the lockfile at the merge-base and at this head: 0 non-dev packages changed, none added or removed, and
package.json'sdependenciesare untouched.npm audit --omit=devreports 0 vulnerabilities before and after. - The shipped output is byte-identical.
npm ci(which runs thepreparebuild) on Node 18.20.8 and 22.23.5, onmasterand on this head:dist/react-sdk.es.min.mjs(c966709b...),dist/server.es.min.mjs(f7f73d74...) and the whole.d.tsset hash the same in all four runs. - Tests and checks pass: vitest 267 of 267 on Node 18 and on Node 22 (same as
master),tsc --noEmitclean, ESLint 0 errors and the same 9 warnings asmaster. - The alert numbers are exactly right. I matched all 44 open Dependabot alerts (all
developmentscope, read live from the repo) against the installed versions: onmasterall 44 are in their vulnerable range; on this head only 3 are:serialize-javascript#61, #87, #132. So 41 of 44, as described. - The reason for leaving those 3 is real. I installed
@rollup/plugin-terser1.0.2 (which bringsserialize-javascript7.1.4) on this branch: the build fails on Node 18 withReferenceError: crypto is not definedand succeeds on Node 20. CI tests on Node 18, so upgrading would break the build today. - Lockfile hygiene is clean: every changed or added entry resolves to
registry.npmjs.orgwith asha512integrity hash, and no new install scripts appear.npm ciworks with Node 18's own npm 10.8.2 even though the lockfile was written with npm 12.
CI: 10 pass, 1 skipped, none failing.
Proof
Results
master this head
published deps changed - 0 (non-dev lockfile entries: 0 changed / 0 added / 0 removed)
npm audit --omit=dev found 0 vulnerabilities found 0 vulnerabilities
npm audit (all) 21 (5 moderate, 13 high, 3 critical) 2 (1 moderate, 1 high): serialize-javascript + the terser plugin that uses it
Node 18.20.8 tests / tsc / eslint 267 pass / ok / 0 errors, 9 warnings 267 pass / ok / 0 errors, 9 warnings
Node 22.23.5 tests / tsc / eslint 267 pass / ok / 0 errors, 9 warnings 267 pass / ok / 0 errors, 9 warnings
dist/react-sdk.es.min.mjs sha256 c966709ba2cf... (both versions) c966709ba2cf... identical
dist/server.es.min.mjs sha256 f7f73d74b66f... f7f73d74b66f... identical
all .d.ts concatenated sha256 caf280217239... caf280217239... identical
versions: vitest 4.0.18 -> 4.1.12 happy-dom 20.4.0 -> 21.0.4 vite 7.3.1 -> 7.3.8 rollup 4.55.1 -> 4.69.3
postcss 8.5.6 -> 8.5.34 nanoid 3.3.11 -> 3.3.20 ws 8.18.3 -> 8.23.1 js-yaml 4.1.1 -> 4.3.2
Open Dependabot alerts (44, all development scope) whose installed version is still in the vulnerable range:
master: 44 of 44
this head: 3 of 44 -> #132 serialize-javascript (low), #87 (medium), #61 (high); all "installed 6.0.2"
Terser plugin experiment on this branch (npm i --no-save @rollup/plugin-terser@latest -> 1.0.2, serialize-javascript 7.1.4):
Node 18.20.8: [!] ReferenceError: crypto is not defined (build fails)
Node 20.20.2: created dist/react-sdk.es.min.mjs ... created dist/server.es.min.mjs (build ok)
Added packages: @isaacs/nonrecursive-glob-match 1.1.0, @rollup/rollup-android-x64 4.69.3, balanced-match 4.0.4,
buffer-image-size 0.6.4, convert-source-map 2.0.0, entities 7.0.1 (replaces 4.5.0); all dev, registry-hosted, sha512.
Findings
Blockers: none. Should-fix: none.
To do outside the PR: dismiss Dependabot alerts #61, #87 and #132 with the reason given in the description (build-time only, fed our own terser options, never untrusted input). That needs someone with rights on the repo; the PR can't do it. If Node 18 leaves the CI matrix, upgrading @rollup/plugin-terser fixes them for real.
Nit (no change asked): vite is now a direct dev dependency only to keep it on 7.x. That is the simplest way to do it, but nothing imports vite directly, so a short note in the PR body (already there) is the only record. Fine as is.
Ponytail
Lean already: one dependency added to hold a version line, one bumped. Nothing to cut.
net: 0 lines possible.
Principles (installed principles plugin v0.5.0, org layer; no repo-level checks)
Applied by hand, not the full recorded run. SEC-6.S1 / SEC-6.S2: dependency scanning reports on the repo and this PR takes the open alerts from 44 to 3, with the remaining 3 explained. FUN-2.S1 pass (267/267 on two Node versions, byte-identical output). CODE-1.S1 pass.
Summary
Fixes 41 of the 44 open Dependabot alerts (FSSDK-13476, which listed 43). All of them are in dev and test tooling in the root
package-lock.json. The published package's own dependencies are unchanged.npm audit fixwith Node 22 and npm 12: vitest and@vitest/*, rollup, postcss, js-yaml, brace-expansion, minimatch, picomatch, nanoid, ws, flatted, source-map-js, terser, and the@typescript-eslintchain. This also fixes the criticalvitestalert.happy-dom^20.4.0 to ^21.0.4, because the fixes are in 21.x.vite^7.3.8 as a dev dependency. Without itvitestwould move to vite 8, a major version that replaces esbuild with native rolldown packages. This keeps vite on the patched 7.x line.Not fixed: 3
serialize-javascriptalerts (61, 87, 132). They need@rollup/plugin-terser1.x, which needsserialize-javascript7.x. That reads the globalcryptowhen it loads, so the build fails on Node 18 (ReferenceError: crypto is not defined). CI tests on Node 18, andnpm ciruns the build. The package is only used at build time to pass our own terser options to a worker, never with untrusted input. I suggest dismissing the 3 alerts in Dependabot with that reason. If Node 18 is dropped from CI later, upgrading the plugin fixes them.Test plan
tsc --noEmitpasses. ESLint has 0 errors (9 warnings, the same as onmaster).masterand this branch: the publishedreact-sdk.es.min.mjsandserver.es.min.mjsare byte-for-byte identical (Node 20, 22.23.4 and 24), and the.d.tsfiles are the same. The source maps'mappingsdiffer slightly, which only affects debugging.npm ciwith Node 18's own npm (as CI does, including thepreparebuild) works and gives the same bundles.npm auditnow lists onlyserialize-javascriptand the terser plugin that uses it.Issues
🤖 Generated with Claude Code