Static-first by design
Decide what belongs in the build, what belongs in the browser, and what needs a server.
A page that shows the same information to every visitor can usually be built once and served as HTML. A technical journal is a good example. Its navigation, article text, and publication dates are already known when the project builds. Generating those pages ahead of time removes a runtime dependency from every visit.
Give each interaction a home
Start by listing the actions a visitor needs to take. Links already handle navigation, and a disclosure element can open a small menu with keyboard support built in. A browser script earns its place when the interaction needs state that HTML cannot express, such as filtering a large list as the user types.
Some work really does belong on a server. If a page must show a user’s private data, the server needs to decide whether that user is allowed to see it. Keep that work at the route that requires it so public pages can retain their simple delivery path.
Check the production output
Open a built page with JavaScript disabled. Follow navigation, read an article, and try a missing URL. Inspect the network panel on a mobile connection to see which fonts and styles the first view actually needs. Repeat with JavaScript enabled and check which interactions improve. The comparison makes it easier to justify each script you ship.