Skip to content

refactor(components): [steps] use type-based definitions#23433

Merged
btea merged 7 commits into
element-plus:devfrom
SevenDreamYang:use-type-based-definitions-steps-and-step-item
Jan 18, 2026
Merged

refactor(components): [steps] use type-based definitions#23433
btea merged 7 commits into
element-plus:devfrom
SevenDreamYang:use-type-based-definitions-steps-and-step-item

Conversation

@SevenDreamYang
Copy link
Copy Markdown
Contributor

@SevenDreamYang SevenDreamYang 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.

ref #23399

Summary by CodeRabbit

  • Refactor
    • Unified and clarified public prop typings for Step and Steps and added an explicit step status type.
  • Bug Fixes / Stability
    • Stricter prop typing and updated default prop values to reduce runtime surprises and improve consistency.
  • Chores
    • Deprecated old prop export aliases and added migration guidance to use the new typed interfaces.

✏️ 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

📝 Walkthrough

Walkthrough

Replaces runtime ExtractPropTypes-based exported prop aliases with explicit TypeScript interfaces (StepProps, StepsProps, StepsStatus), converts Vue imports to type-only, updates .vue components to defineProps<...>() with withDefaults(...), and adds deprecation notes for old aliases.

Changes

Cohort / File(s) Summary
Public type declarations
\packages/components/steps/src/item.ts`, `packages/components/steps/src/steps.ts``
Added exported interfaces StepProps, StepsProps, and StepsStatus; removed ExtractPropTypes-based exported aliases; switched Vue imports to type-only; added deprecation comments for the old alias exports.
Component props migration
\packages/components/steps/src/item.vue`, `packages/components/steps/src/steps.vue``
Replaced value-based stepProps/stepsProps usage with type-only imports; changed defineProps(propObject) to withDefaults(defineProps<...>(), {...}); updated internal typings (e.g., IStepsInject.propsRequired<StepsProps>).

Sequence Diagram(s)

(omitted — changes are type/public-API and do not introduce new multi-component runtime control flow)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • btea
  • rzzf

Poem

🐇 I hopped through types and nudged aliases old,
New interfaces stitched, defaults tidy and bold,
Deprecation notes placed with a gentle thump,
Imports slimmed down — one neat little bump,
I left a carrot of clarity on your branch 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description only contains an unchecked contributor checklist and a single issue reference; it lacks substantive explanation of the changes, rationale, and impact of the refactor. Add a detailed description explaining what was changed (type-based definitions), why this refactor improves the codebase, and any breaking changes or migration notes for users.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main refactor: migrating Steps component definitions from object-based to type-based approach across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings

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@23433
npm i https://pkg.pr.new/element-plus/element-plus@23433
yarn add https://pkg.pr.new/element-plus/[email protected]

commit: 41cf65f

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@packages/components/steps/src/item.ts`:
- Around line 6-25: StepProps currently declares description and status as
required but they are given runtime defaults via withDefaults(); update the
interface so both description and status are optional (e.g., description?:
string and status?: '' | 'wait' | 'process' | 'finish' | 'error' | 'success') to
match Vue 3 conventions and the withDefaults() usage; locate the StepProps
interface in item.ts and change the two property signatures accordingly.

Comment thread packages/components/steps/src/item.ts
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 18, 2026

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

Comment thread packages/components/steps/src/steps.ts Outdated
Comment thread packages/components/steps/src/steps.ts
Comment thread packages/components/steps/src/steps.ts
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!

@btea btea merged commit b2cd7d2 into element-plus:dev Jan 18, 2026
16 of 17 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

@SevenDreamYang 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.

3 participants