svelte-society/sveltesociety.dev

Remove use of `$page.query`

benmccann opened this issue · 3 comments

@Abarnob looks like I was wrong in #108 that it was a SvelteKit bug and it was really a bug in the implementation, so maybe I shouldn't have merged it yet (more details available in the issues linked to from sveltejs/kit#2444 (comment)). Do you think you could fix it?

We'd either need to not prerender the page (e.g. switch from adapter-static to adapter-netlify) or update the dropdown in onMount using location.search). The latter seems potentially safer because it's a code change only and doesn't involve the possibility of needing to make any hosting changes, but @kevmodrome could weigh in if he feels differently

I've read through corresponding issues. But I'm not entirely sure about the specific reason behind not being able to use $page.query with pre-rendered pages. Would you please explain it to me?

A pre-rendered page is one that gets rendered and saved to HTML during build-time. The query could be anything at runtime. Thus, you can't precompute the page contents at build-time based off what the query is because we don't know yet since its value could change.

Ah! Right. Thanks for clarifying @benmccann