Despite being a simple change, the V1 design introduces new foundational capabilities. If you're curious: Why the V1 design?
The overall architecture stays the same: the V1 design is mostly about replacing .page.js files with so-called plus files: +Page.js, +route.js, +onBeforeRender.js, ...
The migration is straightforward and usually quick to implement. We encourage you to migrate sooner rather than later.
Don't hesitate to reach out if you run into any issue.
The old design is still supported but we recommend to migrate as the docs now showcase the V1 design.
Main migration
Make sure to update Vike to its latest version.
You need to either fully use the V1 design, or fully use the old design. You cannot mix both.
Most of the migration boils down to the following two steps.
See API > Config Files for more information about what + and .h.js means.
The suffixes such as .page.server.js and .page.client.js don't exist anymore. After the feature request #744 is implemented, you'll be able to use .server.js and .client.js suffixes again but note that they'll serve another purpose.
Move /renderer/ configurations to /renderer/+config.ts:
You can create your own hooks and settings by using meta:
// /renderer/+config.tsimport type { Config } from 'vike/types'export default { meta: { // We create a new setting called `title` title: { // The value of `title` should be loaded only on the server env: { server: true } } }} satisfies Config
// /renderer/+onRenderHtml.jsexport { onRenderHtml }async function onRenderHtml(pageContext) { // Config values are available at pageContext.config const { title } = pageContext.config return escapeInject`<html> <head> <title>${title}</title> </head> <!-- ... --> </html>`}
// /pages/about/+config.jsexport default { title: 'Demo showcasing the V1 design'}
If you've defined onBeforeRender() hooks in .page.js (instead of .page.server.js):
// /renderer/+config.tsimport type { Config } from 'vike/types'export default { meta: { onBeforeRender: { // We tell Vike to load and execute onBeforeRender() // not only on the server-side but also on the client-side. env: { server: true, client: true } } }} satisfies Config