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
implement nuxt's definePageMeta #44
Comments
Hi, I have done some tests with many pages and with the current implementation (i.e. with a route block to configure meta data). Currently it doesn't matter if there are two pages or a thousand pages, it's always super fast. With Nuxt and definePageMeta(), loading an app with a thousand pages takes some time (5 seconds in my case) because all pages are called with ?macro=true. For this reason I would prefer some kind of configuration to disable the definePageMeta() behavior. Or will this implementation be different from the Nuxt implementation? Or is there a way to optimize this that I am not aware of? |
Added |
In Nuxt, we extract route metadata through a macro and need to inject this in the generated routes. We don't serialise it but instead keep it in the rollup build and import with a custom query param, e.g.
import { meta } from '~/pages/index.vue?macro=true
.Using a library like this, we would either need to take full control of the generated routes file (not the
.d.ts
) or have a callback to manipulate the generated file, ideally via some kind of AST that lets us have raw access to inject real code.Edit by Eduardo: after calling with Daniel, we should add the same macro Nuxt has (
definePageMeta()
) See if we should name it differently and allow rename through option.The text was updated successfully, but these errors were encountered: