question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modules for external providers

See original GitHub issue

Modules for external providers

Right now, the code base is strictly coupled with data hooks providers. We need to enable the use of different providers interchangeably.

We’re discussing steps forward with @LFades to add different data sources to Next.js Commerce and make it super easy to switch data providers and even aggregate them.


Goals of Commerce

  • Next.js Commerce should have a completely data agnostic UI
  • Aware of schema: should ship with the right data schemas and types.
  • All providers should return the right data types and schemas to blend correctly with Next.js Commerce.
  • @framework will be the alias utilized in commerce and it will map to the ecommerce provider of preference- e.g BigCommerce, Shopify, Swell. All providers should expose the same standardized functions. Note that the same applies for recipes using a CMS + an ecommerce provider.

There is a framework folder in the root folder that will contain multiple ecommerce providers.

Additionally, we need to ensure feature parity (not all providers have e.g. wishlist) we will also have to build a feature API to disable/enable features in the UI.

Expected Structure

Main folder and its exposed functions

  • product

    • usePrice
    • useSearch
    • getProduct
    • getAllProducts
  • wishlist

    • useWishlist
    • addWishlistItem
    • removeWishlistItem
  • auth

    • useLogin
    • useLogout
    • useSignup
  • cart

    • useCart
    • useAddItem
    • useRemoveItem
    • useCartActions
    • useUpdateItem
  • config.json

  • README.md

Example of correct usage of Commece Framework

import { useUI } from '@components/ui'
import { useCustomer } from '@framework/customer'
import { useAddItem, useWishlist, useRemoveItem } from '@framework/wishlist'

Providers under development:

Providers help needed:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:85
  • Comments:34 (14 by maintainers)

github_iconTop GitHub Comments

18reactions
okbelcommented, Jan 21, 2021

EDIT: This comment is outdated. We moved everything to the framework folder in the root. There you’ll be able to create your own providers, take a look at the updated description of this issue ⬆️

Hello all!

We ported all our hooks to here -> https://github.com/vercel/commerce-framework. Under the example folder you’ll be able to create your own hooks to use them with Next.js Commerce.

Here is the proposed API to support new providers. https://github.com/vercel/commerce-framework/pull/1/files?short_path=b335630#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5

We’re actively looking for contributors to work on a Shopify and Magento providers. Please ping me if you want to contribute.

11reactions
okbelcommented, Jan 21, 2021

Hello all!

We are actively working towards achieving these goals, mentioned in the README:

Goals of Commerce

  • Next.js Commerce should have a completely data agnostic UI
  • Aware of schema: should ship with the right data schemas and types.
  • All providers should return the right data types and schemas to blend correctly with Next.js Commerce.
  • @framework will be the alias utilized in commerce and it will map to the ecommerce provider of preference- e.g BigCommerce, Shopify, Swell. All providers should expose the same standardized functions. Note that the same applies for recipes using a CMS + an ecommerce provider.

There is a framework folder in the root folder that will contain multiple ecommerce providers.

Additionally, we need to ensure feature parity (not all providers have e.g. wishlist) we will also have to build a feature API to disable/enable features in the UI.

As always, I’m highly reachable through Twitter DMs. People actively working on this project: @okbel & @lfades.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module to manage external providers in oVirt/RHV
ovirt.ovirt.ovirt_external_provider module – Module to manage external providers in oVirt/RHV . Note. This module is part of the ovirt.ovirt collection ...
Read more >
Service Provider Modules - IBM
Service Provider Modules · Cryptographic Service Providers · Trust Policy Modules · Certificate Library Modules · Data Storage Library Modules.
Read more >
Providing dependencies in modules - Angular
A provider is an instruction to the Dependency Injection system on how to obtain a value for a dependency. Most of the time,...
Read more >
Providers Within Modules - Configuration Language | Terraform
Provider configurations, unlike most other concepts in Terraform, are global to an entire Terraform configuration and can be shared across module boundaries.
Read more >
Viewing external providers - Jahia Academy
This panel list all external data sources whether they have been declared automatically when a module is deployed (code driven), ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found