Basil
`vite-plugin-solid` makes Vitest take over twice as long to run
I have over a hundred test files, and they take around 8 seconds to run. Adding the
vite-plugin-solid
Vite plugin to the Vitest config makes it take around 18 seconds to run, despite the majority of the tests being .test.ts
files and having no components (there are only two very small .test.tsx
files). It slows down the execution of all other tests, even though the only usage of Solid is a return createMutable(this)
at the end of the constructor of every class. The exclude
option does not seem to help.
My Vitest config:
2 replies
`createMutable` fails Vitest's `toStrictEqual` when `vite-plugin-solid` is active
When the
vite-plugin-solid
plugin is not enabled, the following test passes:
However, when the plugin is enabled, the test fails. I have a bunch of tests that rely on toStrictEqual
working with createMutable
, and adding vite-plugin-solid
has caused them to fail.
Why?
I can't seem to wrangle the include
and exclude
options in the plugin to fix this either. Is there a way to get around this other than using toEqual
, or do I have to refactor a lot of my test suite for this?1 replies
Using SolidJS's produce(), but with Immer-style patch generation?
Is it possible to use SolidJS's
produce
, but with patch generation akin to Immer's produceWithPatches
? (being able to only store the delta (patches), as well as supporting things like classes)
I'm currently using a combination of Immer's produceWithPatches
and reconcile
to work with a state that's made up of nested instances of various classes. The only reason I'm using Immer in the first place is to get the undo/redo functionality with little fuss, but it doesn't play well with SolidJS, and is slow and results in unnecessary re-renders.12 replies
Nested Immer "produce" signals with components
I'm trying to implement something like this, which would allow me to create "nested" signals that update the upmost signal:
I'm specifically trying to avoid having to use
setCompany
in a nested component, because that would become pretty unwieldy very quickly:
However, I'm not sure how to do this.7 replies
TypeScript type for classes that extend class
This Stack Overflow question is what I'm asking, but none of the answers provide intellisense for the function argument: https://stackoverflow.com/questions/76913841/generic-type-to-specify-a-class-which-extends-another
I'd like to be able to do something like:
2 replies
Good library for handling combobox-style search UI? (with Pagefind)
I'm trying to create an Algolia-style interface with Pagefind's search API, but I'm not sure how to handle the arrow navigation in an accessibility-friendly way. I was wondering what the best approach to this would be, and whether I should use an existing SolidJS component library (I don't know which one would work for this), write my own solution (not sure how to do that in an accessible way), or if this is possible with just HTML.
I made a GitHub Discussion in the Kobalte repo about potentially using the their combobox component, but looking through their documentation, I don't think that would be supported behavior.
4 replies