Skip to content

Conversation

@maxy-shpfy
Copy link
Collaborator

@maxy-shpfy maxy-shpfy commented Dec 16, 2025

Description

Closes https://github.com/Shopify/oasis-frontend/issues/249

Refactored component library functionality by removing the checkLibraryContainsComponent method and replacing it with a more efficient approach using React Query. The new implementation:

  1. Adds a useComponentFlags hook that uses useSuspenseQuery to determine if a component exists in the library
  2. Wraps the ComponentFavoriteToggle with a suspense wrapper to handle loading states
  3. Improves performance by adding stale time to the query and optimizing component comparison

Type of Change

  • Improvement
  • Cleanup/Refactor

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Test Instructions

  1. Verify that component favorites still work correctly
  2. Check that components are properly identified as being in the library or not
  3. Confirm that loading states are handled appropriately with the suspense wrapper

@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_move_checklibrarycontainscomponent_out_of_componentlibraryprovider branch from 1a8927f to a13a7ba Compare December 17, 2025 19:05
@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_remove_unsused_props_from_componentlibraryprovider branch from 52688cd to d1d0ffa Compare December 17, 2025 19:05
@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_move_checklibrarycontainscomponent_out_of_componentlibraryprovider branch from a13a7ba to 95243ac Compare December 17, 2025 19:16
@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_remove_unsused_props_from_componentlibraryprovider branch from d1d0ffa to 499ca85 Compare December 17, 2025 19:16
@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_move_checklibrarycontainscomponent_out_of_componentlibraryprovider branch from 95243ac to eb2e3e1 Compare December 17, 2025 19:21
@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_remove_unsused_props_from_componentlibraryprovider branch from 9afbd92 to 37ad5c1 Compare December 18, 2025 16:56
@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_move_checklibrarycontainscomponent_out_of_componentlibraryprovider branch from eb2e3e1 to 60a1090 Compare December 18, 2025 16:57
@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_remove_unsused_props_from_componentlibraryprovider branch from 37ad5c1 to 322e1b5 Compare December 18, 2025 17:54
@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_move_checklibrarycontainscomponent_out_of_componentlibraryprovider branch from 60a1090 to a598bc8 Compare December 18, 2025 17:54
@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_remove_unsused_props_from_componentlibraryprovider branch from 322e1b5 to c12b240 Compare December 18, 2025 18:00
@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_move_checklibrarycontainscomponent_out_of_componentlibraryprovider branch from a598bc8 to 1f2779a Compare December 18, 2025 18:01
@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_remove_unsused_props_from_componentlibraryprovider branch from c12b240 to d9d756b Compare December 18, 2025 18:08
@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_move_checklibrarycontainscomponent_out_of_componentlibraryprovider branch from 1f2779a to 35ddb51 Compare December 18, 2025 18:08
@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_remove_unsused_props_from_componentlibraryprovider branch 2 times, most recently from d4135ef to cc2648a Compare December 18, 2025 18:28
@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_move_checklibrarycontainscomponent_out_of_componentlibraryprovider branch from 35ddb51 to 3a20178 Compare December 18, 2025 18:28
@maxy-shpfy maxy-shpfy changed the base branch from 12-15-refactor_remove_unsused_props_from_componentlibraryprovider to graphite-base/1564 December 18, 2025 18:32
@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_move_checklibrarycontainscomponent_out_of_componentlibraryprovider branch from 3a20178 to 4e3ff01 Compare December 18, 2025 18:33
@graphite-app graphite-app bot changed the base branch from graphite-base/1564 to master December 18, 2025 18:34
@maxy-shpfy maxy-shpfy force-pushed the 12-15-refactor_move_checklibrarycontainscomponent_out_of_componentlibraryprovider branch from 4e3ff01 to df3f54e Compare December 18, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants