Skip to content

feat!: refactor components and make them consistent #4912

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

Open
wants to merge 55 commits into
base: main
Choose a base branch
from

Conversation

ilyaliao
Copy link
Member

@ilyaliao ilyaliao commented Jul 24, 2025

Based on #4911, I decided to systematically review every @vueuse/components component for props-related issues.

This PR refactors @vueuse/components to improve type safety and DX.

  1. Refactor component definitions to enhance type hints for props, emits, and slots.
  2. Export composable return types for component usage.
  3. Fix import paths to @vueuse/core to prevent bundlers from inlining sub-entries.
  4. Update outdated component examples and docs.

Props:

CleanShot 2025-08-12 at 00 42 40@2x

Emit:

CleanShot 2025-08-12 at 00 43 07@2x

Slot:

CleanShot 2025-08-12 at 00 44 03@2x

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 24, 2025
@ilyaliao ilyaliao marked this pull request as draft July 24, 2025 17:02
@ilyaliao
Copy link
Member Author

ilyaliao commented Jul 27, 2025

I found that this kind of definition can handle the types of props and slot better.

CleanShot 2025-07-27 at 18 25 09@2x

See f1907ef

@ilyaliao ilyaliao force-pushed the refactor/components branch from f1907ef to d685a59 Compare July 27, 2025 11:32
ilyaliao added 19 commits July 27, 2025 23:49
@ilyaliao ilyaliao force-pushed the refactor/components branch from d685a59 to 6305838 Compare July 27, 2025 16:00
@ilyaliao ilyaliao removed the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 27, 2025
@ilyaliao ilyaliao closed this Jul 28, 2025
@ilyaliao ilyaliao deleted the refactor/components branch July 28, 2025 15:16
@ilyaliao ilyaliao restored the refactor/components branch July 28, 2025 15:17
@ilyaliao ilyaliao reopened this Jul 28, 2025
ilyaliao added 15 commits July 30, 2025 00:16
@ilyaliao ilyaliao added size:XXL This PR changes 1000+ lines, ignoring generated files. BREAKING CHANGE labels Jul 29, 2025
@ilyaliao ilyaliao marked this pull request as ready for review August 11, 2025 16:53
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Aug 11, 2025
@ilyaliao
Copy link
Member Author

I've marked this as a BREAKING CHANGE because it will differ somewhat from previous usage patterns.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 12, 2025
@antfu antfu changed the title refactor: components feat!: reafactor components and make them consistent Aug 12, 2025
@antfu antfu changed the title feat!: reafactor components and make them consistent feat!: refactor components and make them consistent Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants