Giter VIP home page Giter VIP logo

nuxt-swell's Introduction

๐Ÿ’ซ About Me:

  • Building Web & App Experience you will love ๐Ÿค
  • Head of Technical Communications & Co Founder Werbeberg
  • Storyblok Ambassador ๐Ÿ’š
  • Full Stack Developer & Tech Enthusiast ๐Ÿ‘จโ€๐Ÿ’ป

๐ŸŒ Socials:

LinkedIn Stack Overflow

๐Ÿ’ป Tech Stack:

CSS3 JavaScript Java HTML5 AWS Netlify Express.js NuxtJS NodeJS SASS Spring Vue.js TailwindCSS MySQL MariaDB Supabase Postgres

nuxt-swell's People

Contributors

krislunde avatar markus-gx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

42pre krislunde

nuxt-swell's Issues

Nicely done! Some recommendations to consider :)

First of all, big kudos for developing your very first module!

I really enjoy looking at it and I think it has a potential to help developers built better storefronts.

Below, I listed some recommendations that you may add to your module that can make it a bit better ;)

  1. Composables should start with useSomething. I am a big fan of simple composables that do one thing only so they are easier to test and maintain. useSwell work really well, but for product and products fetch I think it would require some refactor. In my algolia module I am using the name useAlgoliaSearch where I destructure it in a way like this const { result, search } = useAlgoliaSearch('index_name'). It allows the user to define when he would like to fetch the data (for example, maybe he would like to fetch it on onMounted hook instead of useAsyncData. But you can also keep it as a composable that will just fetch the results and name it for example: useSwellProducts or useSwellProduct. In here, you could do something similar to what Storyblok did in their composable (trigger either useAsyncData or onMounted inside based on condition). I think it will be easier then to distinguish composables from your module inside a nuxt application.
  2. Pass options apart from the mandatory key and id. In your configuration, I can see that you have this useCamelCase. I would recommend to add it to the options object inside configuration. Thanks to that, when you develop more configuration options that are not mandatory for the users to set, you will just populate the options object instead of the main configuration.
swell: {
  storeId: "YOUR_STORE_ID",
  apiKey: "YOUR_PUBLIC_ACCESS_TOKEN",
  options?: {
    useCamelCase: true //Default is true change it to false to switch to snake_case responses,
    someOtherOption in the future
  }
}
  1. Full module options type. I would recommend to keep your module configuration type up to date with the actual configuration. Nuxt 3 has a great TS support so it would be great to have a typing support for all configuration and separate composables :)

Optional (later):

  1. Write Docus docs for the module with examples of usage.
  2. Write content about your module (even a simple dev.to article)
  3. Create a simple storefront app with this module implemented.

And that basically it! This module serves its purpose even now, so by adding these recommendations I think you will make it even better. With time, I would add more composable to fetch certain data (like category, user, checkout, etc) so that users will have less steps to do in order to build their storefronts.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.