Tracking follow-up improvements and explorations after successfully upgrading Electron from v25 to v40 #3382
- Replace
net.request() with net.fetch()
- Modern API available since Electron 28
- Location:
src/main/net/request/metal-request.ts
- Replace
req.abort() with req.destroy()
- Location:
src/main/net/request/metal-request.ts:142
Migrate main process from CJS to ESM
- Electron 28+ supports ESM. Already has
"type": "module" in package.json and a TODO in esbuild.config.mjs:28.
- Would change from
"cjs" to "esm" format and output extension from .bundle.cjs to .bundle.js.
- Currently deferred/not worth doing right now.
Evaluate replacing @goosewobbler/electron-redux
- The library is abandoned but Electron APIs are stable through v40. No urgency.
- Upstream
klarna/electron-redux v2.0.0 is the same code with worse packaging. @zubridge/electron is an actively maintained alternative if migration is desired.
Tracking follow-up improvements and explorations after successfully upgrading Electron from v25 to v40 #3382
net.request()withnet.fetch()src/main/net/request/metal-request.tsreq.abort()withreq.destroy()src/main/net/request/metal-request.ts:142Migrate main process from CJS to ESM"type": "module"in package.json and a TODO inesbuild.config.mjs:28."cjs"to"esm"format and output extension from.bundle.cjsto.bundle.js.Evaluate replacing@goosewobbler/electron-reduxklarna/electron-reduxv2.0.0 is the same code with worse packaging.@zubridge/electronis an actively maintained alternative if migration is desired.