vuejs / vuejs/docs

`structuredClone` api will produce an error if argument is reactive object

Open
#3,223 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vue
Stars
3.2k
Forks
5k
Avg merge
14d 17h
Merged PRs (30d)
1

Description

I've recently stumbled upon this issue https://github.com/vuejs/core/issues/8975.
I think the documentation should include tips on how to clone a ref/reactive.

Since ref and reactive allow to compose reactive objects, toRaw still may not work for them due to how it works: https://stackoverflow.com/a/72633173/16716350

Maybe the doc should recommend an official cloning library ?
useCloned from VueUse or klona ?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked Vue core issue 8975 and the existing documentation for ref, reactive, and toRaw. Clarify whether the docs should explain cloning reactive objects or recommend a library such as VueUse's useCloned or klona; done means the guidance and recommendation are explicit.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.