-
-
Notifications
You must be signed in to change notification settings - Fork 189
feat: docs versioning #70
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
Conversation
WIP of having versioned docs. The idea is that we're doing Git clones of the target repositories into our gitignored folder, then copying over the docs / generating the types as needed. A version selector at the top of the side nav then allows you to switch versions. That all is straightforward, but it reveals a problem: The structure of how we do docs has changed, and the old Svelte docs don't follow that. We either need to adjust them, or add logic to work with the old format, too.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I actually did that already for SvelteKit. I think I'd prefer to do it that way because then it's a one-time cost vs code that sticks around that we have to continue to maintain. We can copy the changes from https://github.com/sveltejs/kit/pull/12459/files#diff-13e7d156a0c1d8acfb9f88938211da2ac45fb638821e5e9d92f4ff05a006d63a into the Svelte repo as well |
I'm confused. I see lots of files being added in this PR. If they were in a gitignored folder, then we shouldn't be adding lots of new files right? And I thought from #69 that you wanted to commit all the files in which case why rely on git for old versions of docs, but not the most current version of docs? |
I realized that it's super simple to transfer, just run some code that replaces the
I did commit all the doc files in #69, and in this PR I also committed the docs for version 1 of SvelteKit and version 4 of Svelte (notice how this PR targets the #69 PR branch). The flow is this:
It's similar to #55 but instead of doing it everytime on the fly (and having no insights into what is generated) the results are committed to the repo. The advantages of this are listed in #69 |
I sent sveltejs/svelte#13120 to save those 10 lines 😄 |
We decided to not go with docs versioning for now, and instead have Svelte 4 content merged into Svelte 5 content. Something like "bla bla new docs ... In Svelte 4 you did ... blabla", along with a toggle to not show the Svelte 4 content / a runes mode toggle. We can also deploy the old docs on v4.svelte.dev if there's popular demand. |
WIP of having versioned docs. The idea is that we're doing Git clones of the target repositories into our gitignored folder, then copying over the docs / generating the types as needed. A version selector at the top of the side nav then allows you to switch versions.
That all is straightforward, but it reveals a general problem: The structure of how we do docs has changed slightly (and may change in a distant future), and the old Svelte docs don't follow that. I see a few options:
I went with the latter because as it turns out the only real change in this instance was
meta.json
->index.md
, and for the rest we could just reuse the existing "fill these placeholders" logic - which makes me think we should just go back to using that one (> TYPES
etc) instead of the new one (<!-- @include ... -->
). Ben also started creating PRs to the related repos so we can eventually undo that little migration function.Another thing this revealed is that our approach to type-checking docs doesn't work for older versions. For example, some APIs have changed between Svelte 4 and Svelte 5, so the type-checks for Svelte 4 fail because it runs the type-checks against the most recent types of version 5. There's no way to make this work within the omnisite, regardless of how we approach this. The only two solutions to this are a) abort omnisite (a bit drastic) b) don't type-check older versions (a sensible solution IMO).
Other things to tackle / open questions:
docs/svelte/v5/...
? Or should we additionally havelatest
as an alias, or omit the version slug for latest? The former means links never die, the latter possibly means that Google etc show more recent doc versions more reliably (and in the handle hook we could detect outdated links and reroute on a best effort basis). Docosaurus uses the "latest appears without additional slug" approach.