Skip to content

refactor(components): [row] use type-based definitions#23437

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

refactor(components): [row] use type-based definitions#23437
btea merged 5 commits into
element-plus:devfrom
lw56777:refactor/row-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

  • New Features

    • Row component now has default prop values: tag = 'div', gutter = 0, justify = 'start'.
  • Refactor

    • Prop typings for the Row component reorganized into a clearer, public-facing interface for improved type safety and maintainability.
  • Deprecated

    • Legacy public prop type alias marked deprecated in favor of the new RowProps interface.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 18, 2026

📝 Walkthrough

Walkthrough

Row component props were converted from a runtime prop object to an explicit exported TypeScript RowProps interface; a deprecated public alias was added. The SFC now uses defineProps<RowProps>() with withDefaults to declare default values.

Changes

Cohort / File(s) Summary
Row prop interface definition
packages/components/row/src/row.ts
Added exported RowProps interface (tag, gutter, justify, align) and inline docs; removed unused ExtractPropTypes import; added deprecated public alias / deprecation comments referencing the old rowProps-based type.
Row component props usage
packages/components/row/src/row.vue
Replaced defineProps(rowProps) with defineProps<RowProps>(); added withDefaults setting tag = 'div', gutter = 0, justify = 'start'; swapped rowProps import for import type { RowProps } from './row'.

Sequence Diagram(s)

(omitted — changes are type-refactor and defaulting updates with no new multi-component control flow)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • btea

Poem

🐰 I hopped through props with nimble paws,
Typed each field, removed old laws,
Defaults snug, a tidy row —
Quiet code where breezes blow. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: refactoring the row component to use type-based prop definitions instead of object-based definitions.
Description check ✅ Passed The PR description follows the template with all required checklist items marked complete, references issue #23399, and confirms adherence to contribution guidelines and branch targeting.
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@23437
npm i https://pkg.pr.new/element-plus/element-plus@23437
yarn add https://pkg.pr.new/element-plus/[email protected]

commit: fe6776d

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/row/src/row.ts`:
- Around line 36-38: The deprecation JSDoc on rowProps is misleading because
RowProps is a TypeScript type and doesn’t replace runtime validators/defaults;
update the comment on rowProps in row.ts to either remove the “Use `RowProps`
instead” suggestion or clarify that RowProps is type-only and does not supply
runtime validation/defaults, e.g., state that runtime consumers should continue
to use rowProps for validators/defaults while RowProps is the compile-time type,
and ensure the symbols mentioned are `rowProps` (runtime) and `RowProps` (type).

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

github-actions Bot commented Jan 18, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 18, 2026

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

Comment thread packages/components/row/src/row.ts
@btea btea merged commit 931d309 into element-plus:dev Jan 18, 2026
16 of 17 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.

3 participants