Skip to content
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

Add a [filter] option to sst dev #3753

Open
leo-petrucci opened this issue Apr 29, 2024 · 4 comments
Open

Add a [filter] option to sst dev #3753

leo-petrucci opened this issue Apr 29, 2024 · 4 comments

Comments

@leo-petrucci
Copy link

leo-petrucci commented Apr 29, 2024

Hello,

We currently use Serverless Framework in a Monorepo to develop and deploy our APIs. Serverless Framework isn't great, but it allows us to start as many or as few APIs as we want depending on the situation.

This has worked quite well because some of our Apps only use some of the APIs that we have. For example:

Store Frontend depends on:
> Auth API
> Products API

Dashboard Frontend depends on:
> Auth API
> Sales API

I've been trialing out SST as a replacement and I've loved everything about it so far, however I am confused by the sst dev command.

When running sst dev every single API in the Monorepo is automatically deployed and started. This works great when you only have a couple, but in my case I might end up having a dozen or more which would really slow down the process. I've read the docs and asked on Discord, but there doesn't seem to be a way to change this behavior.

I've been told to use enableLiveDev, however this option only stops re-builds. It will still initially deploy the app for development.

What's even more confusing is that sst deploy has a [filter] option which allows to deploy just one of the APIs.

Are there any plans the filter option could be ported to sst dev? It seems like it would be extremely useful in bigger projects!

Let me know if I've missed something in the docs. If this seems like a good feature I'm willing to open a PR.

@jayair
Copy link
Contributor

jayair commented May 3, 2024

Let me clarify, is your issue that the initial deploy is taking long and that's why enableLiveDev doesn't work for you?

@leo-petrucci
Copy link
Author

Let me clarify, is your issue that the initial deploy is taking long and that's why enableLiveDev doesn't work for you?

It depends on how enableLiveDev is supposed to work.

When enableLiveDev is set to true, APIs are still built and deployed when first ran. This means that if I have 20 APIs in my Monorepo, all of them will be built and deployed, which takes a considerable amount of time.

Those APIs don't rebuild on following changes which is great, but the startup time is still concerning since the assumption is that the more APIs I have the longer it'll take for me to start development.

@jayair
Copy link
Contributor

jayair commented May 14, 2024

Hmm 20 is a pretty small number tbh. But if there haven't been any changes it shouldn't redeploy them right? In this case are there changes to redeploy?

@leo-petrucci
Copy link
Author

Hmm 20 is a pretty small number tbh. But if there haven't been any changes it shouldn't redeploy them right? In this case are there changes to redeploy?

From my experience it re-deploys every time you run sst dev, it won't redeploy them if you make any changes.

To be clear I'm not talking about the first long deployment when you start sst for the very first time. I mean every time that sst dev is run on the CLI they're all deployed.

If that's not how that's supposed to work I can make a reproduction?

I'm still not entirely sure why not just have a filter option for dev wouldn't be a better solution. It would avoid everyone having to implement their own logic around enableLiveDev.

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

No branches or pull requests

2 participants