malloydata / malloy

Malloy is an experimental language for describing data relationships and transformations.
http://www.malloydata.dev
MIT License
1.96k stars 76 forks source link

feat: allow incomplete render #1738

Closed skokenes closed 4 months ago

skokenes commented 4 months ago

Previously, our malloy-render webcomponent would throw an error if you did not provide any results for it to render. However, this has made it hard to incorporate into components in certain frameworks (cough React cough) because of the way those frameworks handle instantiating and passing values to web components.

This PR adjusts the malloy-render webcomponent with a wrapper that will return an empty element if the results aren't provided, rather than throwing an error. That way, certain frameworks can create the web component instance and attach it to the DOM before passing along initial properties without any error throwing issues.