WIP: Support web components (or any components) #221
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
IMO, there are two things stopping any kind of component from being able to be easily used with Playroom.
This PR provides an example for TS/ES web components (Lit) to be imported through the standard
components.js
but bypassing the normal export option by just exporting{}
Also, I added a new config option in playroom.config.js
componentHints
that takes either a function or a hints object. The results of that config property are passed to the CodeEditor component (manual hints are preferred if they exist) so that hints can be manually generated and passed into playroom in a case where the component authoring mechanism doesnt allow attribute types, props, defaults to be automatically deciphered.This is my first contribution to an OSS project, especially one of this size, so please tell me where I've gone wrong or if you'd like to see a different approach. I wasn't sure that running cypress tests was relevant since i've only added a config prop, but I'm open to adding features to test the new config if need be.
This PR is something similar to work that my coworker has done locally to an install of playroom we have running. We use Lit web components, and having this config prop be native would simplify our playroom considerably, and let us just parse output from analyzer tools such as runem's web-component-analyzer or the new one open-wc is working on
addresses #156