SolidJS

S

SolidJS

Solid is a declarative reactive Javascript library for creating user interfaces.

Join

createSignal vs createStore

When should createSignal be used instead of createStore and vice versa? If I want to store an object in state, for example: ``` const user = {...

How to change base directory

I want to deploy my website on a subfolder of the url. Right now, I have it deployed on my-site.netlify.app I have a website on my-domain.com...

Calling a "use server"; function in a ClientOnly component?

Hi - can a ClientOnly component call a function defined in a "use server"; lib file? Will the call be translated to a fetch to the server?

Unable to run any vitest tests on initial launch

I created a new solid start project via bun create and added the default vitest setup. I was trying to just see if any test would run, and I'm getting this error. Anyone know how to solve this? I haven't touched any defaults yet.
No description

context

Hi all, I have a question about context scoping. ```typescript import { render } from "solid-js/web"; import { useContext, createContext } from "solid-js";...

How to ideally protecting routes with Layout

I was using Solid Start with auth js, everything fine. But when i look the server log, it was called twice.
[login]-> [getSession & wrap in server fn with key]-> [call in layout]-> [also call in page]-> [called twice]
[login]-> [getSession & wrap in server fn with key]-> [call in layout]-> [also call in page]-> [called twice]
...

solid-start is unable to resolve import aliases

I've added some import aliases in tsconfig.json file. The typescript and IDE part correctly resolved it. It didn't work in the solidjs server tho. So, I modified the app.config.ts. Here's my updated part. ``` export default defineConfig({ ssr: true,...

Throw redirects in data APIs with "use server" at the top of the file not working.

Hi everyone! 👋 I'm working on a Solid Start project and have a question about query behavior and redirects. I have a query called getIdentity, which fetches user identity from cookies and db. The goal is to call this query on the /account page to check the user's identity. If no identity is found, I throw a redirect to /signin....

Efficiently Managing Supabase Sessions and Context Sharing in SolidStart

I am developing an application using Supabase and SolidStart, and I’ve encountered some challenges related to session management and sharing a Supabase instance. My Scenario 1. Session management after user login: • After a user logs in, Supabase returns sessionData (including access tokens, etc.)....

Difference between Soild/Signals & Preact/Signals?

Seems the SoildJS/Signals is still alpha (strange since Soild has been around for years), & PreactJS/Signals is now 2.0 Anyone know the performance & DX differences please?...

Containerized Solid Start Deployments

I'm new to using Solid Start and full-stack frameworks -- I usually create "vanilla" app architectures (e.g. a Solidjs SPA paired with an Elysia backend-for-frontend layer). With those vanilla setups, I could containerize the deployments using Dockerfiles and reason about them very easily. However, for Solid Start, I'm not sure how to reason about them fully because there are gaps in my knowledge. The intent I have is to create a containerized Solid Start deployment that I could run anywhere (Azure, AWS, GCP, etc.). In my app, I am using a database (SQLite + Drizzle ORM) and Better Auth for authentication/authorization (it adds tables to the database mentioned earlier). I would also like to use Bun for my runtime -- unsure if this is a wise-decision if Bun isn't supported fully across hosting providers. I had the following Dockerfile but unfortunately it does not work as the docker build chokes when attempting to install the better-sqlite3 dependency I have in my project:...

`useSession()` unexpectedly changing

I'm having a hard time with useSession() and I'm not sure how to articulate my issue. I have some routes protected by a getAdmin() query, redirecting the visitor if is not logged and not admin. The process is working, and the session is supposed to be valid for 14 days. However, after 1 click, or after n clicks – it varies, it does not work anymore. I noticed in the request header in my browser that the cookie value is changing when it happens: from cockpit=Fe26.2**78859073ec... (the valid/logged cookie) to cockpit=Fe26.2**1be0589ce4be (the invalid/blank cookie) without specific reasons. What I noticed though is that the cookie is changing due to the response of the admin layout route as shown in the screenshot....
No description

type augmentation in monorepo with turbo-repo

Not strictly solid specifacally related but wanted to try my luck here anyway, since i'm working on this in a solid-project. I have a monorepo setup with turbo-repo and trying to do "type augmentation" for LinkProps. I have a ui package set up of which i want to augment some props....
No description

Complex createResource management

I'm trying to write a way to handle a specific scenario where I wanted to use something like a const ws = useWebSocket(); that: - when called on the server side, initializes a WebSocket connection to another server and returns a server side wrapper to the WebSocket ~ must be waited and cached - when called on the client side, initializes a WebSocket connection to the SolidStart server and returns a client side wrapper to the WebSocket ~ must be cached - when the user session id changes, the connection must be closed if the id becomes undefined or create a new one if the id is not the same as the previous one - the wrapper contains the same functions on the server side and client side, allowing it to be used inside other resources...

SolidStart Meta not updating

Per the docs, I tried to add meta tags to my website, I added the base <MetaProvider> and the fallback tags inside my <Router layout={}/> as seen below ``` <MetaProvider> <Title>test</Title>...

abort `"user server"` function call

is it possible to abort a call to a "use server" function? behind the scenes they're just fetch()es right? if so is there some way to pass though an abort signal? thanks....

Unable to provide context to children

I'm writing a dropdown component, so I decided to use a context to provide tools to the children. I have defined the context as an object with some setters and accessors to a set of signals and no matter what I do, I can't get it from the children components. I'm using SolidJS + SolidStart Here's some code snippets:...

createSignal with preexisting data store?

https://playground.solidjs.com/anonymous/5ab699c2-0e36-470c-9aae-a9fa62d15d75 Seems the UI will not update when the data is updated outside of createSignal; how can I add it in my data.tsx file please? The timer (while burning) should update the current state to empty when the fuel runs out to 0. TIA...

Solid Start does not load images on load event?

```ts import { Show, createEffect, createSignal } from "solid-js"; interface LazyImageProps { placeholder?: string;...

Problem with text that jumps lines CSS

Would anyone know how to fix this problem? I have tried everything but it doesn't work for me, if I have a choice of for example 2 words, the dropdown will not increase its size to show both words on a single line, I can use no-wrap but if I shrink the window , the text will not skip lines so that everything is visible. I'm not sure how to fix it.
No description