Repository navigation
build: drop a pile of unused / replaceable dev dependencies - #52744
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
c03eaeb to
cef175d
Compare
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring alerts on:
|
|
@SocketSecurity ignore-all |
dsanders11
left a comment
There was a problem hiding this comment.
Not gonna block on it, but I'd personally prefer a less kitchen sink PR that touches both production builds and test all in one, as it makes it more of a pain to review and increases backport conflicts.
3789212 to
da9430e
Compare
|
@dsanders11 Specifically did this without the intention of backporting, even doing these in smaller PRs backporting is a nightmare 😅 Got some more stuff to cut and might do mass-backports at some point, but for now just fixing main was my objective |
…dule
Removes dependencies that nothing in the tree uses any more:
* sinon / @types/sinon: no spec imports them.
* check-for-leaks: only wired to `prepack`, and the root package is
private and never packed.
* null-loader: the only rule using it matched against an always-empty
`ignoredModules` list in the webpack config.
* @types/uuid: uuid ships its own types since well before the version
we depend on.
* q, coffeescript, mkdirp: each backed a single test of third-party
module behaviour. The `require` app-directory test now uses
dirty-chai (any module that only lives in spec/node_modules works,
it is exercising module.paths, not the module), and the mkdirp asar
test is replaced by a `fs.mkdirSync(..., { recursive: true })` case
next to the existing mkdirSync test.
Also drops abstract-socket. dbus-native only used it to connect to
`unix:abstract=` bus addresses, and Node.js has supported abstract
sockets natively via a leading NUL byte since 20.8, so dbus-native is
now patched to use net.createConnection instead. That lets us delete
the abstract-socket patch, its resolutions entry, the dependenciesMeta
`built` opt-in, the packageExtensions block in .yarnrc.yml and the
Linux-only `npm rebuild abstract-socket` step in the spec runner.
abstract-socket itself still appears in the lockfile as dbus-native's
optional dependency (patches cannot change resolution), but it is no
longer built or required by anything.
No-Verification-Needed: dependency, test and build-tooling changes only; no product source touched
* uuid -> crypto.randomUUID() across the specs. * basic-auth -> a small parseBasicAuth() helper in spec/lib/net-helpers, used by the two specs that need to read Basic credentials. * temp -> fs.mkdtempSync in release.ts and in the asar copyFile specs. Also removes script/doc-only-change.js, whose last caller went away with the AppVeyor configs. No-Verification-Needed: spec, release-tooling and manifest changes only; no product source touched
wrapper-webpack-plugin is a webpack 4 era plugin that still hooks the deprecated optimizeChunkAssets hook. webpack 5's built-in BannerPlugin can prepend a raw header and (with `footer: true`) append a raw footer, and instances run in registration order, so the profiling wrapper and the try/catch wrapper nest exactly as before. The only difference in the emitted bundles is a newline between each wrapper and the bundle body. No-Verification-Needed: webpack build config only; emitted bundle diffed against the previous plugin's output (whitespace-only), production output checked for nesting and syntax
The default app uses five icons and an 88 byte stylesheet out of @primer/octicons, and pulling them out of node_modules was the only place the GN build reached into node_modules for shipped content. Copy the files (MIT licensed, notice included alongside) into default_app/octicon so they are plain static sources like the rest of the default app, and drop the dependency and the extra copy target. The files end up at the same paths inside default_app.asar as before. No-Verification-Needed: vendored files are byte-identical to the octicon files the existing build already ships at the same asar paths
The release scripts were the only direct users of got, and every call was a plain GET/HEAD/POST that global fetch covers: HEAD requests use `redirect: 'manual'` in place of `followRedirect: false`, and the non-2xx handling that previously relied on `throwHttpErrors: false` now checks `response.status` explicitly. The asset manifest in release.ts is untouched. got@11 was also still being kept alive by @electron/fiddle-core@1, which the root package depended on while .github/workflows already used ^2. Aligning the root on ^2 removes the second copy of fiddle-core and @electron/get along with the whole got@11 dependency chain (41 packages). fiddle-core 2 is ESM-only; the CommonJS spec runner loads it through require(esm), which is available on the Node 22.21 CI uses and anything newer than 22.12. No-Verification-Needed: release tooling, spec runner and manifest changes only; no product source touched
The two autoUpdater specs were the only users of express, and between them they use `use()`, `get()` with one `:param` route, `res.status()`, `res.send()`, `res.json()` and `res.download()`. spec/lib/http-server- helpers.ts provides exactly that surface on top of node:http, with file responses still going through `send` (what express uses internally) so HEAD, Range and content-type behaviour towards the updaters is unchanged. `send` is bumped to the 1.x line express 5 was already using, since 0.x serves .msix files as application/octet-stream rather than application/msix. Removes express, @types/express and 43 transitive packages. No-Verification-Needed: spec-only change; helper exercised over HTTP for GET/HEAD/Range/json/204/404 routing
The asar integrity spec only used @electron/packager for its resedit wrapper, and only the branch of that wrapper which embeds the integrity resource on Windows. Do that directly with resedit (the library the wrapper is built on), which is a dozen lines, and drop packager along with the 24 signing/notarizing/downloading packages it brings in. No-Verification-Needed: spec-only change; resource embedding round-tripped against a real PE locally
The `temp` package was dropped from the root package.json but api-protocol-spec.ts still required it inline, so every test shard that loads that file failed at spec-runner startup. No-Verification-Needed: test-only change
da9430e to
64bf5c9
Compare
|
No Release Notes |
A merge race between #52744, which removed the uuid dev-dependency and converted specs to randomUUID() from node:crypto, and #52597, which added a tabs.query test using uuid.v4(), left one stray uuid reference that breaks spec runner compilation (TS2304) on every test shard. Swap it for randomUUID(), matching #52744's conversion. Co-authored-by: Claude <[email protected]>
Removes or replaces a bunch of dev dependencies, one commit each. Lockfile goes from 1124 to 975 entries. Reasoning for each is in the commit messages.
sinon,check-for-leaks,null-loader,@types/uuid,q,coffeescript,mkdirpabstract-socket(+ patch, resolution,packageExtensions,npm rebuildstep)dbus-nativeto use Node's native abstract socketsuuid,basic-auth,tempcrypto.randomUUID(),parseBasicAuth()innet-helpers,mkdtempwrapper-webpack-pluginBannerPlugin@primer/octiconsdefault_app/octicon/got, second copy of@electron/fiddle-corefetch,fiddle-core@^2expressspec/lib/http-server-helpers.tson top ofsend@electron/packagerreseditdirectlyDraft until CI has run the darwin / win32 only suites that cover the last two rows.
Notes: none