MaveriX89
MaveriX89
SSolidJS
Created by MaveriX89 on 4/30/2024 in #support
Vite 5.2.x / Vitest 1.5.x: How to Resolve Multiple Instances of Solid
Ended up solving it by updating my vite.config.ts with the following:
server: {
deps: {
external: [/solid-js/],
},
},
server: {
deps: {
external: [/solid-js/],
},
},
6 replies
SSolidJS
Created by MaveriX89 on 2/4/2024 in #support
How to handle necessary async/await work inside of a createEffect?
And yeah, not using SolidStart with the library (but I would like for it to be able to be used in that context if someone is interested)
8 replies
SSolidJS
Created by MaveriX89 on 2/4/2024 in #support
How to handle necessary async/await work inside of a createEffect?
Think IndexedDB from the browser
8 replies
SSolidJS
Created by MaveriX89 on 2/4/2024 in #support
How to handle necessary async/await work inside of a createEffect?
Ah, I see, I’ll expand the code snippet. I should have been clearer. I already have a reference to the database locally. The createDocument hook is returned as part of an outer closure function that provides the database signal. So just assume the DB instance already exists
8 replies
SSolidJS
Created by MaveriX89 on 2/4/2024 in #support
How to handle necessary async/await work inside of a createEffect?
@AlberTenez What if this is all client side driven? I’m not familiar at all with server actions or createAsync. It would be my first time diving into those ideas
8 replies
SSolidJS
Created by MaveriX89 on 1/28/2024 in #support
Getting ReferenceError: React is not defined with Vitest + Solid Testing Library
@Alex Lohr I think that’s a great idea. I think emphasizing that point of being able to rely on createRoot and linking to examples demonstrating that technique would be perfect. In my head, I had the impression that I needed to use the Solid Testing Library for anything and everything related to Solid
26 replies
SSolidJS
Created by MaveriX89 on 1/28/2024 in #support
Getting ReferenceError: React is not defined with Vitest + Solid Testing Library
So incredible — this just removed a heavy blocker I was dealing with in test. Thank you so much!!
26 replies
SSolidJS
Created by MaveriX89 on 1/28/2024 in #support
Getting ReferenceError: React is not defined with Vitest + Solid Testing Library
@Alex Lohr holy crapola! Wrapping with createRoot in test worked! So wait, is it safe to say there's no need to use renderHook from @solidjs/testing-library for hook libraries?
26 replies
SSolidJS
Created by MaveriX89 on 1/28/2024 in #support
Getting ReferenceError: React is not defined with Vitest + Solid Testing Library
Excellent — let me see if I can get away with just doing that then
26 replies
SSolidJS
Created by MaveriX89 on 1/28/2024 in #support
Getting ReferenceError: React is not defined with Vitest + Solid Testing Library
Ah, interesting, let me try that then. So I just wrap my hooks with a createRoot call in test?
26 replies
SSolidJS
Created by MaveriX89 on 1/28/2024 in #support
Getting ReferenceError: React is not defined with Vitest + Solid Testing Library
@Alex Lohr what parts are those exactly?
26 replies
SSolidJS
Created by MaveriX89 on 1/28/2024 in #support
Getting ReferenceError: React is not defined with Vitest + Solid Testing Library
In my case I’m just building a custom SolidJS hooks library
26 replies
SSolidJS
Created by MaveriX89 on 1/28/2024 in #support
Getting ReferenceError: React is not defined with Vitest + Solid Testing Library
I’ve just installed Vitest and created a vitest.config.ts and everything worked until I tried to create a wrapper component
26 replies
SSolidJS
Created by MaveriX89 on 1/28/2024 in #support
Getting ReferenceError: React is not defined with Vitest + Solid Testing Library
@Alex Lohr is there any way to get it working with just Vitest? Or do I have to use Vitest through a Vite config?
26 replies
SSolidJS
Created by MaveriX89 on 1/27/2024 in #support
Creating custom SolidJS hook that can be used in a global scope
Good call
17 replies
SSolidJS
Created by MaveriX89 on 1/27/2024 in #support
Creating custom SolidJS hook that can be used in a global scope
Ah, yeah, I can see that becoming a problem for sure
17 replies
SSolidJS
Created by MaveriX89 on 1/27/2024 in #support
Creating custom SolidJS hook that can be used in a global scope
Are there any potential downside to use hooks in a global manner for SPAs?
17 replies
SSolidJS
Created by MaveriX89 on 1/27/2024 in #support
Creating custom SolidJS hook that can be used in a global scope
Gotcha -- so it seems I can take one of those two approaches. Really appreciate the insight!! Thank you!
17 replies
SSolidJS
Created by MaveriX89 on 1/27/2024 in #support
Creating custom SolidJS hook that can be used in a global scope
Ah, excellent. It's either that or I wrap the entire export of my function in a createRoot is another option as well correct?
17 replies
SSolidJS
Created by MaveriX89 on 1/1/2024 in #support
Need clarity on eslint(solid/reactivity) warning use-case
Ah, extracting it out into a local variable and injecting it into refreshRowsis a genius move and fixes the warning! Thank you so much for this insight and context! Super helpful! I feel like this use-case should be documented in the docs for that eslint(solid-reactivity) rule.
5 replies