Skip to content

Competence grid for part 2

Use this grid to judge whether you are ready for part 3. Read each row and solve the check task next to it without looking anything up. If it feels easy, you have reached the goal. If not, the link in the last column takes you to the right place.

I can …Check taskLook it up
explain how a multi-page website and an SPA load pagesDraw the requests of both ways of building for three clicks.Web pages and web apps
place server-side rendering and statically generated pagesExplain when the pages of this course site are created.Web pages and web apps
name the costs of an SPA and justify a decisionExplain in three sentences whether the page of a sports club should be an SPA.Web pages and web apps
build an interface from state and a render functionBuild a counter whose button changes only the state.An SPA by hand
insert text into HTML safelyExplain what happens to a name like <b>Tent</b> without escapeHtml.An SPA by hand
build a router on the hashAdd a route #/about with a view of its own.An SPA by hand
explain where updating by hand reaches its limitsExplain why the search field in the example loses its focus.An SPA by hand
start, build and check a project with ViteBuild the app, name the files in dist and start the preview.Tools
forward requests with a proxy and move addresses into environment variablesChange the address of the catalog with a file .env.local without changing the code.Tools
set the base path for a subfolderExplain why the built app stays empty on GitHub Pages without base.Tools
examine requests in the network panelUse throttling to show the loading message of the catalog.Tools

For part 3 you mainly need the idea of state and render function and a Vite project that runs.

What Martina Hostettler's assignments in this part added up to is in the course repo in the folder case/02-spa/en. The app shows the catalog with a search and a page of its own for every thing, built with Vite and without a framework. The tests in the folder tests check the wishes from the chapters "An SPA by hand" and "Tools".

Terminal window
npm install
npm test

If you didn't finish everything in part 2, start part 3 from this state.

Text and figures are licensed under CC BY-SA 4.0, the code under the MIT License and the course data under CC0 1.0. The figures use the font Kalam under the SIL Open Font License 1.1. The sources are on GitHub.