feat: migrate renderer to solidjs #1664
Merged
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.
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 usingtsc
.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.