-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(perf): Use
@sentry/status-page-list
for domain status link (#6…
…8899) Use [`@sentry/domain-status-list`](https://github.com/getsentry/status-page-list), which is where we're going to keep a domain --> status page lookup. Load the library async when the component is rendered so we don't increase everyone's bundle. Right now it's about 14KB. - Add package - Use `status-page-list` library
- Loading branch information
Showing
5 changed files
with
38 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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {useCallback, useEffect, useState} from 'react'; | ||
|
||
import {useIsMountedRef} from 'sentry/utils/useIsMountedRef'; | ||
|
||
export function useStatusPageList() { | ||
const isMountedRef = useIsMountedRef(); | ||
const [mod, setMod] = useState<any>({}); | ||
|
||
const loader = useCallback(async () => { | ||
const loaded = await import('@sentry/status-page-list'); | ||
|
||
if (isMountedRef.current) { | ||
setMod(loaded); | ||
} | ||
}, [isMountedRef]); | ||
|
||
useEffect(() => { | ||
loader(); | ||
}, [loader]); | ||
|
||
return mod; | ||
} |
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 |
---|---|---|
|
@@ -3079,6 +3079,11 @@ | |
"@sentry/types" "7.109.0" | ||
"@sentry/utils" "7.109.0" | ||
|
||
"@sentry/status-page-list@^0.0.1": | ||
version "0.0.1" | ||
resolved "https://registry.yarnpkg.com/@sentry/status-page-list/-/status-page-list-0.0.1.tgz#fb65dc67496067798dcd9b3285589ded63f0ecd1" | ||
integrity sha512-LQSBWck49vqHdnt9gGKshlwtzhHLqTCAc7H1AIOF66BMmEkpsOzXjhloE7tJ8ufbuIHnPGvBseydA2CcSzwQTQ== | ||
|
||
"@sentry/[email protected]", "@sentry/types@^7.109.0": | ||
version "7.109.0" | ||
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.109.0.tgz#d8778358114ed05be734661cc9e1e261f4494947" | ||
|