Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

Updates some type definitions to use the LiteralUnion type for better type safety.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings October 23, 2025 13:33
@netlify
Copy link

netlify bot commented Oct 23, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit aec2600
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68fa2e9d813fa4000819180b
😎 Deploy Preview https://deploy-preview-6419--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 68 (🟢 up 17 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances type safety by applying the LiteralUnion utility type to several type definitions that previously used plain string types. This allows for better IDE autocomplete suggestions while still accepting any string value.

Key changes:

  • Updated AppIconItem.purpose to use LiteralUnion with specific icon purpose values
  • Updated CSSLoaderOptions.modules to use LiteralUnion with CSS module types
  • Updated StyleLoaderOptions.insert to use LiteralUnion with DOM insertion points

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/core/src/types/config.ts Updated AppIconItem.purpose type to use LiteralUnion with standard icon purposes
packages/core/src/types/thirdParty.ts Added LiteralUnion import and applied it to CSSLoaderOptions.modules and StyleLoaderOptions.insert
website/docs/en/config/html/app-icon.mdx Updated documentation to reflect the new type signature for purpose property
website/docs/zh/config/html/app-icon.mdx Updated Chinese documentation to reflect the new type signature for purpose property

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@chenjiahan chenjiahan merged commit f41d38a into main Oct 24, 2025
17 of 18 checks passed
@chenjiahan chenjiahan deleted the improve_type_1023 branch October 24, 2025 02:14
@chenjiahan chenjiahan mentioned this pull request Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants