-
Notifications
You must be signed in to change notification settings - Fork 546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sst integration #133
Comments
Isn't that a build tool similar to nitro? |
@pi0 No, Serverless Stack is similar to the Serverless Framework, though with some advantages, including:
|
Surely. I put the nitro and serverless framework in the same category. Nitro dev has HMR and outputs (also as) a lambda format from the same code and provides similar constructs for Storage, etc. Doing the same thing but different approach. I don't see the point of combining two server frameworks like this together. But you can chain |
The point of combining SST + Nuxt is so that they exist together (with Nuxt as a yarn workspace) and Nuxt can simply import functions from the back end code, instead of making API calls. In other words, it reduces latency by going from:
to this:
|
Indeed but actually Nitro also exactly does that too! When you use |
I'm not familiar with Nitro at all, but will it let you define a several sets of CloudFormation stacks and deploy them? Along with Lambda funcs of course, and being able to test locally? |
Example structure of SST + Nuxt:
SST's Lambda funcs (and GraphQL APIs, etc) can import modules from |
Further context: my back end (built with SST) is a highly complex set of stacks including S3 buckets, SQS queues, Lambda functions, Step Functions, and more. By bundling our Nuxt app into that repo, it has direct access to all the same core code that the various AWS services do. Of course, there are still kinks to work out. But I think the latency savings will be worth the effort. Thinking about this more, I'm not too sure if this is a good candidate as a Nitro preset. The Nuxt app needs to live within the SST repo, not vice-versa. |
If you like to use a wrapper of SST to integrate your backend with Nuxt 3, it should be possible to adjust the I think it might be worth investigating solutions to make your backend compatible with Nitro instead of wrapping it to another framework. Normally with Nuxt 3 it should be like this:
Business logic sits in the Nuxt 3 app (as a full-stack framework inside Nitro is following a similar goal of Serverless and SST but with a different approach of being provider agnostic layer for Nuxt and supporting output formats beyond lambda.
I can assure you Latency saving with nitro, if not more than other solutions, isn't less. We only need to find a solution to migrate your backend into compatible format :) |
Well, the main cost savings is Nuxt having direct access to our database. But it would be sloppy to copy the necessary code from our back end to Nuxt and duplicate all of that. The front-end app also needs to access the same bit of code.
And of course, the Nuxt app could just call the same API Gateway endpoint that the front end does, but again, I want to avoid calling API Gateway twice and having the user potentially experience two Lambda cold starts. Any thoughts/ideas? EDIT: Might work out to move that Operation A logic into Nuxt, and then just have the front end call the Nuxt endpoint. |
@pi0 from what I understand, I don't think Nitro and SST are in the same category
I'm not sure what would be the right approach to make these 2 work together, but perhaps it would involve a Nuxt construct on the SST side and a Nitro plugin ? Nitro doesn't really replace SST, so I think there's value in making these 2 play well together. |
Shouldnt the SST So maybe create a PR on SST to have the stack setup in as described in the docs of this commit |
Referencing these upstream issue and PR : Working demo by @jdevdevdev Linking sst/sst#2314 (comment) |
It'd be cool to support it directly in nitro but i think @chris-visser and @Hebilicious are correct in that I think the responsibility of integration lies on the sst project. |
It'd be cool if the integration with sst considers their new project, ion, willing to ditch Cloudformation for open source Terraform providers. Check https://sst.dev/blog/moving-away-from-cdk.html |
Moving to #2973 |
https://serverless-stack.com/
https://github.com/nuxt/framework/discussions/4471
The text was updated successfully, but these errors were encountered: