-
Notifications
You must be signed in to change notification settings - Fork 99
[deps]: Update electron-store to v11 - abandoned #901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,12 +1,11 @@ | ||||||
| import * as fs from "fs"; | ||||||
|
|
||||||
| import { ipcMain } from "electron"; | ||||||
| import Store from "electron-store"; | ||||||
|
|
||||||
| import { StorageService } from "@/jslib/common/src/abstractions/storage.service"; | ||||||
| import { NodeUtils } from "@/jslib/common/src/misc/nodeUtils"; | ||||||
|
|
||||||
| // eslint-disable-next-line | ||||||
| const Store = require("electron-store"); | ||||||
|
|
||||||
| export class ElectronStorageService implements StorageService { | ||||||
| private store: any; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Type Safety Issue: The Since electron-store v11 is now written in TypeScript with proper type definitions, you should use proper typing:
Suggested change
Or if you know the specific shape of your data, define a proper interface for the store schema. |
||||||
|
|
||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ | |
| }, | ||
| "compilerOptions": { | ||
| "pretty": true, | ||
| "moduleResolution": "node", | ||
| "moduleResolution": "bundler", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Configuration Concern: Changing While
Since you're using Webpack to bundle the application, this change seems reasonable, but you should verify:
Consider also checking if you need to update the webpack configuration's |
||
| "noImplicitAny": true, | ||
| "target": "ES2016", | ||
| "module": "ES2020", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good: The migration from CommonJS
require()to ESMimportis correct for electron-store v11.However, there are some additional concerns to address:
Missing webpack configuration: Since electron-store v11 is pure ESM, you may need to add it to webpack externals in
webpack.main.jsto prevent bundling issues:Type safety: The
storeproperty on line 11 is still typed asany. Consider using proper typing:Verify compatibility: Electron-store v11 requires Electron 30+. Ensure your
electrondependency meets this requirement (I see you have v39.2.1, so this is fine).