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

feat: Migrate ranger docs to v2 layout #153

Merged
merged 7 commits into from
Jan 25, 2024
Merged

feat: Migrate ranger docs to v2 layout #153

merged 7 commits into from
Jan 25, 2024

Conversation

lachlancollins
Copy link
Member

Uses new v2 docs layout and logic

See also: TanStack/ranger#85

Copy link

vercel bot commented Jan 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tanstack-com ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 25, 2024 9:22pm

Copy link
Contributor

@fulopkovacs fulopkovacs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get an error for ranger doc routes where version is not v0 or latest. The error message says that selectedOption is undefined.

See these routes for example:

  • localhost:3000/ranger/v1/docs/overview
  • localhost:3000/ranger/v8/docs/overview
image

(I am on the docs-rework branch from #153 in my local clone of the tanstack/ranger repo.)

app/projects/ranger.tsx Outdated Show resolved Hide resolved
app/routes/ranger.$version._index.tsx Outdated Show resolved Hide resolved
app/routes/ranger.$.tsx Outdated Show resolved Hide resolved
app/routes/ranger.$version.docs.tsx Outdated Show resolved Hide resolved
@lachlancollins
Copy link
Member Author

I get an error for ranger doc routes where version is not v0 or latest. The error message says that selectedOption is undefined.

See these routes for example:

  • localhost:3000/ranger/v1/docs/overview
  • localhost:3000/ranger/v8/docs/overview

I think this is a development-only problem, with a different issue in production. Since local development uses the file system, the version selector doesn't work (different git branches). If you delete the fetchFs function from fetchRepoFile in a project with the v2 layout, it instead returns something like this:

image

This is for http://localhost:3000/table/v9/docs/introduction

For now, I'm just going to change the 'latest' branch back to v1, but this will require a general fix for the new docs layout, rather than a specific fix for ranger.

I'd imagine the fix would be something like checking if $version was a valid entry in availableVersions, and if not redirecting to latest.

@lachlancollins
Copy link
Member Author

I'd imagine the fix would be something like checking if $version was a valid entry in availableVersions, and if not redirecting to latest.

This was an incredibly quick fix to implement :)

Copy link
Contributor

@fulopkovacs fulopkovacs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, works perfectly! ☺️ 🚀

@lachlancollins lachlancollins merged commit f9b7ff9 into main Jan 25, 2024
4 checks passed
@lachlancollins lachlancollins deleted the rework-ranger branch January 25, 2024 21:28
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 this pull request may close these issues.

2 participants