Skip to content

Comments

refactor(useClipboard)!: use readonly() instead of type assertion Computed#5081

Merged
antfu merged 2 commits intomainfrom
fest/readonly-clipboard
Oct 22, 2025
Merged

refactor(useClipboard)!: use readonly() instead of type assertion Computed#5081
antfu merged 2 commits intomainfrom
fest/readonly-clipboard

Conversation

@9romise
Copy link
Member

@9romise 9romise commented Sep 30, 2025

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.
⚠️ Slowing down new functions

Warning: Slowing down new functions

As the VueUse audience continues to grow, we have been inundated with an overwhelming number of feature requests and pull requests. As a result, maintaining the project has become increasingly challenging and has stretched our capacity to its limits. As such, in the near future, we may need to slow down our acceptance of new features and prioritize the stability and quality of existing functions. Please note that new features for VueUse may not be accepted at this time. If you have any new ideas, we suggest that you first incorporate them into your own codebase, iterate on them to suit your needs, and assess their generalizability. If you strongly believe that your ideas are beneficial to the community, you may submit a pull request along with your use cases, and we would be happy to review and discuss them. Thank you for your understanding.


Description

Based on the git history, the original type assertion to ComputedRef was intended to enforce read-only. Therefore, I believe it would be more appropriate to use readonly.

Related: #5075, #5075 (review)

Additional context

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Sep 30, 2025
@9romise 9romise changed the title refactor(useClipboard)!: use readonly() instead of type assertion t… refactor(useClipboard)!: use readonly() instead of type assertion Computed Sep 30, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 30, 2025

Open in StackBlitz

@vueuse/components

npm i https://pkg.pr.new/@vueuse/components@5081

@vueuse/core

npm i https://pkg.pr.new/@vueuse/core@5081

@vueuse/electron

npm i https://pkg.pr.new/@vueuse/electron@5081

@vueuse/firebase

npm i https://pkg.pr.new/@vueuse/firebase@5081

@vueuse/integrations

npm i https://pkg.pr.new/@vueuse/integrations@5081

@vueuse/math

npm i https://pkg.pr.new/@vueuse/math@5081

@vueuse/metadata

npm i https://pkg.pr.new/@vueuse/metadata@5081

@vueuse/nuxt

npm i https://pkg.pr.new/@vueuse/nuxt@5081

@vueuse/router

npm i https://pkg.pr.new/@vueuse/router@5081

@vueuse/rxjs

npm i https://pkg.pr.new/@vueuse/rxjs@5081

@vueuse/shared

npm i https://pkg.pr.new/@vueuse/shared@5081

commit: cc8f98f

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 30, 2025
@codecov
Copy link

codecov bot commented Sep 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.16%. Comparing base (fc08195) to head (cc8f98f).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5081   +/-   ##
=======================================
  Coverage   67.16%   67.16%           
=======================================
  Files         367      367           
  Lines       14663    14663           
  Branches     2435     2434    -1     
=======================================
  Hits         9849     9849           
  Misses       4803     4803           
  Partials       11       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@9romise 9romise requested a review from antfu October 17, 2025 12:45
@antfu antfu added this pull request to the merge queue Oct 22, 2025
Merged via the queue into main with commit 67812c6 Oct 22, 2025
12 checks passed
@antfu antfu deleted the fest/readonly-clipboard branch October 22, 2025 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants