Skip to content

refactor(components): [input-tag] use type-based definitions#23436

Merged
btea merged 4 commits into
element-plus:devfrom
lw56777:refactor/input-tag-ComponentProps-#23399
Jan 18, 2026
Merged

refactor(components): [input-tag] use type-based definitions#23436
btea merged 4 commits into
element-plus:devfrom
lw56777:refactor/input-tag-ComponentProps-#23399

Conversation

@lw56777
Copy link
Copy Markdown
Contributor

@lw56777 lw56777 commented Jan 18, 2026

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.

修复:#23399

Summary by CodeRabbit

Release Notes

  • Refactor
    • Improved internal type definitions and prop declarations for the input-tag component, enhancing type safety and consistency across the component.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 18, 2026

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 18, 2026

Warning

Rate limit exceeded

@rzzf has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 45 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between b2853fb and bce2f02.

📒 Files selected for processing (2)
  • packages/components/input-tag/src/input-tag.ts
  • packages/components/input-tag/src/input-tag.vue
📝 Walkthrough

Walkthrough

The PR refactors the input-tag component to use type-based prop definitions instead of runtime prop objects. It introduces an explicit InputTagProps interface, replaces ExtractPropTypes-based aliases, updates the Vue component to use defineProps<InputTagProps>() with withDefaults for default values, and adds a non-null assertion for the delimiter prop in the composable.

Changes

Cohort / File(s) Summary
Type Definitions
packages/components/input-tag/src/input-tag.ts
Replaced runtime ExtractPropTypes alias with explicit InputTagProps interface containing all 21 props. Deprecated old InputTagPropsPublic alias; added detailed prop documentation.
Component Implementation
packages/components/input-tag/src/input-tag.vue
Switched from runtime prop object to typed defineProps<InputTagProps>() wrapped in withDefaults. Added 12 prop defaults (disabled, tagType, effect, trigger, delimiter, clearIcon, id, tabindex, autocomplete, validateEvent, saveOnBlur, maxCollapseTags). Updated imports to include EVENT_CODE, markRaw, CircleClose, and the new InputTagProps type.
Composable
packages/components/input-tag/src/composables/use-input-tag.ts
Added non-null assertion on props.delimiter! in the split call within getDelimitedTags, assuming delimiter is defined at that code path.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Contribution::Community

Suggested reviewers

  • keeplearning66
  • btea
  • rzzf

Poem

🐰 Props now typed, no runtime strings,
A cleaner path for Vue-y things!
Defaults set, assertions made so clear,
The input-tag evolves right here! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning PR description lacks substantive details about the changes, relying only on the issue reference #23399 without explaining the refactoring work performed. Add a detailed description explaining the type-based refactoring changes, how they improve the component, and any breaking changes or migration notes for users.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: refactoring the input-tag component to use type-based prop definitions instead of the previous extractprop-based approach.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jan 18, 2026

Open in StackBlitz

pnpm add https://pkg.pr.new/element-plus/element-plus@23436
npm i https://pkg.pr.new/element-plus/element-plus@23436
yarn add https://pkg.pr.new/element-plus/[email protected]

commit: bce2f02

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 18, 2026

🧪 Playground Preview: https://element-plus.run/?pr=23436
Please comment the example via this playground if needed.

Copy link
Copy Markdown
Member

@keeplearning66 keeplearning66 left a comment

Choose a reason for hiding this comment

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

Thank you!

Comment thread packages/components/input-tag/src/input-tag.ts Outdated
Comment thread packages/components/input-tag/src/input-tag.vue Outdated
@btea btea merged commit eb01fa9 into element-plus:dev Jan 18, 2026
16 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

@lw56777 Thanks for your contribution! ❤️

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.

4 participants