-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use package.json version field as compatibility key
- Loading branch information
Showing
5 changed files
with
15 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ REACT_APP_VERSION=$npm_package_version | |
REACT_APP_NAME=$npm_package_name | ||
REACT_APP_SENTRY_DSN=https://[email protected]/5721090 | ||
REACT_APP_SENTRY_ENABLED=false | ||
RELEASE_VERSION=$set_by_config_overrides |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ REACT_APP_VERSION=$npm_package_version | |
REACT_APP_NAME=$npm_package_name | ||
REACT_APP_SENTRY_DSN=https://[email protected]/5721090 | ||
REACT_APP_SENTRY_ENABLED=true | ||
RELEASE_VERSION=$set_by_config_overrides |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import { useLocalStorageState } from 'ahooks' | ||
|
||
// we can **update version field in package.json** to upgrade local storage version key | ||
export function useCompatibilityLocalstorage<T>( | ||
key: string, | ||
defaultValue: T | (() => T) | ||
) { | ||
return useLocalStorageState( | ||
`${key}_${process.env.INTERNAL_VERSION}`, | ||
`${key}.v${process.env.REACT_APP_VERSION}`, | ||
defaultValue | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters