-
Notifications
You must be signed in to change notification settings - Fork 4
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
[WEB-4025] Rectify IconName type generation #513
Conversation
WalkthroughThe pull request includes updates to the Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
src/core/Icon/types.ts (1)
12-18
: LGTM! Consider adding a comment for clarity.The change from
computedIcons
toiconNames
in theIconName
type definition is a good refactor. It improves code organization by using the explicitly definediconNames
object, which is more descriptive and consistent with the file's structure.Consider adding a brief comment explaining the purpose of this type definition and its relationship to the
iconNames
object. This could improve code maintainability. For example:/** * Defines all possible icon names across different categories. * This type is derived from the keys of the `iconNames` object. */ export type IconName = | (typeof iconNames.gui)[number] | (typeof iconNames.display)[number] | (typeof iconNames.social)[number] | (typeof iconNames.other)[number] | (typeof iconNames.tech)[number] | (typeof iconNames.product)[number];
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- package.json (1 hunks)
- src/core/Icon/types.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
- package.json
🧰 Additional context used
960dbd2
to
8599033
Compare
Jira Ticket Link / Motivation
Very small fix. After this PR, the
IconName
type wasn't being created quite right, I found this when using the package in Voltaire.This change allows
IconName
to be generated from the constructediconNames
object, instead of from the underlying generated JSON. I'm not quite sure why the other approach didn't work and this does, but I'll leave that to the mystery of TypeScript. A guess would be because the JSON file isn't TypeScript and so TSC has less visibility over it.Summary of changes
How do you manually test this?
Reviewer Tasks (optional)
Merge/Deploy Checklist
Frontend Checklist
Summary by CodeRabbit
New Features
14.7.1
for improved version tracking.Refactor
IconName
type definition fromcomputedIcons
toiconNames
, while retaining the same properties.