You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What changes from electron-store 8 to 12 for src/main/appStore.ts and src/test/electron.ts: ESM-only bundling into the electron-vite main build (CommonJS output), API and option changes, the config file's location and format (does a 2.0.19 user's settings file load unchanged), and the minimum Electron/Node it needs?
Answer: upgrading to electron-store 12 needs only the version bump. It needs no settings migration and does not force ESM output for main.
Settings carry over unchanged. 8.2.0 and 12.0.0 both write userData/config.json (name config, cwd = app.getPath('userData')). conf 10 and conf 16 both write tab-indented JSON. Verified on Electron 45.2.3: a config.json written by 8.2.0 (darkMode: true) is read by 12.0.0 from the same path, and a write from 12 adds no __internal__ key. 8.2.0 also reads the file back after 12 writes it, so a downgrade works too.
The main build stays CommonJS. electron-vite 6 picks es output only when package.json has "type": "module". Electron 45 ships Node 24.22, which can require() an ES module, and the result is marked __esModule: true, so Vite's default-import interop works. I built and ran both variants: the default (externalized require("electron-store"), 1.6 kB) and externalizeDeps: { exclude: ['electron-store','conf'] } (inlined, about 453 kB). Both ran correctly.
No API changes affect our usage. We call new Store<{darkMode?}>(), .get and .set. The breaking changes in 9 to 12 cover pure ESM, JSON Schema 2020-12 (schema), and the conf 16 changes (migrations, clearInvalidConfig, encryptionKey, rootSchema, and .get() with a non-string key). None of them touch our calls.
Minimum versions: Electron 35 or later (we use 45) and Node 22 or later (engines; local 22.18, CI 24).
Test files:src/test/electron.ts needs no change. Its sendSync comment is stale, since electron-store no longer loads in the renderer. 12 throws outside Electron unless it gets an absolute cwd, but no test imports appStore. The src/preload.test.ts assertion stays valid.
Open: a packaged (app.asar) run of the externalized require(esm) was not tested. Bundling electron-store into main, as the preload already does, avoids that question.
Sources:electron-store releases (v9.0.0, v10.0.0, v11.0.0, v12.0.0), conf releases (v11 to v16), electron-store index.js at v8.2.0 and v12.0.0, conf source/index.ts at v10.2.0 and v16.0.0, and the electron-vite 6.0.0 dist source.
Activity
jtklein-agents commentedon Nov 24, 2026
Answer: upgrading to electron-store 12 needs only the version bump. It needs no settings migration and does not force ESM output for main.
userData/config.json(nameconfig,cwd=app.getPath('userData')). conf 10 and conf 16 both write tab-indented JSON. Verified on Electron 45.2.3: aconfig.jsonwritten by 8.2.0 (darkMode: true) is read by 12.0.0 from the same path, and a write from 12 adds no__internal__key. 8.2.0 also reads the file back after 12 writes it, so a downgrade works too.esoutput only whenpackage.jsonhas"type": "module". Electron 45 ships Node 24.22, which canrequire()an ES module, and the result is marked__esModule: true, so Vite's default-import interop works. I built and ran both variants: the default (externalizedrequire("electron-store"), 1.6 kB) andexternalizeDeps: { exclude: ['electron-store','conf'] }(inlined, about 453 kB). Both ran correctly.new Store<{darkMode?}>(),.getand.set. The breaking changes in 9 to 12 cover pure ESM, JSON Schema 2020-12 (schema), and the conf 16 changes (migrations,clearInvalidConfig,encryptionKey,rootSchema, and.get()with a non-string key). None of them touch our calls.engines; local 22.18, CI 24).src/test/electron.tsneeds no change. ItssendSynccomment is stale, since electron-store no longer loads in the renderer. 12 throws outside Electron unless it gets an absolutecwd, but no test importsappStore. Thesrc/preload.test.tsassertion stays valid.Open: a packaged (
app.asar) run of the externalizedrequire(esm)was not tested. Bundling electron-store into main, as the preload already does, avoids that question.Sources: electron-store releases (v9.0.0, v10.0.0, v11.0.0, v12.0.0), conf releases (v11 to v16), electron-store
index.jsat v8.2.0 and v12.0.0, confsource/index.tsat v10.2.0 and v16.0.0, and the electron-vite 6.0.0 dist source.Full notes: https://github.com/jtklein-agents/raxmlGUI/blob/research/electron-store-12/docs/research/electron-store-12.md