-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat: Better docs nav #8605
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
feat: Better docs nav #8605
Conversation
|
@PuruVJ it looks like there's quite a few |
|
I was going to test this out on mobile, but it looks like the deployment is failing, so I can't at the moment:
|
|
Still in the middle, working on the content restructuring ones first. I'll let you know once this is done |
|
We shouldn't have a |
| "check:format": "prettier --check . --ignore-path .gitignore --plugin-search-dir=." | ||
| }, | ||
| "dependencies": { | ||
| "@jridgewell/sourcemap-codec": "^1.4.15", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you shouldn't need to do this. update @sveltejs/kit instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't work. Error is still there even after maxing out all versions and removing sourcemap-codec
sites/svelte.dev/vite.config.js
Outdated
| resolve: { | ||
| dedupe: ['@jridgewell/sourcemap-codec'] | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you shouldn't need to do this. update @sveltejs/kit instead
| resolve: { | |
| dedupe: ['@jridgewell/sourcemap-codec'] | |
| }, |
|
@Rich-Harris is the function call the one tripping up HMR and SSR? Or is it just using a Svelte Store in general? I pushed a change which directly writes to the store, lemme know if its still ineffective. I'll go with the |
|
Writing to a store from a page means that in SSR, the nav has already been rendered, so you'll see a flash of un-SSR'd content. Returning a <p>{$page.data.nav_title ? ''}</p>When I say it's brittle what I mean is that you need to remember to update the store (or call the function, whatever) on every route. If a new route is added in future and we forget to do that, the nav will just continue to show the result of the most recent set/call, which is much worse than it being blank. If we make the property required... // src/app.d.ts
declare global {
namespace App {
interface PageData {
nav_title: string;
}
}
}
export {};...then in theory we'll even get type safety (i.e. a page |
|
Gotcha! |
|
Ok, I've figured out how to get this running locally, so I can actually try it out. Can we move the bar to the top, and fix it to the nav (i.e. it's visible when the nav is visible, but otherwise slides out of the way)? It takes too much real estate to be a permanent presence. I'd almost be inclined to get rid of the 'on this page' button on mobile. It provides nice visual balance on desktop and gives you a sense of progress as you're scrolling down, but it's probably overrated as a navigation device. react.dev just hides it altogether on mobile, for example. To be honest I'm not sold on the subtitle on the nav, the tiny type feels rather cluttered, and I don't feel like it's necessary. |
No description provided.