-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
feat(perf): Use @sentry/status-page-list
for domain status link
#68899
Conversation
Async load `status-page-list` instead of using our own hard-coded constant.
Bundle ReportChanges will increase total bundle size by 17.6kB ⬆️
|
const [mod, setMod] = useState<any>({}); | ||
|
||
const loader = useCallback(async () => { | ||
const loaded = await import('@sentry/status-page-list'); |
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.
seems excessive to load what an object with 50 things in it, assuming we can tree shake the rest of it. We might need this getsentry/status-page-list#6
Performance page routes are already lazy loaded.
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.
what i'm saying is it might be fine to just import {domainToStatusPageUrls} from '@sentry/status-page-list'
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.
@scttcper I'm happy to follow whatever you think is best!
The docs in status-page-list
suggested to load async, which seems sound since that package is going to grow and we probably can't tree-shake it, since we don't know which domains we need ahead of time, right?
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.
yeah was thinking mostly of shaking everything else
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.
Ah, roger! Will update the dependency if/when getsentry/status-page-list#6 is merged, then
e.g.,
Use
@sentry/domain-status-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.status-page-list
library