Samual 🦢
modern equivalent of `createRouteData()`
I'm in a solid start project and am looking for the modern equivalent of
createRouteData()
. I used to be able to use it have data that was refetched after a form was submitted. the closest modern equivalent I can find is cache()
and createAsync()
but that is very overkill and has an annoying (in this use case) feature where it caches for 1 second which means if a user is rapidly clicking a button which is rapidly submitting a form, changes can only be observed once a second rather than as soon as the user clicked.
Thanks.11 replies
am I using <HttpHeader/> correctly?
I setup a new SolidStart project with
pnpm create solid
and selected the basic
option.
I modified src/routes/index.tsx
to add <HttpHeader name="x-foo" value="bar"/>
like so:I then ran pnpm dev
but as soon as I visit localhost:3000
in the browser, Vinxi crashes with the message Error: Cannot remove headers after they are sent to the client
what am I doing wrong?1 replies
use server get cookie
hi
I'm currently migrating a project from
[email protected]
to @solidjs/[email protected]
which means I'm converting server$()
functions into async
"use server"
functions.
I used to use server$.request.headers.get("cookie")
to get cookies.
just wondering what the modern equivalent of that is.
thanks.3 replies
mark module or just variable as secret to stop being bundled into client
with colocation I have accidentally bundled stuff into the client that should only be on the server twice now
is there a way to mark a module or variable as secret so that when the bundler tries to bundle it into the client, it instead errors out at build time?
3 replies
set response header from within `createServerData$()` callback
hi how do I set a response header from within the callback of
createServerData$()
?
useRequest().responseHeaders
is undefined
(despite typescript saying it's always a Headers
object)
this
evaluates to a different PageEvent
that is also missing the responseHeaders
property
I've tried setting the .responseHeaders
property with the headers I want myself on both but neither worked
my goal is just to set a cookie when the server data is fetched, that's all I want8 replies
input elements become empty upon hydration
If I load a page developed using solid start on a slow connection, and enter some text in an input element while the javascript is still downloading in the background, the input element becomes empty as soon as the hydration kicks in
this is a very frustrating experience, is there any way to fix it?
4 replies
basic progressively enhanced counter not working
In my project I was running into an issue where I was getting the initial state of a variable so I made a minimal reproduction
when javascript is disabled it always displays "0" and when javascript is enabled, it initially shows "0" and then becomes the number it's supposed to be after being clicked
I looked into the produced code and for some reason the
count
variable is duplicated and in some cases the first one is used and in other cases the duplicate is being used13 replies
Are there any semantic or performance differences between `Show` and ternaries?
The docs say:
It is similar to the ternary operator (when ? children : fallback) but is ideal for templating JSX.But I'm not sure in what way it's ideal for templating, is it talking about just DX or also ideal performance-wise?
6 replies
how do I tell FileRoutes to look for a folder other than `routes`?
I have a solid start node instance handling multiple domains
this means I need multiple
<FileRoutes/>
configured with different routes
folders and then on request look at the domain and use the associated <FileRoutes/>
for that domain2 replies