Skip to content

Remove old exports#5923

Merged
lkostrowski merged 6 commits intomainfrom
remove-dead-code-6
Oct 2, 2025
Merged

Remove old exports#5923
lkostrowski merged 6 commits intomainfrom
remove-dead-code-6

Conversation

@lkostrowski
Copy link
Member

@lkostrowski lkostrowski commented Oct 1, 2025

Summary

This PR removes unused code and reorganizes the codebase to improve maintainability:

  • Removed legacy Filter component - Deleted the old Filter.tsx component and moved to using FilterContent directly with the new filter system
  • Consolidated extensions code - Moved custom apps queries, mutations, and utilities to the extensions module where they belong
  • Removed unused components:
    • SaleListDatagrid and SaleSummary (old discount UI)
    • PermissionAlert component and related utilities
    • Unused plugin queries and mutations
  • Cleaned up exports - Removed default exports in favor of named exports for better tree-shaking and clarity
  • Fixed import paths - Updated all imports to use the new locations and named exports

Changes by module

Filter system refactoring

  • Removed src/components/Filter/Filter.tsx (177 lines)
  • Converted FilterContent, FilterContentBody, FilterContentHeader, FilterErrorsList, and FilterContentBodyNameField from default to named exports
  • Updated all imports across the codebase to import from @dashboard/components/Filter/types

Extensions/Custom Apps consolidation

  • Moved handlers, utilities, and tests from custom-apps/ to extensions/
  • Consolidated queries and mutations into extensions/ module
  • Removed redundant custom-apps/ directories

Component cleanup

  • Removed SaleListDatagrid component (264 lines)
  • Removed SaleSummary component (110 lines)
  • Removed PermissionAlert component and utilities (368 lines)
  • Moved ScrollableContent to ChannelsAvailabilityMenuContent directory

Utilities cleanup

  • Removed unused functions from src/utils/maps.ts
  • Removed getSelectedFiltersAmount from filter utils
  • Cleaned up plugin-related queries and mutations

Impact

  • Reduced bundle size by removing ~1,759 lines of unused code
  • Improved code organization with better module boundaries
  • Better tree-shaking with named exports replacing default exports
  • No breaking changes - all functionality preserved, just reorganized

🤖 Generated with Claude Code

@lkostrowski lkostrowski requested a review from a team as a code owner October 1, 2025 13:20
@changeset-bot
Copy link

changeset-bot bot commented Oct 1, 2025

⚠️ No Changeset found

Latest commit: 852bcbe

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Oct 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
saleor-dashboard-storybook Ignored Ignored Preview Oct 2, 2025 6:04am

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes old exports and consolidates code structure by moving Filter-related types to a centralized location, removing unused utilities and components, and updating import paths throughout the codebase.

  • Centralized Filter types to @dashboard/components/Filter/types
  • Removed unused utilities, components, and URL constants
  • Consolidated functionality from custom-apps into extensions module

Reviewed Changes

Copilot reviewed 83 out of 84 changed files in this pull request and generated no comments.

