fix: @source CSS scanning + React dedupe + troubleshooting docs#20
fix: @source CSS scanning + React dedupe + troubleshooting docs#20jacksonkasi1 merged 1 commit intomainfrom
Conversation
…\n\n- Update @source to use relative path ../node_modules/@tablecraft/table/src\n- Add dedupe: ['react', 'react-dom'] to vite.config.ts\n- Add troubleshooting section for duplicate React hook error\n- Update both READMEs with correct setup instructions\n- Bump @tablecraft/table to v0.2.10
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's GuideAdjusts Tailwind v4 @source configuration so the table package’s TSX source files are scanned correctly, updates the demo app and docs to use the correct relative path, adds bundler config to dedupe React to avoid invalid hook calls, and bumps the table package version. Sequence diagram for React module resolution before and after dedupesequenceDiagram
actor Dev
participant ViteDevServer
participant ModuleResolver
participant root_node_modules as RootNodeModules
participant table_package as TablePkg
participant table_node_modules as TableNodeModules
Dev->>ViteDevServer: Start dev server
ViteDevServer->>ModuleResolver: Resolve import react
ModuleResolver->>RootNodeModules: Look up react
RootNodeModules-->>ModuleResolver: Return root react instance
ViteDevServer->>ModuleResolver: Resolve @tablecraft/table
ModuleResolver->>TablePkg: Load package entry
TablePkg->>ModuleResolver: Import react (internal dependency)
alt without_dedupe
ModuleResolver->>TableNodeModules: Look up react
TableNodeModules-->>ModuleResolver: Return nested react instance
ModuleResolver-->>ViteDevServer: Two React instances loaded
ViteDevServer-->>Dev: Invalid hook call error
else with_dedupe_or_alias
ModuleResolver->>RootNodeModules: Redirect to root react
RootNodeModules-->>ModuleResolver: Return root react instance
ModuleResolver-->>ViteDevServer: Single React instance shared
ViteDevServer-->>Dev: App runs without hook errors
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
📝 WalkthroughWalkthroughVersion bump from 0.2.9 to 0.2.10 with Tailwind v4 configuration updates. The Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Using a hard-coded
@source "../node_modules/@tablecraft/table/src";path in the README and example app may be brittle across different project structures or package managers (pnpm, Yarn PnP, monorepos); consider documenting or supporting a more robust pattern (e.g., a glob or exported path) that doesn’t rely onnode_moduleslayout. - The example app’s dependency is bumped to
@tablecraft/table@^0.2.9while the package itself is versioned as0.2.10; aligning the demo app to^0.2.10will ensure it actually reflects the published changes described in this PR.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Using a hard-coded `@source "../node_modules/@tablecraft/table/src";` path in the README and example app may be brittle across different project structures or package managers (pnpm, Yarn PnP, monorepos); consider documenting or supporting a more robust pattern (e.g., a glob or exported path) that doesn’t rely on `node_modules` layout.
- The example app’s dependency is bumped to `@tablecraft/table@^0.2.9` while the package itself is versioned as `0.2.10`; aligning the demo app to `^0.2.10` will ensure it actually reflects the published changes described in this PR.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary
Fixes the
@source "@tablecraft/table"Tailwind CSS v4 issue where utility classes from the table package were not being detected.Changes
Package (
@tablecraft/tablev0.2.10):srcto publishedfilesarray so Tailwind can scan the TSX source files for class namesDemo App (
vite-web-example):@sourceto use relative path:@source "../node_modules/@tablecraft/table/src"dedupe: ["react", "react-dom"]tovite.config.tsto prevent duplicate React instancesDocumentation:
@sourcerelative pathPublished
@tablecraft/table@0.2.10published to npmSummary by Sourcery
Update Tailwind CSS v4 integration for the table package and demo app, and document React deduplication and @source usage to ensure styles and hooks work correctly.
Bug Fixes:
Enhancements:
Documentation:
Summary by CodeRabbit
Documentation
Chores