feat(feature-shopping-list): cross-platform hooks + screens #18

Merged
admin-mrrm merged 1 commit from feat/feature-shopping-list into main 2026-04-15 17:17:40 +02:00
Owner

Summary

  • Adds @mrrmlab/feature-shopping-list — a source-only workspace package that bundles everything product-facing for the shopping list feature so the web and mobile apps can just drop it in
  • ApiClientProvider + useApiClient context so every hook grabs the same @mrrmlab/api-client instance without prop drilling
  • TanStack Query hooks for all CRUD operations: useShoppingLists, useShoppingList, useCreateShoppingList, useUpdateShoppingList, useDeleteShoppingList, useAddShoppingListItem, useUpdateShoppingListItem, useDeleteShoppingListItem
  • Centralized shoppingListKeys factory (flat readonly tuples, tkdodo pattern)
  • Two Tamagui screens built on @mrrmlab/ui primitives: ShoppingListsScreen (overview + create/delete) and ShoppingListScreen (detail + add/toggle/delete items sorted by position)

Architecture notes

  • TanStack Query v5 is a peer dependency so the host app owns the QueryClient — the feature package never creates one
  • Navigation is intentionally left to the host: ShoppingListsScreen takes an onOpenList callback, ShoppingListScreen takes listId + optional onBack. Web uses TanStack Router, mobile uses Expo Router — neither is the feature package's problem
  • Mutations forward any consumer-supplied onSuccess after running the invalidation, so apps can still hook in for toasts/tracking without losing cache invalidation
  • onSuccess takes 4 args in @tanstack/react-query v5: (data, variables, onMutateResult, context) — forwarded verbatim

Test plan

  • pnpm --filter @mrrmlab/feature-shopping-list typecheck passes
  • pnpm -r typecheck passes (full workspace still clean, 7 packages + api)
  • End-to-end render verification happens in #11 (web app) and #12 (mobile app)

Closes #10

## Summary - Adds `@mrrmlab/feature-shopping-list` — a source-only workspace package that bundles everything product-facing for the shopping list feature so the web and mobile apps can just drop it in - `ApiClientProvider` + `useApiClient` context so every hook grabs the same `@mrrmlab/api-client` instance without prop drilling - TanStack Query hooks for all CRUD operations: `useShoppingLists`, `useShoppingList`, `useCreateShoppingList`, `useUpdateShoppingList`, `useDeleteShoppingList`, `useAddShoppingListItem`, `useUpdateShoppingListItem`, `useDeleteShoppingListItem` - Centralized `shoppingListKeys` factory (flat readonly tuples, [tkdodo pattern](https://tkdodo.eu/blog/effective-react-query-keys)) - Two Tamagui screens built on `@mrrmlab/ui` primitives: `ShoppingListsScreen` (overview + create/delete) and `ShoppingListScreen` (detail + add/toggle/delete items sorted by `position`) ## Architecture notes - TanStack Query v5 is a **peer dependency** so the host app owns the `QueryClient` — the feature package never creates one - Navigation is intentionally left to the host: `ShoppingListsScreen` takes an `onOpenList` callback, `ShoppingListScreen` takes `listId` + optional `onBack`. Web uses TanStack Router, mobile uses Expo Router — neither is the feature package's problem - Mutations forward any consumer-supplied `onSuccess` after running the invalidation, so apps can still hook in for toasts/tracking without losing cache invalidation - `onSuccess` takes 4 args in `@tanstack/react-query` v5: `(data, variables, onMutateResult, context)` — forwarded verbatim ## Test plan - [x] `pnpm --filter @mrrmlab/feature-shopping-list typecheck` passes - [x] `pnpm -r typecheck` passes (full workspace still clean, 7 packages + api) - [ ] End-to-end render verification happens in #11 (web app) and #12 (mobile app) Closes #10
Adds @mrrmlab/feature-shopping-list as a source-only workspace package
that bundles the TanStack Query hooks, query-key factory, api-client
context and two Tamagui screens (ShoppingListsScreen, ShoppingListScreen)
for the shopping-list feature. Web (#11) and mobile (#12) apps just drop
these screens into their router.

Closes #10

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
admin-mrrm deleted branch feat/feature-shopping-list 2026-04-15 17:17:40 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
admin-mrrm/mrrmlabapp!18
No description provided.