setAttribute alters the type of data in and breaks references to an array property
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 17.6k
- Forks
- 4.4k
- PR merge metrics
- No merged PRs in 30d
Description
Description:
PR #3095, which fixed #3092 wherein default values for array types were not being used, introduced cloning of array properties by converting them to JSON and back. For me, this means calling setAttribute for a component (when the array property itself is not being updated) converts an array of Date objects to an array of strings and also breaks any existing references to that array property value.
Perhaps #3092 could be solved in the schema parser instead by taking an empty string to mean "use the default" and #3095 could then be reverted. I will create this PR if you agree or if a better solution arises.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading PR #3095 and issue #3092, then reproduce setAttribute on a component with an array of Date objects and an existing reference to that array. Done means preserving the array's data types and references while retaining the intended default-value behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- game-dev, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100