-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
lib: Add types to pkg/lib/notifications #21445
lib: Add types to pkg/lib/notifications #21445
Conversation
1635180
to
9f16dc4
Compare
9f16dc4
to
78abdab
Compare
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.
Thanks! Let's please double-check the PageStatus class.
78abdab
to
34f1448
Compare
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.
Nice, thanks!
@@ -27,8 +27,9 @@ import { SearchInput } from "@patternfly/react-core/dist/esm/components/SearchIn | |||
import { Tooltip, TooltipPosition } from "@patternfly/react-core/dist/esm/components/Tooltip/index.js"; | |||
import { ContainerNodeIcon, ExclamationCircleIcon, ExclamationTriangleIcon, InfoCircleIcon } from '@patternfly/react-icons'; | |||
|
|||
import { Status } from "notifications"; |
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.
This is a case where import type
is preferable, as notifications.tsx isn't otherwise used in the shell. However, we recently talked about that, and
NODE_ENV=development ./build.js shell
indeed confirms that pkg/lib/notifications.tsx does not land in the dist/shell/shell.js shell bundle. So tree shaking does work for pure .js/.ts, just not for anything with CSS.
It may still be a good habit to learn, to not unnecessarily blow up our bundles.
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.
Yes, good point! I didn't think of that.
// Generate name for the status | ||
const desc_parts = name.toLowerCase().split(" "); | ||
desc_parts.push(status.type); | ||
desc_parts.push(status.type || ""); |
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.
This added line is not executed by any test.
No description provided.