SolidJS

S

SolidJS

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

Join

Idiomatic Data Flow

I'm comming from VueJS, where components can emit events. This is useful so that a child component can notify a parent component of a particular user interaction. There doesn't seem to be a similar mechanism build into SolidJS, do you pass callbacks in props instead?

How does Portal work?

Source code: ```tsx export function Portal<T extends boolean = false, S extends boolean = false>(props: { mount?: Node; useShadow?: T;...

Uncaught TypeError: Cannot read properties of null (reading 'firstChild')

I am not sure what is the issue, but this part is failing to to render for some reason
No description

SSR long lived cache

Hi! i just want the page data to be cached on the server with a tag that i can re-validate, with no expiration i'm using Neon as database and every request to the database takes a couple of seconds. so for the blogs posts, each time you visit there's a waiting time. compare to next.js which feels instant, because of the cache how can i implement this? and why the Solid-start's cache function does not have a tag or date. it would make everything just easier...

How do I get the host or full request url inside a "use server" function?

For example, maybe I have this: ```typescript // src/routes/posts/[id]/index.tsx import { ErrorBoundary } from "solid-js";...

How to use createMemo to process a resource with Suspense

In my component, wrapping my expensive function in a createMemo causes the parent suspense to trigger rather than the suspense in the component with the expensive function. Here's a simplified example of my component's behavior. ``` const ConfigureBarSearchMatches = () => {...

"use server" confusion

i have this action in a src/routes/tables.tsx file. ``` const schedule_action = action(async (data) => { "use server"; schedule(data.tableId, data.date, data.time);...

How to interact with innerHTML

I'm trying to solve the following. I get sanitised HTML string from my Markdown renderer. I put use it in an innerHTML. I'd like to parse it, recognise the code blocks and add a "Copy to clipboard" button to each code block (top and bottom corners). This is the best code I could come up. ...

Help needed! I'm writing a blog post comparing nine frameworks

Last month I wrote a blog post "React Won by Default", and I am now writing a follow up post. In the new post, I've built a kanban app in nine frameworks for comparison purposes. One of the apps is built with SolidStart. I did the best I could, but I'm not an experienced Solid dev. I'm hoping someone will be willing to review my SolidStart code to make sure I'm using Solid conventions and optimizations correctly. One of my goals is small bundles, so if anyone can improve the app on that metric that would be great. ...

Firebase deploy SolidStart

I'd like to know if anyone has ever published a SolidStart project with ssr disabled on Firebase. Since most of the time it's self-hosted, I'd like to understand the steps a client should follow. When I deploy, I always get a blank page. Here's my firebase.json file, thank you....
No description

[FIXED] useContext returning default value even though Provider is set up properly according to docs

These are my project's files, I'm trying to make an I18nProvider on my own since I couldn't find any I18n library that fits my needs. However, even though everything in the code is simple and follows the docs (https://docs.solidjs.com/concepts/context), my console.log at index.tsx always prints the default value (None)

Best practice for supporting static and reactive args

If I want to create a reactive function that takes in either a static or reactive arg like this: ``` function createRequest(resource: string | Accessor<string>) { return createResource( typeof resource === "function" ? resource : () => resource,...

Certain ts import methods not supported?

Are there specific limitations to what "style" of imports can be used with solid.js? I ran into an issue while using the get method from the lodash package. Basically, all of the following ways of importing seem to cause errors with solid, even though (I think?) all these are valid ways to import lodash:...

using formAssociated in a Solid web component

Can someone point me to an example of a Solid web component that uses formAssociated to contribute values in form submissions?

Help to setup nested layout

Hey everyone 👋 I’m trying to figure out the best way to handle routing and nested layouts in SolidStart, similar to how it works in Next.js. In Next.js, I usually have a main layout file and then nested ones like (auth) and (main) — for example, (main) includes a common sidebar....

changing base Path

in vite it is just base, but it looks like the vinxi config omits that, and after doing some digging I found this comment where Ryan mentioned that he was going to leave it up to Nikhil https://github.com/solidjs/solid-start/discussions/1279#discussioncomment-8239480 after some more digging it looks like vinxi exposes a base property https://vinxi.vercel.app/api/router/client.html#base...

Performance issues

I'm working on a project, which purpose is to showcase different state managers' work in more than "to-do list" scenarios. Repository Solid + Signals/Stores version Basically, I've adapted React + Redux version to the Solid's rendering mechanism. I'm probably missing something, but when there is a large amount of data in the table, any change that affects the whole table (for example, removal of a row) takes seconds to complete. It happens in both dev and prod mode of the application. In React version, it is also not blazing fast, but much faster than this....

SolidStart PWA Support

Posting this here since this should be search indexable, right? Becasue there's almost nothing useful relating to this topic >~<... The main issue is that the manifest and service worker aren’t auto injected since SolidStart's way of bundling is different. Getting your web app recognized as a PWA...

Fresh Project ERESOLVE

I just ran npm init solid with SolidJS + Vite, Typescript and tailwindcss. Changed nothing but npm install doesn't work. ``` npm error code ERESOLVE npm error ERESOLVE could not resolve npm error...