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

Feature Request: Only run in dev mode #1

Open
henricook opened this issue Mar 14, 2024 · 6 comments
Open

Feature Request: Only run in dev mode #1

henricook opened this issue Mar 14, 2024 · 6 comments

Comments

@henricook
Copy link

This looks great, just what I'm looking for for my next app. It looks like it would currently run even in Production mode though (i.e. after an npm run build) - could it be changed to only run in dev mode, or have a flag for that?

@henricook
Copy link
Author

@lws803 If you think it's a worthwhile improvement and I haven't missed anything, I might raise an MR - is that ok?

@lws803
Copy link
Owner

lws803 commented Apr 9, 2024

Hi @henricook apologies for the late response! Been pretty slow on the uptake here as I was busy with work 😅.

Oh this use case is pretty interesting, mind if I ask why you'd prefer to run it on dev instead of production / both? 🙂 Either way, happy to accept an MR for this. Feel free to open one up and I'll take a look!

@henricook
Copy link
Author

@lws803 I think that in prod it's all built, so there's nothing to warm up, so the server would be hitting itself for no reason - have I understood correctly?

@lws803
Copy link
Owner

lws803 commented Apr 10, 2024

Oh that's correct, the pages are all built and served to the client (if they're not server rendered) but the APIs aren't. Those are serverless and only spin up with a small warm up delay when they're called 🙂. That's why this hook was built to ensure these API routes / server-side rendered pages are called and warmed up in advance.

@henricook
Copy link
Author

Ahhh I see, that fills a gap in my knowledge thanks - so perhaps just an optional config flag for dev-only behaviour, great! I'll MR it in the next ~couple of weeks

@lws803
Copy link
Owner

lws803 commented Apr 21, 2024

No problem! Looking forward to that MR then 🙂 feel free to ping me when you have it opened!

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