skip to content

Meta-frameworks (SSR/SSG)

Frameworks that wrap a UI library with routing, data loading and server rendering — Next, Nuxt, Astro, Remix, SvelteKit and the rest. Interviewers range across them because the rendering-mode and data-loading decisions they force are what separate shipping components from shipping an application.

on this pageshow

explore

→ has its own guide

questions

403 · 6 sections

In a Next.js App Router page.tsx, what does `export const dynamic = 'force-dynamic'` do, and when would you add it?

level: juniorimportance: must knowfreq 62%
basics
~20 s

It is a Route Segment Config export that forces the route to be rendered on the server for every request instead of being prerendered, so its HTML is never served out of Next's Full Route Cache.

open as a page

A Next.js App Router page exports `export const revalidate = 3600`. Does Next.js rebuild that page once an hour on a schedule? Explain what actually triggers the rebuild.

level: juniorimportance: must knowfreq 62%
basics
~20 s

No scheduler is involved. The number is a staleness window in seconds: after 3600 seconds the cached page is merely marked stale, and only the next incoming request for that route causes Next.js to regenerate it.

open as a page

In a Next.js App Router project, where must the middleware file live, and what does exporting `export const config = { matcher: [...] }` from it change about when the middleware function runs?

level: juniorimportance: must knowfreq 65%
basics
~20 s

Next.js reads a single middleware file at the project root, next to app/ (or inside src/). Exporting config.matcher restricts which request paths invoke it; with no matcher, the middleware function runs for every request the app serves.

open as a page

In Next.js middleware, what is the difference between returning NextResponse.rewrite(url) and NextResponse.redirect(url)?

level: juniorimportance: must knowfreq 78%
basics
~20 s

NextResponse.rewrite serves a different route internally: the browser keeps the original URL and makes one request. NextResponse.redirect returns a 3xx with a Location header, so the browser makes a second request and the address bar changes.

open as a page

In the Next.js App Router, how do you define an HTTP endpoint in a route.ts file, and what happens when a request arrives with a method the file does not export?

level: juniorimportance: must knowfreq 70%
basics
~20 s

A route.ts file turns its folder's path into an HTTP endpoint. You export one async function per HTTP method, named exactly GET, POST, PUT, PATCH, DELETE, HEAD or OPTIONS, and Next.js answers 405 Method Not Allowed for any method you did not export.

open as a page

In a Nuxt 4 app, what is auto-imported without an import line, and how does a function in app/composables/ get picked up?

level: juniorimportance: must knowfreq 50%
basics
~20 s

Nuxt 4 auto-imports Vue APIs like ref, its own composables like useState, components from app/components/, and the exports of top-level files in app/composables/ and app/utils/. The build injects real imports only where a file uses those names.

open as a page

In Nuxt 4, why should a page load its data with `useFetch` or `useAsyncData` instead of calling `$fetch` in `<script setup>`, and when is `$fetch` right?

level: juniorimportance: must knowfreq 62%
basics
~20 s

useFetch and useAsyncData fetch during server rendering and ship the result in the Nuxt payload, so hydration reuses it instead of refetching. A bare $fetch in setup runs on the server and again in the browser; keep $fetch for user-triggered calls.

open as a page

In Nuxt 4, which app/pages/ files serve /, /recipes and /recipes/lemon-tart, and how does the recipe page read its slug?

level: juniorimportance: must knowfreq 58%
basics
~10 s

In Nuxt 4, app/pages/index.vue serves /, app/pages/recipes/index.vue serves /recipes and app/pages/recipes/[slug].vue serves /recipes/lemon-tart. That page reads the segment through the auto-imported useRoute(): route.params.slug is 'lemon-tart'.

open as a page

In Nuxt 4, what HTML does a visitor first receive under the default ssr: true, under ssr: false, and from nuxt generate?

level: juniorimportance: must knowfreq 60%
basics
~20 s

With Nuxt 4's default ssr: true, each request gets server-rendered HTML plus a payload for hydration. ssr: false sends a shell with an empty #__nuxt root for the browser to fill. nuxt generate prerenders pages into static HTML files at build time.

open as a page

In Nuxt 4, what is the difference between a handler in `server/api/` and one in `server/routes/`, and how do file names become URLs?

level: juniorimportance: must knowfreq 44%
basics
~20 s

Both folders hold Nitro handlers exported with defineEventHandler. Files in server/api are served under /api, files in server/routes at the bare path; brackets in a file name become parameters and a .get or .post suffix limits the method.

open as a page

What does AnalogJS add to an Angular application that the Angular CLI with @angular/ssr does not give you on its own?

level: juniorimportance: must knowfreq 38%
basics
~20 s

AnalogJS is a Vite-based meta-framework for Angular. It adds file-based pages, per-page server load functions, API routes built by Nitro, and prerender and deployment options, while Angular itself still renders, routes and hydrates the app.

open as a page

In AnalogJS, how do file names under src/app/pages become Angular routes for a marketing site's home page, blog, posts and 404 page?

level: middleimportance: must knowfreq 32%
basics
~20 s

In AnalogJS, only .page.ts files under src/app/pages become routes: (home).page.ts is /, blog/[slug].page.ts is /blog/:slug, a file beside a same-named folder is a layout, a (group) folder adds no segment, and [...page-not-found].page.ts is the ** route.

open as a page

In AnalogJS, how does a catalogue page load its product data in a .server.ts load function, and how does the page component read it?

level: middleimportance: should knowfreq 27%
basics
~20 s

In AnalogJS, an async load exported from catalogue.server.ts runs only on the server and returns JSON-serialisable data. Analog resolves it before the page component is created, and the component reads it with injectLoad<typeof load>(), usually wrapped in toSignal.

