learn.svelte.dev icon indicating copy to clipboard operation
learn.svelte.dev copied to clipboard

Empty `+page.svelte` in `Advanced loading / Invalidation`

Open sir-kokabi opened this issue 1 year ago • 1 comments

https://learn.svelte.dev/tutorial/invalidation

image

sir-kokabi avatar Jun 02 '23 15:06 sir-kokabi

I also stumbled across this while going through the SvelteKit tutorial.

I dug into the codebase and found that this +page.svelte file comes about as a result of the get_exercise function including additional directories for traversal when it determines the files for each exercise.

https://github.com/sveltejs/learn.svelte.dev/blob/4e150877cc860208dcf5d68d9ccd138bd5195a77/src/lib/server/content.js#L139C1-L139C59

Specifically, it's the following blank +page.svelte file, part of what appears to be "common" tutorial files.

https://github.com/sveltejs/learn.svelte.dev/blob/4e150877cc860208dcf5d68d9ccd138bd5195a77/content/tutorial/common/src/routes/%2Bpage.svelte

While I could push a changeset to redact this, I'm unsure whether there are any exercises that legitimately depend on this blank file being created.

However, one might think that if an exercise needs a src/routes/+page.svelte that it defines the file as part of the exercise content instead of relying on this fallback.

If any maintainers want to chime in, I'd be happy to submit a patch.

miqh avatar Jan 04 '24 05:01 miqh