Skip to content
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

Refactor next.js anti-patterns #472

Closed
6 of 11 tasks
shon-button opened this issue Dec 20, 2024 · 0 comments
Closed
6 of 11 tasks

Refactor next.js anti-patterns #472

shon-button opened this issue Dec 20, 2024 · 0 comments
Assignees

Comments

@shon-button
Copy link

shon-button commented Dec 20, 2024

Description of the Tech Debt

  • NonAttributatbleEmissions (async server component) unnecessarily wraps NonAttributatbleEmissionsForm (sync client component) in a Suspense boundary.
  • Page routes not using defaultPageFactory

Development Checklist:

  • Refactored async app route pages to use bciers/libs/components/src/nextPageFactory/defaultPageFactory.tsx
  • Import generic props HasReportVersiojn; HasFacilityId where applicable
  • Rename files to *Page; *Form where applicable

Example:

  • Rename bciers/apps/reporting/src/app/components/reportInformation/nonAttributableEmissions/NonAttributatbleEmissions.tsx to follow naming convention bciers/apps/reporting/src/app/components/reportInformation/nonAttributableEmissions/NonAttributatbleEmissionsPage.tsx
  • In file bciers/apps/reporting/src/app/components/reportInformation/nonAttributableEmissions/NonAttributatbleEmissionsPage.tsx
    • remove Suspense wrapper of NonAttributatbleEmissionsFrom.tsx
    • refactor props to use interface HasFacilityId
  • In file bciers/apps/reporting/src/app/components/reportInformation/nonAttributableEmissions/NonAttributatbleEmissionsForm.tsx
    • refactor props to use interface HasFacilityId
  • In file, bciers/apps/reporting/src/app/bceidbusiness/industry_user/reports/[version_id]/facilities/[facility_id]/production-data/page.tsx refactor route page to follow page factory pattern using bciers/libs/components/src/nextPageFactory/defaultPageFactory.tsx
  • In file, bciers/apps/reporting/src/app/bceidbusiness/industry_user_admin/reports/[version_id]/facilities/[facility_id]/production-data/page.tsx refactor route page to follow page factory pattern using bciers/libs/components/src/nextPageFactory/defaultPageFactory.tsx
@shon-button shon-button self-assigned this Jan 8, 2025
@shon-button shon-button changed the title Refactor NonAttributatbleEmissions Suspense pattern Refactor next.js anti-patterns Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants