Refactor duplicated Syncfusion component loading and database queries#1
Merged
Refactor duplicated Syncfusion component loading and database queries#1
Conversation
✅ Deploy Preview for travel-app-ts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-authored-by: Facelles <122049357+Facelles@users.noreply.github.com>
…ndling Co-authored-by: Facelles <122049357+Facelles@users.noreply.github.com>
Co-authored-by: Facelles <122049357+Facelles@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor duplicated code for better maintainability
Refactor duplicated Syncfusion component loading and database queries
Nov 2, 2025
Contributor
Author
To apply these changes to your local project, you have a few options: Option 1: Merge the PR branch git checkout main
git pull origin main
git merge copilot/refactor-duplicated-codeOption 2: Pull the PR branch directly git fetch origin copilot/refactor-duplicated-code
git checkout copilot/refactor-duplicated-codeOption 3: If you want to merge via GitHub git checkout main
git pull origin mainAfter applying the changes, run: npm install # Ensure all dependencies are installed
npm run typecheck # Verify TypeScript
npm run build # Build the application |
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.
Eliminated repeated patterns across 9 files: dynamic Syncfusion component imports, license registration, and database queries.
Changes
Created
useSyncfusionComponenthook - Consolidates useState/useEffect pattern for dynamic imports across 7 components (Header, TripCard, MobileSideBar, admin-layout, all-users, create-trip, NavItems). Includes error handling and prevents memory leaks.Centralized license registration -
app/lib/syncfusion.tsreplaces 3 duplicate calls with singleton pattern.Extracted
queryUserByAccountIdhelper - Eliminates duplication betweengetExistingUserandgetUserin auth.ts.Example
Before:
After:
Net: +51 lines added (new utilities), -84 lines removed from components.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
o1.ingest.sentry.ionode /home/REDACTED/work/travel-WebApp/travel-WebApp/node_modules/.bin/react-router typegen(dns block)node /home/REDACTED/work/travel-WebApp/travel-WebApp/node_modules/.bin/react-router build(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.