Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

support for SSR? #1

Closed
jkdoshi opened this issue Oct 4, 2022 · 2 comments
Closed

support for SSR? #1

jkdoshi opened this issue Oct 4, 2022 · 2 comments

Comments

@jkdoshi
Copy link

jkdoshi commented Oct 4, 2022

Thanks for starting pbscript. It's a great companion to pocketbase.

My default strategy with pocketbase is to use SvelteKit frontend, and make it as static (JAMStack) as possible. But sometimes dynamic code at runtime is still needed. For example:

  1. When you want to have a runtime API endpoint to generate runtime results.
  2. Or when you need runtime SSR of a page (imagine a site with local business listings of 50,000 cities; not practical to prerender them all).

pbscript (I think) would be useful in scenario #1, but perhaps not in scenario #2? Technically, SSR is still just script execution, but maybe I don't know enough about pbscript to see how it would work.

Eventually, it would be nice to have a SvelteKit adapter that generates JS code that simply runs in pbscript.

PS: I put this in as an issue, since "discussions" feature is not turned on yet.

@benallfree
Copy link
Owner

Pocketbase exposes a hook API written and Go. Normally, other customizations must be written in Go and re-compiled. PBScript allows you to write hook handlers in Typescript or JavaScript instead of Go.

SvelteKit would do all the SSR handling. If you were to use the PocketBase js sdk client during an SSR request, that should work because the client will work in a node environment.

Did I understand your question correctly?

@benallfree
Copy link
Owner

Closing this issue due to inactivity.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants