web-component-analyzer
web-component-analyzer copied to clipboard
Request Support for LWC Components
I would love to see support for Lightning Web Components (LWC).
LWC Repo: https://github.com/salesforce/lwc
Hi, thanks for opening this issue :-)
I think I need some more information. What specifically isn't supported?
I'm just guessing, but currently there are some issues analyzing dependencies that don't ship typings. However, I have a plan for how to add the support for that, I just haven't yet come around to do it.
Is that what you are experiencing?
@runem Hi Rune, I'm currently looking at integrating LWC with Storybook and wca. I created a sample project here https://github.com/priandsf/lwc-storybook to conduct the experiment.
I'm getting some decent results after adding the JSDoc. I'll figure out what is missing, if any.
To answer your question above, LWC is a bit different from native web component:
- The components must inherit from LightningElement and not HTMLElement. Moreover, many libraries are organizing components in an hierarchy with base classes.
- LWC uses a few proprietary decorators (@api, @track, @wire) that can carry useful information.
- LWC needs a wrapper to be registered as custom elements (see: buildCustomElementConstructor)
- LWC uses a template file containing the HTML to render
- there might be others that we'll discover...
Also, Salesforce could use an XML meta-data file, describing the component, in particular when it is consumed by a GUI builder. This file can provide useful information.
I'll be happy to collaborate.