Replies: 1 comment
-
Thanks @gionkunz. It's an interesting use case for sure. Server-side data fetching implies that you're going to ship a server along with your static assets to handle requests after the first load. I did land a fix here for using transfer state on initial load. There could be a way to always pull from transfer state for SSG. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Dear maintainers :-) First of all, I really enjoy working with AnalogJs and it's very cool to have Angular catching up in the SSR / SSG domain.
My use-cases are mostly pure SSG, so I usually go with
static: true
. I'm using the Server-Side Data fetching with a co-located .server.ts file in the pages folder.I found it a bit un-intuitive, that now my statically generated site is still trying to call the server API to fetch the data. I would have expected that fetched data is automatically included in the pre-render as data similar to
useAsyncData
from Nuxt orgetStaticProps
in Next.Instead I needed to find out which API calls are performed on the given route (in my case the route data-fetch in
(home).server.ts
) and add the API route to the pre-render routes. I can see that this might be desirable in SSR / Hybrid SSR situations, however for SSG and ISR, bundling the server-side fetched data into the client output is quite essential. Especially for a full SSG framework, which I believe AnalogJs promotesstatic: true
for, automatically pre-rendering API routes, or at least the Server-Side Data fetching configured in .server.ts files, would be great.I needed to configure the generated Server-Side Data fetching API Url in the prerender configuration to make this work purely static:
It could also very well be that I just missed something and this Idea is just a Q&A with a stupid question :-P
Cheers
Gion
Beta Was this translation helpful? Give feedback.
All reactions