Feature Request: Support Arrays values in `DOMTokenList`-style
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.1k
- Forks
- 441
- PR merge metrics
- No merged PRs in 30d
Description
Stimulus currently provides an Array-type for values. However it is encoded as JSON, which while necessary for complex objects, feels un-HTML-like for simple arrays of strings. At a practical level, it means extra care has to be made to escape values.
DOMTokenList is used in many places in Web APIs, such as classList and aria-described-by attributes. Ideally we would mimic that.
static values = {
permittedTypes: 'List' // or possibly DOMTokenList
}
connect() {
this.permittedTypesValue.forEach((permittedType) => {
console.log(permiitedType);
});
}
Contributor guide
No contributing guide indexed for this repository
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
No source file or test is named in the issue. Start with Stimulus's existing Array value documentation at reference/values#types and compare the requested behavior with the DOMTokenList reference; done means a documented value type supports simple string arrays without JSON-style encoding.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100