hey all, got some interesting news. I’m working wi...
# general
s
hey all, got some interesting news. I’m working with the author of the Vite SSR plugin to develop an SST example to add to their repo 👍 nice to have another SSR serverless option! I’ll post a link here once it’s done and fully tested
r
Nice one
a
I don’t know Vite.
s
I use Nuxt now and really dislike it
t
Wow nice!
s
Nuxt’s developer experience is.. not great. and just feels clunky to me
r
That's an unusual opinion on Nuxt, what don't you like about it? (I know Vue well but not done much with Nuxt)
s
I find the whole module system confusing (
buildModules
vs
modules
), there’s plugins, middleware, two ways to fetch data on the server side.. it’s a little unwieldy. and I also recently realized all the server-side data you return to the client is fully exposed in the source code without any kind of obfuscation
I get that the server has to inject variables into a variable in the source so the client can pick up what it needs, but still. at least base64 encode it or something!
j
That's awesome Sam!
s
@Jay my schedule is finally calming down as we’re approaching soft launch. I might spend some time doing a write-up on building an SST + Vite SSR app
it would be valuable to have something like that out there
hey, does SST have the ability to create templates? when you create a new SST project?
doesn’t look like it. man, it would be great to be able to do
yarn create serverless-stack --template whatever myproj
and the GitHub repo could have some templates to help people get started quickly
j
Oh we do it using the
--example
flag.
Copy code
$ npm init serverless-stack --example react-app
# Or with Yarn
$ yarn create serverless-stack --example react-app
s
Ah! I didn't notice that flag when I ran the CLI app
Awesome
d
really interesting to hear that opinion on nuxt too. i'm far from the vue world. i would think if nuxt works with vite, it'd be great (or anthing that uses esbuild or swc now).
s
ok, I have a real-world example of why I find Nuxt so frustrating: trying to have a
/robots.txt
“file” set up for my app. I figured I’d use the server middleware to do this.. so
/robots.txt
calls a function that just does a
res.end(robotsText)
and doesn’t render any pages. it works fine locally in dev mode, but once I deploy, the server middleware fails to execute. 🤷‍♂️
stuff like this happens fairly often. things just don’t work. and in most cases, trying to get help on the Discord server is like shouting into the void
r
Although I don't have experience myself this really surprises me as so many in the Vue community enthuse about it. Are you in the Vue Land discord?
s
I am. but you’re supposed to go to the Nuxt server for help. sometimes I get answers to my questions, but it’s rare
r
Thanks Sam, you've given me pause. I was considering moving some of our frontends to Nuxt for SSR purposes, I think I consider other options now. I'm intrigued how vite works for that, we're already using it for local dev in a couple of apps.
s
I mean, maybe it’s just me. or, as it occurred to me today, I might be having problems because I’m using Nuxt as a serverless web app. I think if you put it on a plain old 24/7 server, it’s probably ok. maybe I’m wrong about that, I don’t know all I know is, it’s pretty crazy in 2021 for an SSR framework to not have clear instructions or examples on setting up & deploying for Lambda
I’ll keep this Slack posted on my progress with SST + Vite
r
Great, thanks Sam
j
Appreciate it!