Closed thebells1111 closed 3 years ago
Should this PR also remove segment
from src/routes/_layout.svelte
?
Yeah, it probably should. I'm also not sure how I feel about continuing to use segment
as a reactive declaration name here. If there's another way this could be written that does invoke the concept of 'segment' at all, I would probably be more comfortable with that.
Do you mean using something like currentPage
as the variable name in lieu of segment
?
If segment
is removed as a prop for the Nav
component in src/routes/_layout.svelte
, this warning is displayed.
Layout has unused export property 'segment'
If export let segment
is left undeclared in src/routes/_layout.svelte
, this warning is displayed in the browser console.
<Layout> was created with unknown prop 'segment'
@thebells1111 can you go ahead and remove it from _layout
? That warning will go away when we remove the property from the component definition in Sapper. But maybe we should merge this PR at the same time we make that change to avoid users seeing the warning
As far as naming, I think it's fine to call this segment. That's the typical term for the piece between two slashes in a URL path. And it might also help people who need to migrate understand this as the alternative. If we want a different name though then dir
could be another option
Thanks for this. Sapper's in maintenance mode now, so I'm not sure that https://github.com/sveltejs/sapper/issues/824 will be changes, which means this PR wouldn't be applicable
in anticipation of https://github.com/sveltejs/sapper/issues/824