Clarification on "use server" comment in SolidStart
"use server" comment only has bearing on query and action functions, right? but how do I avoid bundling the functions that get called inside those HOC functions?
example, all my "use server"-ed query functions import the function
realistically tho, that won't work bc the env vars won't be available client-side. but then there's other issue of unnecessarily adding extra size to the bundle.
i also have trouble understanding when should I declare "use sever" on the 1st line of a file. i have a file called
i've also read a ton of comments using
example, all my "use server"-ed query functions import the function
sql from a lib/database.ts adding "use server" to the sql function doesn't have an effect? if it doesn't have an effect, how do i prevent accidentally bundling the sql function into the client bundle if I, on the off chance, import it client-side?realistically tho, that won't work bc the env vars won't be available client-side. but then there's other issue of unnecessarily adding extra size to the bundle.
i also have trouble understanding when should I declare "use sever" on the 1st line of a file. i have a file called
api.ts full of query and action functions - instead of adding "use server" to each of them, can I just declare "use server" once at the top of the file? where else can I use "use server" - can I also use it on components to force it to be SSR only and avoid using CSR?i've also read a ton of comments using
.server.ts server modules but there's no mention of it in Solid docs. I've only used those in SvelteKit, but curious if we also have them in SolidStart