fix(docs): redirect use-data-grid-* registry items to tablecn - #290
Open
Dtem4ik wants to merge 1 commit into
Open
fix(docs): redirect use-data-grid-* registry items to tablecn#290Dtem4ik wants to merge 1 commit into
Dtem4ik wants to merge 1 commit into
Conversation
The /r redirect to tablecn.com only matched items starting with data-table or data-grid, so the new use-data-grid-undo-redo hook fell through to the local registry rewrite and returned 404. Narrowly match use-data-grid.* so diceui's own hooks (use-mobile, use-as-ref, etc.) keep resolving locally. Fixes sadmann7/tablecn#1142
Contributor
|
@Dtem4ik is attempting to deploy a commit to the sadmann7 Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes sadmann7/tablecn#1142
Problem
pnpm dlx shadcn@latest add @diceui/use-data-grid-undo-redofails with a 404:The file itself exists and is served fine by tablecn (
https://tablecn.com/r/use-data-grid-undo-redo.jsonreturns 200). The issue is in the redirect rule indocs/next.config.ts, which forwards data grid registry items to tablecn:The new hook is named
use-data-grid-undo-redo, so it doesn't match either alternative. The request falls through to the flat rewrite (/r/:name.json→/r/styles/radix-vega/:name.json), and since the item doesn't exist in the local registry, it 404s.Fix
Add
use-data-grid.*\.jsonas a third alternative to the redirect pattern. It's kept narrow on purpose so diceui's own hooks (use-mobile,use-as-ref,use-lazy-ref, etc.) keep resolving from the local registry. Any futureuse-data-grid-*hooks published by tablecn will be covered as well.Verification
Tested the pattern with
path-to-regexp(the matcher Next.js uses forredirects()):/r/use-data-grid-undo-redo.json/r/data-grid.json/r/data-table-filter-list.json/r/use-mobile.json/r/use-as-ref.json/r/radix-vega/data-grid-demo.json