-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Enable extension to specify storeName for persisting data #7107
Conversation
Signed-off-by: Panu Horsmalahti <[email protected]>
Signed-off-by: Antti Lustila <[email protected]>
packages/core/src/extensions/__tests__/configurable-directories.test.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Antti Lustila <[email protected]>
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.
LGTM
@@ -80,6 +87,11 @@ export class LensExtension< | |||
return this.manifest.description; | |||
} | |||
|
|||
// Name of extension for persisting data | |||
get storeName() { | |||
return this.manifest.storeName || this.name; |
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.
nit:
return this.manifest.storeName || this.name; | |
return this.manifest.storeName ?? this.name; |
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.
I don't think we want this. If storeName
is set as ""
, we want to fall back to name
.
const getHashInjectable = getInjectable({ | ||
id: "get-hash", | ||
|
||
instantiate: () => (text: string) => SHA256(text).toString(), |
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.
Should we add causesSideEffects: true
since used external imported package?
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.
In don't think that is necessary because a hash should be stable given its input
Fixes #7052
storeName
, it is used for specifying extension data locations instead of extension name