-
-
Notifications
You must be signed in to change notification settings - Fork 7
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: Code Refactor & Upgrade to Next.js 15 / React 19-RC #836
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Reviewer's Guide by SourceryThis pull request performs a major upgrade to Next.js 15 and React 19-RC while significantly refactoring the codebase. The changes focus on improving component architecture, type safety, and performance through modern React patterns and better code organization. The upgrade includes configuration updates, dependency updates, and extensive component refactoring. Class diagram for new and updated componentsclassDiagram
class ProductResultView {
+ProductResultView(result: ProductResult, sources: Sources, productState: ProductState, barcode: string)
}
class ViewportScanner {
+ViewportScanner(onDetected: function, setScanning: function)
}
class IngredientsForm {
+IngredientsForm()
}
class ShareButton {
+ShareButton(productName: string, barcode: string)
}
class ModalWrapper {
+ModalWrapper(id: string, buttonType: string, buttonClass: string, buttonText: string, children: ReactNode)
}
class FooterLink {
+FooterLink(href: string, src: string, alt: string, className: string, width: number, height: number)
}
class SupportOption {
+SupportOption()
}
class NavItem {
+NavItem(href: string, iconClass: string, translationKey: string, isActive: boolean)
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @philipbrembeck - I've reviewed your changes - here's some feedback:
Overall Comments:
- Great job on the refactoring! The code is cleaner and more maintainable. However, we noticed that the OLEDMode component was removed from the More page. Was this intentional?
- The improvements in code structure, especially in components like ShareButton and Modal, are commendable. Good use of React best practices and TypeScript features throughout.
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@sourcery-ai review |
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.
Hey @philipbrembeck - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- Hardcoded PayPal donation link with a specific button ID found. (link)
Overall Comments:
- Using React 19 RC and Next.js 15 in production could introduce instability. Consider waiting for stable releases or thoroughly testing these pre-release versions.
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🔴 Security: 1 blocking issue
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Will be included later on in the README
@sourcery-ai review |
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.
Hey @philipbrembeck - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- Potential hard-coded PayPal donation link detected. (link)
Overall Comments:
- The OLED mode component was removed from the more page without explanation. Was this intentional? If so, please document the reasoning for this change.
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🔴 Security: 1 blocking issue
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
The update to Next.js 15 still breaks the
Which is allegedly fixed in We should test the impact of this on staging. @sourcery-ai review |
@sourcery-ai review |
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.
Hey @philipbrembeck - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider using the latest stable React 18 version instead of React 19 RC for production use. While the RC may work, it's generally safer to wait for the stable release before upgrading.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@sourcery-ai review |
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.
Hey @philipbrembeck - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- Potential hard-coded PayPal donation link found. (link)
Overall Comments:
- The removal of documentation files (/docs/*) should be addressed - please provide an alternative documentation solution or restore these files to maintain project documentation.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🔴 Security: 1 blocking issue
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@sourcery-ai review |
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.
Hey @philipbrembeck - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- Potential hard-coded PayPal donation link found. (link)
Overall Comments:
- Consider adding unit tests for the new refactored components to maintain test coverage, particularly for the ViewportScanner and ProductResultView components.
Here's what I looked at during the review
- 🟡 General issues: 3 issues found
- 🔴 Security: 1 blocking issue
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Quality Gate passedIssues Measures |
Summary by Sourcery
Upgrade the project to Next.js 15 and React 19-RC, refactoring components for improved modularity and performance. Introduce new components for barcode scanning and product result display, and enhance sharing functionality. Update build and CI configurations to align with the latest dependencies and Node.js version.
New Features:
ViewportScanner
component for barcode scanning with camera switching capabilities.ProductResultView
component to display product details including vegan status, nutriscore, and grade.ShareButton
component for sharing product details across various platforms.Enhancements:
ShareButton
component to use a more modular and maintainable approach withuseMemo
.Footer
component by introducing aFooterLink
sub-component for better reusability.ModalWrapper
component to useuseCallback
anduseRef
for better performance and readability.Build:
pnpm-lock.yaml
.CI:
Tests: