rmacfie
how to use bun:sqlite without it leaking to the browser?
You may get some guidance from this example with Prisma: https://github.com/solidjs/solid-start/tree/main/examples/with-prisma
Pay attention to how the
const db
is declared in one file (src/lib/db.ts
) and the actions with "use server"
are declared in another (src/lib/index.ts
), and then the components that use them are in yet another file. This separation is necessary to enable complete treeshaking so that the code that you only want on the server does not leak to the client.
I'm hoping there will be more thorough documentation on this, because I also find these things to be rather confusing.12 replies