-
Notifications
You must be signed in to change notification settings - Fork 0
Clean up console logs and apply code formatting #112
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
- Remove debug console.log statements from filter-selector.tsx - Remove debug console.log statements from data-table-router-form.stories.tsx - Remove commented console.log statements from filters.ts, memo.ts, and active-filters.tsx - Remove commented console.warn statements from data-table-router-parsers.ts - Apply biome code formatting fixes - Keep legitimate console.error statements for actual error handling - Keep console.log statements in example/demo files for educational purposes
|
|
WalkthroughThis set of changes consists primarily of formatting, whitespace, and stylistic improvements across various TypeScript and React component files. Numerous console logging and commented-out debug statements were removed from both application and component code. Minor syntax corrections, import cleanups, and single-line formatting adjustments were made, but no functional or behavioral modifications were introduced. Changes
Sequence Diagram(s)No sequence diagrams are generated as all changes are stylistic, formatting, or involve removal of debug statements without affecting control flow or feature logic. Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
📝 Storybook Preview: View Storybook This preview will be updated automatically when you push new changes to this PR.
|
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.
Actionable comments posted: 0
🔭 Outside diff range comments (2)
apps/docs/src/remix-hook-form/textarea.stories.tsx (1)
80-91: Move decorators off the meta object to comply with our Storybook-testing rulesGuidelines (
apps/docs/src/remix-hook-form/*.stories.tsx) explicitly forbid global decorators insidemeta; they must be defined per-story. Keeping them here violates the testing conventions and may cause Storybook to execute the decorator for unrelated stories.@@ const meta: Meta<typeof Textarea> = { tags: ['autodocs'], - decorators: [ - withReactRouterStubDecorator({ - routes: [ - { - path: '/', - Component: ControlledTextareaExample, - action: async ({ request }: ActionFunctionArgs) => handleFormSubmission(request), - }, - ], - }), - ], } satisfies Meta<typeof Textarea>; export default meta; @@ export const Default: Story = { parameters: { docs: { description: { story: 'A textarea component for entering multiline text input.', }, }, }, + decorators: [ + withReactRouterStubDecorator({ + routes: [ + { + path: '/', + Component: ControlledTextareaExample, + action: async ({ request }: ActionFunctionArgs) => + handleFormSubmission(request), + }, + ], + }), + ], play: async (storyContext) => { await testInvalidSubmission(storyContext); await testValidSubmission(storyContext); }, };This isolates the routing stub to only the
Defaultstory (or whichever stories you choose) and satisfies the rule of a minimal, cleanmetasection.packages/components/src/ui/data-table-filter/hooks/use-debounce-callback.tsx (1)
48-50:isPendingalways returnstrueafter first render
isPendingchecks only whetherdebouncedFunc.currentis non-null. The ref is set in the very firstuseEffect, so every later call will report “pending”, even when the inner debounce queue is empty.- wrappedFunc.isPending = () => { - return !!debouncedFunc.current; - }; + wrappedFunc.isPending = () => debouncedFuncInstance.pending();This assumes the
debouncehelper exposes apending()/isPending()method (Lodash-style). If not, consider tracking pending state explicitly inside the wrapper.
♻️ Duplicate comments (1)
packages/components/src/ui/data-table-filter/core/filters.ts (1)
378-384: Cache flag is enough – drop the internal Promise
The pattern repeats for faceted min/max values. A micro-task keeps the prefetch async without extra Promise overhead.
🧹 Nitpick comments (3)
packages/components/package.json (1)
21-21: Consider addingsideEffects: falsewhile you’re touching thefilesfield.Since this package only ships pre-built code in
dist, declaring the package as side-effect-free helps bundlers tree-shake unused exports:"files": ["dist"], + "sideEffects": false,This is a small, non-breaking optimisation.
packages/components/src/ui/data-table-filter/components/filter-selector.tsx (1)
134-140: Console warnings kept; consider project-wide logger
console.warnis still used for defensive checks. Moving to a centralizedlog.warn(tied to env config) avoids accidentally shipping noisy logs and keeps prod bundles treeshakable.packages/components/src/ui/data-table-filter/core/filters.ts (1)
352-358: Nit: async +setTimeoutpattern could be simplified
WrappingsetTimeout(..., 0)in a fresh Promise for every prefetch introduces unnecessary micro-tasks. If you only need to warm caches, a plain synchronous call (or a queued micro-task viaqueueMicrotask) is lighter.-await new Promise((resolve) => - setTimeout(() => { - const options = getOptions(); - column._prefetchedOptionsCache = options; - resolve(undefined); - }, 0), -); +queueMicrotask(() => { + column._prefetchedOptionsCache = getOptions(); +});Same applies to the other three prefetchers.
|
@codegen-sh in our components directory we should patch bump our version with npm and a summary message of our cleanup
|
Patch version bump for console log cleanup and code formatting improvements: - Removed debug console.log statements from filter components - Removed commented console.log statements from core utilities - Applied biome formatting fixes across codebase - Preserved legitimate error logging and educational examples
|
✅ Version bump completed! I've successfully bumped the 🔄 View Updated PR #112 on Github 🔄 What was added:
The version bump commit includes a detailed summary of all the console log cleanup and code formatting improvements we made. The PR now includes both the cleanup work and the proper version increment! 🎉 💻 View my work • 🛑 Stop • React 👍 or 👎 |
Summary
This PR cleans up debug console logs that were getting into production logs and applies code formatting fixes.
Changes Made
Console Log Cleanup
console.logstatements that were logging component values and loading statusconsole.logstatements from prefetch functionsuseEffectfor blur state loggingconsole.warnstatementsWhat Was Preserved
console.errorstatements for actual error handlingconsole.logstatements in example/demo files (middleware-example.tsx) for educational purposesCode Formatting
Impact
Testing
yarn format-and-lint:fixto ensure code quality💻 View my work • About Codegen
⛔ Remove Codegen from PR • 🚫 Ban action checks
Summary by CodeRabbit
Style
Chores
Bug Fixes