0
0
Svelteframework~5 mins

Development server and HMR in Svelte - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a development server in Svelte?
A development server runs your Svelte app locally, letting you see changes instantly in the browser as you code. It helps you test and develop without building the full app every time.
Click to reveal answer
beginner
What does HMR stand for and what does it do?
HMR means Hot Module Replacement. It updates only the changed parts of your Svelte app in the browser without a full page reload, keeping your app state intact and speeding up development.
Click to reveal answer
intermediate
How does HMR improve the developer experience?
HMR saves time by instantly showing changes without reloading the whole page. This keeps your app's current state, so you don’t lose data or have to navigate back to where you were.
Click to reveal answer
beginner
Which command starts the Svelte development server with HMR enabled?
Running npm run dev or pnpm run dev starts the Svelte development server with HMR enabled by default.
Click to reveal answer
intermediate
Why is a full page reload slower than HMR during development?
A full page reload restarts the entire app and reloads all resources, losing app state and taking more time. HMR updates only changed modules, making updates faster and smoother.
Click to reveal answer
What happens when you save a file while the Svelte development server with HMR is running?
AOnly the changed part updates in the browser without full reload
BThe entire browser page reloads
CNothing happens until you refresh manually
DThe app crashes
Which command typically starts the Svelte development server?
Anpm test
Bnpm start
Cnpm build
Dnpm run dev
Why is HMR useful during development?
AIt disables the development server
BIt reloads the whole page faster
CIt updates only changed code without losing app state
DIt compiles code to production
What does the development server provide?
AA local environment to test your app with live updates
BA way to deploy your app to the internet
CA tool to minify your code
DA database for your app
If HMR is not working, what might happen when you save changes?
AThe app updates instantly without reload
BThe app reloads the entire page
CThe app ignores changes
DThe app crashes
Explain what a development server does in Svelte and why it is helpful.
Think about how you see your app change as you write code.
You got /4 concepts.
    Describe Hot Module Replacement (HMR) and how it improves your workflow.
    Imagine changing a small part of your app without losing your place.
    You got /4 concepts.