Skip to content

[WIP] Wishlist 2.x refactoring plan #66

Draft
Wojdylak wants to merge 1 commit intoSylius:2.0from
Wojdylak:wishlist-refactor-plan
Draft

[WIP] Wishlist 2.x refactoring plan #66
Wojdylak wants to merge 1 commit intoSylius:2.0from
Wojdylak:wishlist-refactor-plan

Conversation

@Wojdylak
Copy link
Copy Markdown
Member

@Wojdylak Wojdylak commented Mar 27, 2026

Summary

This PR contains the refactoring plan for migrating the Wishlist Plugin to 2.x. It is a working document — not meant to be merged, will be closed when the work is complete.

We are breaking down PR #20 into smaller, focused PRs while improving on its approach based on lessons learned from 3 production projects (dafre, elesto, solenne).

Progress

  • PR 0 — Refactor remove commands to accept wishlist object instead of token (refactor-remove-product-command) Refactor remove commands to accept wishlist object instead of token  #64
  • PR 1 — Replace add-to-wishlist button with WishlistButtonComponent LiveComponent (add-live-component) Replace add-to-wishlist with WishlistButtonComponent LiveComponent  #65
  • PR 2 — CachedWishlistsResolver (in-memory cache decorator)
  • PR 3 — Wishlist CRUD LiveComponents (create/edit/remove with modals)
  • PR 4 — Wishlist Details item actions (remove item, clear wishlist)
  • PR 5 — Bulk/Collective actions (add to cart, remove selected, copy)
  • PR 6 — Import/Export improvements
  • PR 7 — Routing cleanup (/wishlist/ → /wishlists/)
  • PR 8 — Header widget with item count badge
  • PR 9 — UX improvements (back navigation, translations)

Key architectural decisions

  • Wishlist token is not unique — all anonymous wishlists share the same cookie token. We use ID + resolver for ownership.
  • Resolver is the ownership gate — only returns current user's wishlists. No direct repository access for wishlist lookup in components.
  • Authorization in controllers, not handlers — handlers are pure business logic.
  • Commands use setWishlist() pattern — both add and remove, consistent interface.
  • One component for cards and product page — WishlistButtonComponent with optional variant awareness.
  • Dispatch existing commands via MessageBus — no direct persistence in components.

How to continue

See WISHLIST_REFACTOR_PLAN.md for the full plan with details on each PR, what was done, what's left, and architecture notes.

@Wojdylak Wojdylak requested a review from a team as a code owner March 27, 2026 08:46
@Wojdylak Wojdylak marked this pull request as draft March 27, 2026 08:46
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.

1 participant