Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove use of $page.query #123

Closed
benmccann opened this issue Sep 16, 2021 · 3 comments · Fixed by #124
Closed

Remove use of $page.query #123

benmccann opened this issue Sep 16, 2021 · 3 comments · Fixed by #124

Comments

@benmccann
Copy link
Collaborator

@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

@aantusahaa
Copy link
Contributor

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?

@benmccann
Copy link
Collaborator Author

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.

@aantusahaa
Copy link
Contributor

Ah! Right. Thanks for clarifying @benmccann

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants