playcanvas / playcanvas/editor
Better messaging for when script attribute parsing fails
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 215
- Avg merge
- 1d 29m
- Merged PRs (30d)
- 30
Description
There is an issue with script attributes parsing, leading to some errors in editor. Seems like regression since JSON schema been introduced.
Steps to Reproduce
- Create new blank project
- Create new script
test.js - Paste this code into it:
var Test = pc.createScript('test');
Test.attributes.add('chunk', {
name: 'shader',
type: 'asset',
description: 'test'
});
- In Editor, select
test.jsasset - Hit "Parse" in Inspector few times.
Issue:
Look in console, it failed to update data of that script attributes in underlying data (Observer), due to schema issues. It might be that the path for field it tries to set for attribute - is wrong.
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
Reproduce the issue with the test.js script from the steps, select it in the Editor Inspector, and press Parse while watching the console. Trace the script-attribute parsing and Observer update path to determine why the schema path fails; done means parsing produces an appropriate message and updates the underlying attribute data correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100