Replies: 1 comment
-
This is something I've also wanted for a while but the thing holding it back has been the inability to write server-side functions from the browser. I thought of just having a "refresh" button that would upload the function to Vercel/Supabase but it didn't seem viable because it would create a new deployment for each refresh on Vercel and AFAIK the only way to upload Supabase functions in through their CLI. But I'm suer excited because just today StackBlitz released Web Containers 🥳 This makes it possible to run Node in the browser and write functions alongside the static pages. I imagine the trickier part will be uploading that code to the various hosts. The code related to hosts really needs to be cleaned up and organized before doing this, but I'm strongly considering getting rid of Primo Desktop for now to just focus on Server, which would simplify things. |
Beta Was this translation helpful? Give feedback.
-
So far my experience with primo has been great. Sure it has some bugs here and there but nothing deal-breaking; plus @mateomorris is pretty fast on bug fixes.
What I really miss is server functionality. You can run things during build time by writing your own
<script type="module">
in the page body but everything else works client side and that's not ideal when working with API keys and/or sensitive data.Ideally I'd like the same functionality sveltekit provides with
+page.server.js
and+server.js
. I know this goes beyond a static site generator and maybe fit for a Pro (paid) Version of Primo.How can this work? Front-end-wise it could be another button next to
HTML CSS Fields
, e.g.Functions
and just open a popup to write our raw load function.Build-wise it could use the existing sveltekit adapters, primo after all is a sveltekit app, OR it can utilize supabase edge functions as it is already using Supabase for its own database and auth. Let's see some pros and cons:
Learning curve
Speed
Someone would argue: why stop there? Why not add hooks, pageless endpoints, stores etc right into primo? Sure but that would make Primo more like a sveltekit IDE and less of a page builder, not mention way more complex and buggy.
What alternatives I have considered:
vscode extension
So we keep primo as is (a static site generator) and accompany primo-server with a vscode extension that syncs our primo project with our local sveltekit project; thus creating 3 layers of abstraction: 1) Full-stack devs who use primo through the vscode extension, 2) Front-end devs who use Primo through its app/server web app (as they already do) and 3) content editors as they already work right now.
How am I currently using Primo?
Primo for me has been a godsent tool as I have been using svelte since late 2019. I mostly use it for static websites but also to draft out dynamic websites as I then mostly copy paste my components into vscode and take it from there. Having server side functionality in primo, in any capacity, would make my work a lot faster.
Beta Was this translation helpful? Give feedback.
All reactions