malloydata / malloy

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

feat: migrate renderer to solidjs #1664

Closed skokenes closed 3 months ago

skokenes commented 3 months ago

Migrates majority of malloy-render from Lit to SolidJS.

The final output remains the same: a web component called <malloy-render>, with the same API as before. This branch works with the existing VSCode extension as is.

This PR leaves Lit in place for now with the <malloy-bar-chart> component. I have a separate branch that involves a lot of charting changes, so it didn't seem worth it to migrate malloy-bar-chart as is here just to then refactor it in the next PR. That charting PR will handle dropping malloy-bar-chart and Lit and replacing with internal Solid components.

The bundling system has been switched to Vite. The esbuild bundle is still in place because malloy-py relies on it. In a separate PR, I will remove esbuild and its bundle so we will have just one bundled web component exported for all consumers.

For now, building the module source code is done with Vite as well, instead of the tsc approach from before. The reason is due to the need to support importing CSS into CSSStyleSheets. CSS Module Scripts will allow us to import CSS as modules natively; however they are not supported by all browsers nor TypeScript yet. Once supported by TypeScript, we can then revert the module build to just using tsc.

I had to add a jest test setup script for the rendering tests since the tests are run in node and not JSDOM as the environment. We need to come up with a better render testing approach in a separate PR.