freddy38510 / quasar-app-extension-ssg

Static Site Generator App Extension for Quasar.
MIT License
152 stars 16 forks source link

how to pass data to routes before generate #189

Open flapili opened 2 years ago

flapili commented 2 years ago

Hi, I would like to switch nuxt2 -> quasar2 but I need SSG, we have hundred of routes to generates and we would know how to avoid spam the api (we need only 1 call to generate every pages)

With nuxt we use payload, how could we achieve the same with quasar + your ext ?

freddy38510 commented 2 years ago

Hi,

I plan to implement this feature, but right now I'm working on adding lazy/partial hydration to the extension. If you don't need interactions on components that hold your api's data, you might find it useful to not hydrate them on the client side.

Until then one of the solutions I can think of is to retrieve the data from the api and store it in json files before building the app with the hook "beforeBuild". In this way it is possible to directly import the json files into your components instead of retrieving them via the api.

The crawler feature can take care of your dynamic routes based on your API data (routes with product id for example).

ting-dev-coder commented 3 months ago

Hi, @freddy38510 I need to get route for my meta setting, for example en/xxxx so I could use useMeta to switch meta tags based on different languages. Is it possible to get the route in SSG mode, or would the best way to do this be in SSR mode?