tram-lite icon indicating copy to clipboard operation
tram-lite copied to clipboard

API Proposal: Expose Custom Element Manifest from ComponentDefintion / define function

Open JRJurman opened this issue 1 year ago • 1 comments

Summary

Right now intellisense when using web-components can be lacking. However, there is a standard for custom-element manifests, see https://github.com/webcomponents/custom-elements-manifest

This provides auto-completion and hover-over information, similar to what's already available for native HTML elements. You can see interactive examples of this here: https://github.com/microsoft/vscode-custom-data/tree/main/samples/webcomponents

We should provide an interface, either in the define function, the ComponentDefinition class, or ideally both, that allows users to define the details of, and get an export of their manifest. Ideally developers would be able to make use of the details here at runtime, although the practicality of that is potentially low.

While we should strive to make the single html file the best possible experience, there is a possibility that this would be a huge benefit to library developers.

JRJurman avatar Sep 02 '23 03:09 JRJurman

The best possible option here might be to generate a file when exporting a component to a JS definition. This should allow developers to share documentation about their own components.

JRJurman avatar Nov 09 '23 02:11 JRJurman