webcomponents / webcomponents/custom-elements-manifest
Add support for custom data
- Dominant language
- TypeScript
- Stars
- 502
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
Salesforce is quite interested in capitalizing on a manifest like this for a range of projects. I believe the proposed state of schema.ts already covers the majority of Salesforce's requirements. The remaining requirements are rather proprietary, and could be addressed with general-purpose mechanism for including custom data in a manifest.
This could be achieved by:
1. Adding a standard, unrestricted `custom` key to the top-level schema.
2. Recommending a strategy for component authors or tool vendors to further subdivide that `custom` key. Example: an organization adding custom data should do so inside a key containing a relevant domain name they own.
3. Encouraging tools to either ignore `custom` keys they don't understand, or to perform generic processing of anything they find there. Type-checkers could potentially ignore all that data. A doc tool could either skip the custom data, or format it as a pretty-printed JSON block or table as supplementary documentation.
Example: Using some hypothetical custom data values taken from Salesforce's own internal requirements, a Salesforce component might include the following in its manifest:
```js
{
"custom": {
"salesforce.com": {
"apiVersion": "53", /* Salesforce platform API version targeted by this component */
"formFactor": "mobile", /* Component is designed primarily for mobile use */
"capabilities": [ /* In which product environments is the component capable of being used? */
"dashboard",
"communities"
]
}
}
}
```
Something like this would minimize the impact on the schema design, give component creators a way to include component metadata in a single place, and increase the chance that a tool created by one group could be used by a different group without choking on unexpected custom data. This would also provide a means of trying out new ideas for schema fields before standardizing on them.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.