Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Support web components (or any components) #221

Closed
wants to merge 3 commits into from

Conversation

michaelwarren1106
Copy link

@michaelwarren1106 michaelwarren1106 commented May 8, 2021

IMO, there are two things stopping any kind of component from being able to be easily used with Playroom.

  • importing the component code into the Playroom build
  • Getting hints registered in the proper format

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

@michaelwarren1106 michaelwarren1106 requested a review from a team as a code owner May 8, 2021 01:52
@michaelwarren1106
Copy link
Author

Bumping this PR just to get the initial build running. Is there anything else I need to do to at least get a build?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant