media-chrome icon indicating copy to clipboard operation
media-chrome copied to clipboard

Add custom elements manifest analyzer + plugin

Open luwes opened this issue 2 years ago • 3 comments

This change is the start for adding a custom elements manifest. Related to https://github.com/muxinc/media-chrome/discussions/158

A little downside of Media Chrome using constant variables is that the analyzer can't pick the attributes and events up automatically. An alternative is to use special JSDoc syntax to get these picked up. https://custom-elements-manifest.open-wc.org/analyzer/getting-started/#supported-jsdoc

I added one example for the Airplay button.

The custom function defineCustomElement() in Media Chrome was causing issues too, luckily this could be automated with a plugin. The analyzer expects customElements.define('my-el').

luwes avatar Mar 13 '22 02:03 luwes

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/mux/media-chrome/6RLsix52QwF6g4nNnCYkMkjpZZtK
✅ Preview: https://media-chrome-git-fork-luwes-custom-elements-manifest-mux.vercel.app

vercel[bot] avatar Mar 13 '22 02:03 vercel[bot]

Since this is all built on tsc plugins using its AST model, we should be able to build something that works with our constants. Do you think this would be a value add at this stage without also updating the jsdoc comments?

cjpillsbury avatar Mar 14 '22 13:03 cjpillsbury

@cjpillsbury yes, I think it was possible with Babel, https://github.com/wooorm/babel-plugin-inline-constants. maybe TS too, might be worth trying out

luwes avatar Apr 15 '22 22:04 luwes

closing until we get to this

luwes avatar Sep 15 '22 23:09 luwes