Show a summary per file
File Description
testUtils/filters.ts Updated import path for IFilter type
src/utils/maps.ts Removed unused import and mapPersonNodeToChoice function
src/utils/handlers/filterHandlers.ts Updated import path for IFilter type
src/utils/filters/filters.ts Updated import path for Filter types
src/utils/filters/fields.ts Updated import path for Filter types
src/types.ts Updated import path for Filter types
src/staff/views/StaffList/filters.ts Updated import path for Filter types
src/staff/components/StaffListPage/filters.ts Updated import path for IFilter type
src/products/views/ProductList/filters.ts Updated import path for Filter types
src/products/components/ProductListPage/ProductListPage.tsx Updated import path for FilterElement type
src/productTypes/views/ProductTypeList/filters.ts Updated import path for FilterElement type
src/productTypes/components/ProductTypeListPage/filters.ts Updated import path for IFilter type
src/plugins/urls.ts Changed PluginUrlDialog from export to internal type
src/orders/views/OrderList/filters.ts Updated import path for Filter types
src/orders/views/OrderDraftList/filters.ts Updated import path for FilterElement type
src/orders/components/OrderDraftListPage/filters.ts Updated import path for IFilter type
src/modeling/views/PageList/filters.ts Updated import path for FilterElement type
src/misc.ts Removed unused decimal function
src/index.tsx Removed unused imports and replaced hardcoded paths for redirects
src/hooks/useFilterHandlers.ts Updated import path for IFilter type
src/hooks/useChannelsSearch.ts Removed unused imports and interface
src/giftCards/GiftCardsList/providers/GiftCardListProvider/GiftCardListProvider.tsx Updated import path for IFilter type
src/giftCards/GiftCardsList/filters.ts Updated import path for FilterElement type
src/giftCards/GiftCardsList/GiftCardsListDatagrid/GiftCardsListDatagrid.tsx Updated import to named export for TablePagination
src/extensions/views/EditCustomExtension/components/WebhooksList/WebhooksList.tsx Updated import path for isUnnamed utility
src/extensions/utils.tsx Added utilities moved from custom-apps module
src/extensions/urls.ts Added types moved from custom-apps module
src/extensions/queries.ts Added query moved from custom-apps module
src/extensions/index.tsx Updated import path for CustomAppDetailsUrlQueryParams
src/extensions/handlers.ts Updated import paths for utilities
src/extensions/components/WebhookDetailsPage/messages.ts Updated import path for isUnnamed utility
src/extensions/components/WebhookDetailsPage/WebhookDetailsPage.tsx Updated import paths for handlers and types
src/discounts/views/VoucherList/filters.ts Updated import path for Filter types
src/discounts/views/SaleList/sort.ts Removed unused sort utility function
src/discounts/views/SaleList/filters.ts Updated import path for Filter types
src/discounts/views/SaleDetails/types.ts Removed unused constant
src/discounts/urls.ts Changed exports to internal types and removed unused types
src/discounts/components/VoucherListPage/filters.ts Updated import path for IFilter type
src/discounts/components/SaleSummary/styles.ts Removed unused styles file
src/discounts/components/SaleSummary/index.ts Removed unused index file
src/discounts/components/SaleSummary/SaleSummary.tsx Removed unused component
src/discounts/components/SaleListPage/filters.ts Updated import path and changed interface to internal
src/discounts/components/SaleListDatagrid/messages.ts Removed unused messages file
src/discounts/components/SaleListDatagrid/index.tsx Removed unused index file
src/discounts/components/SaleListDatagrid/datagrid.ts Removed unused datagrid utilities
src/discounts/components/SaleListDatagrid/SaleListDatagrid.tsx Removed unused component
src/customers/views/CustomerList/filters.ts Updated import path for FilterElement type
src/customers/components/CustomerListPage/filters.ts Updated import path for IFilter type
src/custom-apps/utils.tsx Removed file - utilities moved to extensions
src/custom-apps/urls.ts Removed file - types moved to extensions
src/custom-apps/queries.ts Removed file - queries moved to extensions
src/custom-apps/components/PermissionAlert/utils.ts Removed unused permission alert utilities
src/custom-apps/components/PermissionAlert/utils.test.ts Removed unused test file
src/custom-apps/components/PermissionAlert/PermissionAlert.tsx Removed unused component
src/custom-apps/components/PermissionAlert/PermissionAlert.test.tsx Removed unused test file
src/components/Timeline/TimelineNote.tsx Removed default export
src/components/Timeline/TimelineNote.test.tsx Updated import to named export
src/components/Timeline/TimelineEvent.tsx Removed default export
src/components/TablePagination/index.ts Removed default export
src/components/TablePagination/TablePaginationWithContext.tsx Updated import to named export
src/components/TablePagination/TablePagination.tsx Removed default export
src/components/Filter/utils.ts Removed unused import and getSelectedFiltersAmount function
src/components/Filter/index.ts Removed entire index file
src/components/Filter/FilterContent/index.tsx Removed index file
src/components/Filter/FilterContent/FilterSingleSelectField.tsx Updated import paths for Filter types
src/components/Filter/FilterContent/FilterNumericField.tsx Updated import paths for Filter types
src/components/Filter/FilterContent/FilterErrorsList.tsx Removed default export
src/components/Filter/FilterContent/FilterDateTimeField.tsx Updated import paths for Filter types
src/components/Filter/FilterContent/FilterContentHeader.tsx Removed default export
src/components/Filter/FilterContent/FilterContentBodyNameField.tsx Removed default export
src/components/Filter/FilterContent/FilterContentBody.tsx Removed default export
src/components/Filter/FilterContent/FilterContent.tsx Updated import paths and removed default export
src/components/Filter/Filter.tsx Removed entire Filter component
src/components/AppLayout/ListFilters/utils.ts Updated import path for Filter types
src/components/AppLayout/ListFilters/utils.test.ts Updated import path for Filter types
src/components/AppLayout/ListFilters/components/FiltersSelect.tsx Updated import paths for Filter types
src/components/AppLayout/ListFilters/ListFilters.tsx Updated import path for Filter types
src/collections/views/CollectionList/filters.ts Updated import path for Filter types
src/collections/components/CollectionListPage/filters.ts Updated import path for IFilter type
src/attributes/views/AttributeList/filters.ts Updated import path for FilterElement type
src/attributes/components/AttributeValues/AttributeValues.tsx Updated import to named export for TablePagination
src/attributes/components/AttributeListPage/filters.ts Updated import path for IFilter type
locale/defaultMessages.json Removed unused XZR590 message

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@lkostrowski lkostrowski added the skip changeset Use if your changes doesn't need entry in changelog label Oct 1, 2025
@lkostrowski lkostrowski marked this pull request as draft October 1, 2025 13:21
@codecov
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

❌ Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.04%. Comparing base (f98d15e) to head (852bcbe).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/extensions/utils.tsx 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5923      +/-   ##
==========================================
+ Coverage   39.94%   40.04%   +0.10%     
==========================================
  Files        2486     2472      -14     
  Lines       40423    40153     -270     
  Branches     8880     9144     +264     
==========================================
- Hits        16147    16080      -67     
+ Misses      24249    24046     -203     
  Partials       27       27              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot temporarily deployed to pr-5923 October 1, 2025 13:25 Destroyed
@lkostrowski lkostrowski marked this pull request as ready for review October 2, 2025 06:06
Copilot AI review requested due to automatic review settings October 2, 2025 06:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 91 out of 94 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/extensions/index.tsx:1

  • The import of CustomAppDetailsUrlQueryParams and PluginUrlQueryParams from extensions/urls should be verified against the actual exports in that file. The moved types may have different naming or may not exist in the target location.
import SectionRoute from "@dashboard/auth/components/SectionRoute";

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@lkostrowski lkostrowski merged commit 3688d92 into main Oct 2, 2025
30 checks passed
@lkostrowski lkostrowski deleted the remove-dead-code-6 branch October 2, 2025 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changeset Use if your changes doesn't need entry in changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants