Skip to content

Discussion Starter: Enhancing DXย #67

@dimitrio-m

Description

@dimitrio-m

Hello!

Since I work a lot with Medusa projects and I love working with Nuxt, I've been spending some time thinking about how we could further enhance the developer experience with the module, and I wanted to share some personal observations and ideas to kickstart a discussion within the community.

In my experience, I've found that I often write repetitive boilerplate for common operations. For instance, tasks like fetching product lists with specific criteria, managing the full shopping cart lifecycle, or handling user authentication states seem to be areas where we could potentially simplify things further.

My idea is that perhaps we can build higher-level abstractions to make these common tasks even more intuitive.

Based on these thoughts, I'd like to propose for discussion the idea of enhancing @nuxtjs/medusa with a suite of more granular, task-specific composables and utilities. These are just initial suggestions to get the conversation going, and I'm eager to hear other perspectives. Some examples are:

  • useMedusaProducts(options?: ProductListOptions): Could this simplify reactive fetching of product lists, handling pagination, sorting, filtering, and state (data, loading, error)?

  • useMedusaProduct(id: string): For fetching and managing a single product's state.

  • useMedusaCollections(options?: CollectionListOptions): Similar to products, but for collections.

  • useMedusaRegions(): To easily fetch and manage available regions.

Maybe we could do the same with the cart lifecycle, authentication, etc.

Of course, developers can build these abstractions themselves on top of useMedusaClient. The discussion point here is whether incorporating standardized versions into the module itself would offer greater community benefits or we should leave it as it is.

My main goal here is to foster a collaborative discussion. I believe that by sharing our experiences and ideas, we can collectively shape the future direction of @nuxtjs/medusa to make it more powerful and enjoyable to use.

Looking forward to hearing your thoughts and opinions!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions