Hi All, Since pre-rendering is a hot topic right now I would love to ask for the feature to have control over the deployment chain, so that during my application build I can reference freshly deployed functions. Currently functions deploy at the end after my application build, so all I can do is to reference live functions.
I got inspired by Smashing Magazine solution from JAMstack ebook:
“Smashing Magazine’s JAMstack site: each time a user comments on an article, a simple function commits the comment to the site’s repository and triggers a new build (as long the comment passes moderation).”
-Excerpt From: Mathias Biilmann and Phil Hawksworth. “Modern Web Development on the JAMstack”. Apple Books.
Here is my desired chain:
- Trigger deploy
- Functions deploy first, making them exposed to the app build
- During application build, I pre-render all the content fetching data from above functions, simple GET methods in each app route.
- My app goes live with pre-rendered data so there is no need to fetch it again during runtime.
and I guess the chain could be configurable in
netlify.toml file All the logic of pre-rendering is of course on me. All I wish is to have those functions exposed during the app build. Smashing Magazine’s approach is a little different, since they commit new change to the repo, but I think above workflow could be next level of that approach and everything would be cooking on the fly.