open as a page

In AnalogJS, how do you build a newsletter-signup API route under src/server/routes/api, and what does it need at deploy time?

level: seniorimportance: should knowfreq 20%
basics
~10 s

In AnalogJS, a file like src/server/routes/api/newsletter.post.ts that default-exports an h3 defineEventHandler becomes POST /api/newsletter. Nitro compiles it into Analog's server output, so it exists only where that server runs, never in a static-only build.

open as a page

In AnalogJS, SSR is on by default; how would you prerender the blog, keep the catalogue server-rendered and make an admin area client-only?

level: seniorimportance: should knowfreq 23%
basics
~10 s

In AnalogJS, list the blog URLs in prerender.routes, leave the catalogue to the default ssr: true, and set nitro.routeRules { '/admin/**': { ssr: false } } so admin pages render only in the browser.

open as a page

What does VitePress 1.6 do with a folder of Markdown files, and what does a minimal project need to build a documentation site?

level: juniorimportance: must knowfreq 30%
basics
~20 s

VitePress compiles each Markdown file into a Vue component, prerenders every page to static HTML at build time, then hydrates it into a single-page app. A minimal project is Markdown pages plus .vitepress/config, run with vitepress dev and build.

open as a page

In VitePress 1.6, how do you render a live Vue component demo inside a Markdown page, and which Markdown-specific rules can break it?

level: middleimportance: must knowfreq 28%
basics
~20 s

Add a <script setup> block after the frontmatter, import the demo component and use its tag in the Markdown. Keep component names PascalCase or hyphenated, remember code fences are v-pre, and prefer <style module> to <style scoped>.

open as a page

In VitePress 1.6, how would you write a component page that shows its real source file, tabbed install commands and a warning box without copying code by hand?

level: middleimportance: should knowfreq 20%
basics
~20 s

Import the demo file as a code block with <<< @/demos/ButtonBasic.vue, group the npm, pnpm and yarn fences in a ::: code-group container, and add a ::: warning container. Frontmatter such as outline and editLink tunes the page.

open as a page

A VitePress 1.6 date-picker demo works in `vitepress dev`, but `vitepress build` fails with `window is not defined`, even inside `<ClientOnly>`. Why, and how do you fix it?

level: seniorimportance: should knowfreq 25%
basics
~20 s

vitepress dev renders only in the browser, but build prerenders in Node. <ClientOnly> delays rendering until mount, yet the library still touches window when it is imported. Load it after mount with defineClientComponent or a dynamic import.

open as a page

With Inertia's useForm helper, how do data, setData, processing and errors work together on a customer edit form?

level: juniorimportance: must knowfreq 52%
basics
~20 s

useForm holds the form's fields in data, updates them through setData, and submits them as an Inertia visit with put, post or patch; processing stays true while that visit runs, and errors fills with one message per field when Laravel validation fails.

open as a page

With Inertia's Laravel adapter, what does Inertia::render return, and how does the response differ between a first page load and a later client-side visit?

level: juniorimportance: must knowfreq 62%
basics
~20 s

Inertia::render returns an Inertia\Response that becomes a page object: component, props, url and version. A normal browser request gets the root Blade view with that object embedded as JSON; a request sending X-Inertia: true gets the bare object as JSON.

open as a page

Why does an Inertia music app's sidebar player restart on every visit when pages wrap themselves in <Layout>, and how do persistent layouts fix it?

level: middleimportance: must knowfreq 48%
basics
~20 s

Inertia remounts the page component on each visit, so a layout rendered inside the page is destroyed with it; declaring the layout on the component (Page.layout) lets Inertia render it outside the page, so the same layout instance and its player state survive.

open as a page

With Inertia and Laravel, how do failed validation errors reach the page component as props without a 422 JSON response?

level: middleimportance: must knowfreq 55%
basics
~20 s

Laravel treats the Inertia visit as a normal form post: validation failure redirects back with errors flashed to the session, and on the follow-up request the Inertia middleware shares them as the always-included errors prop, which the client routes to onError.

open as a page

In a meta-framework, how does a cached copy kept on the server differ in scope from one kept in the browser tab?

level: juniorimportance: must knowfreq 62%
basics
~20 s

A copy kept on the server is shared: any request matching its key can be served it, including another visitor's. A copy in the browser tab is private to that browser and gone on a full page load.

open as a page

On a server-rendered page, why is the data the server already read embedded in the page instead of fetched again in the browser?

level: juniorimportance: must knowfreq 72%
basics
~20 s

Embedding the server's already-loaded result lets the browser's data cache start full, so the first client render reads it from cache instead of issuing a second request for data the user is already looking at.

open as a page

A meta-framework serves a route from a stored copy. After the underlying data changes, what makes visitors see the new value?

level: juniorimportance: must knowfreq 70%
basics
~20 s

A stored copy never learns that the data behind it changed. It becomes unusable only when the application names that copy and marks it stale, or when its freshness window elapses and the next request produces the value again.

open as a page

In a meta-framework, what does a route module's own server-side data fetch do before the route's HTML exists?

level: juniorimportance: must knowfreq 78%
basics
~20 s

A route's server-side data fetch runs when the URL matches, gathers the data that route needs, and hands it to the render, so the first HTML already carries the content and the browser needs no follow-up request.

open as a page

In a meta-framework, what does it mean for a route to handle a write itself instead of posting to a separate API?

level: juniorimportance: must knowfreq 72%
basics
~20 s

A route-handled write is a server-side function the framework publishes at its own URL, so an ordinary HTML form can POST straight to it. The framework runs it on the server, then re-renders the route or follows a redirect.

open as a page