-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
167 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Migration guide 2.2.0 | ||
|
||
This version introduces many renamings or changes related to the function declarations among of the core. We had to proceed with this in order to keep the convention and unify the naming across whole VSF. | ||
|
||
We changes the composables and our factories according to the following rules: | ||
- each composable return always one field with the response from the api | ||
- each composable function takes one argument wich is an object of given parameters | ||
- each factory param function takes two argumens, first one is context (as it was before) and second one contains a function parmeters along with other options (such as customQuery) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,2 @@ | ||
# Migration guide | ||
|
||
This guide contains a list of changes, in order to upgrade your VSF next to the RC.1 version. | ||
|
||
## The general overview | ||
|
||
In general, besides the smaller changes, we totally have changed the way of accessing configuration or API functions. | ||
Always, instead of using configuration or networking stored in the global objects, we recommend to use context, provided by us. | ||
|
||
Each time you want to access an integration stuff, such as network client, configuration or API functions please use `useVSFContext` | ||
|
||
```js | ||
import { useVSFContext } from '@vue-storefront/core'; | ||
|
||
export default { | ||
setup () { | ||
const { $integrationTag } = useVSFContext(); | ||
} | ||
} | ||
|
||
``` | ||
|
||
For more information, please read the section [Application Context](/general/context) in the general docs. | ||
|
||
## List of changes for certain users | ||
|
||
- [Changes for integrators](/migrate/integrators) | ||
- [Changes for projects](/migrate/projects) | ||
|
||
|
||
## Common problems | ||
|
||
### Composition API already installed | ||
|
||
``` | ||
[vue-composition-api] already installed. Vue.use(VueCompositionAPI) should be called only once. | ||
``` | ||
|
||
**Solution**: Please make sure that you have everywhere the same version of vue composition api as the one we use in the core | ||
|
||
### Using Composition API before is being installed | ||
|
||
``` | ||
Uncaught Error: [vue-composition-api] must call Vue.use(plugin) before using any function. | ||
``` | ||
**Solution**: if you are using compositon API (eg. `ref`) above the component, please make sure that you have `vue-composition-api` installed, or move these calls inside of the `setup` function. | ||
|
||
### Some of our package doesn't work, the context doesn't return anything or has missing data | ||
|
||
**Solution**: Please make sure that you put package in the raw sources section, and if the integration has nuxt module and extend an existing one, should be aded before our core nuxt module and the one with integration | ||
|
||
```js | ||
{ | ||
['@vue-storefront/some-new-integration/nuxt', {}], // 2 | ||
['@vue-storefront/nuxt', { | ||
coreDevelopment: true, | ||
useRawSource: { | ||
dev: [ | ||
'@vue-storefront/core' | ||
'@vue-storefront/other-package' // 1 | ||
], | ||
prod: [ | ||
'@vue-storefront/core', | ||
'@vue-storefront/other-package' // 1 | ||
] | ||
} | ||
}], | ||
['@vue-storefront/some-integration/nuxt', {}] | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Integrators upgrade notes | ||
|
||
## Factory usage | ||
|
||
We have changes a bit the naming and signatures of core factory functions. Below is the full list of what hs been implemented or changed: | ||
|
||
| Factory | Old method | New method | Old signature | New signature | | ||
|------------|--------|---------------|---------------|---| | ||
| useCartFactory | addToCart | addItem | context, { currentCart: cart.value, product, quantity }, customQuery | context, { currentCart: cart.value, product, quantity, customQuery } | | ||
| useCartFactory | loadCart | load | context: Context, customQuery?: CustomQuery | context: Context, { customQuery?: any } | | ||
| useCartFactory | removeFromCart | removeItem | context: Context, params: { currentCart: CART, product: CART_ITEM }, customQuery?: CustomQuery | context: Context, params: { currentCart: CART, product: CART_ITEM, customQuery?: CustomQuery } | | ||
| useCartFactory | updateQuantity | updateItemQty | context: Context, params: { currentCart: CART, product: CART_ITEM, quantity: number }, customQuery?: CustomQuery | context: Context, params: { currentCart: CART, product: CART_ITEM, customQuery?: CustomQuery } | | ||
| useCartFactory | clearCart | clear | context: Context, prams: { currentCart: CART } | context: Context, params: { currentCart: CART } | | ||
| useCartFactory | applyCoupon | No changes | context: Context, params: { currentCart: CART; couponCode: string }, customQuery?: CustomQuery | context: Context, params: { currentCart: CART, couponCode: string, customQuery?: CustomQuery } | | ||
| useCartFactory | removeCoupon | No changes | context: Context, params: { currentCart: CART; coupon: COUPON }, customQuery?: CustomQuery | context: Context, params: { currentCart: CART; coupon: COUPON, customQuery?: CustomQuery } | | ||
| useCategoryFactory | categorySearch | No changes | context: Context, searchParams: CATEGORY_SEARCH_PARAMS, customQuery: CustomQuery | context: Context, params: CATEGORY_SEARCH_PARAMS & { customQuery?: CustomQuery } | | ||
| useProductFactory | productsSearch | No changes | context: Context, searchParams: PRODUCT_SEARCH_PARAMS, customQuery?: CustomQuery | context: Context, params: PRODUCT_SEARCH_PARAMS & { customQuery?: CustomQuery } | | ||
| useReviewFactory | searchReviews | No changes | context: Context, params: REVIEWS_SEARCH_PARAMS, customQuery?: CustomQuery | context: Context, params: REVIEWS_SEARCH_PARAMS & { customQuery?: CustomQuery } | | ||
| useReviewFactory | addReview | No changes | context: Context, params: REVIEW_ADD_PARAMS, customQuery?: CustomQuery | context: Context, params: REVIEW_ADD_PARAMS & { customQuery?: CustomQuery } | | ||
| useUserBillingFactory | setDefault | setDefaultAddress | context: Context, params: { address: Readonly<USER_BILLING_ITEM>; shipping: Readonly<USER_BILLING>; }) | No changes | | ||
| useUserShippingFactory | setDefault | setDefaultAddress | context: Context, params: { address: Readonly<USER_SHIPPING_ITEM>; shipping: Readonly<USER_SHIPPING>; }) | No changes | | ||
| useUserFactory | loadUser | load | context: Context, | context: Context, params?: {} | | ||
| useUserOrdersFactory | searchOrders | No changes | context: Context, params: ORDER_SEARCH_PARAMS, customQuery?: CustomQuery | context: Context, params: ORDER_SEARCH_PARAMS & { customQuery?: CustomQuery } | | ||
| useWishlistFactory | addToWishlist | addItem | context, { currentWishlist: WISHLIST, product: PRODUCT }, customQuery | context, { currentWishlist: WISHLIST, product: PRODUCT, customQuery } | | ||
| useWishlistFactory | loadWishlist | load | context: Context, customQuery?: CustomQuery | No changes | | ||
| useWishlistFactory | removeFromWishlist | removeItem | context: Context, params: { currentWishlist: WISHLIST, product: WISHLIST_ITEM }, customQuery?: CustomQuery | context: Context, params: { currentWishlist: WISHLIST, product: WISHLIST_ITEM, customQuery?: CustomQuery } | | ||
| useWishlistFactory | clearWishlist | clear | context: Context, params: { currentWishlist: WISHLIST } | No changes | | ||
| useWishlistFactory | loadWishlist | load | context: Context, customQuery?: CustomQuery | context: Context, { customQuery?: any } | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Project upgrade notes | ||
|
||
## Composables usage | ||
|
||
We have changes a bit the naming and signatures of composable functions. Below is the full list of what hs been implemented or changed: | ||
|
||
| Composable | Method | Old signature | New signature | | ||
|------------|--------|---------------|---------------| | ||
| useCart | addToCart | (product: PRODUCT, quantity: number, customQuery?: CustomQuery) | ({ product: PRODUCT, quantity: number, customQuery?: CustomQuery }) | | ||
| useCart | removeFromCart | (product: CART_ITEM, customQuery?: CustomQuery) | ({ product: CART_ITEM, customQuery?: CustomQuery }) | | ||
| useCart | updateQuantity | (product: CART_ITEM, quantity?: number, customQuery?: CustomQuery) | ({ product: CART_ITEM, quantity?: number, customQuery?: CustomQuery }) | | ||
| useCart | load | (customQuery?: CustomQuery) | ({ customQuery?: CustomQuery } = {}) | | ||
| useCart | clearCart | () | () | | ||
| useCart | applyCoupon | (couponCode: string, customQuery?: CustomQuery) | ({ couponCode: string, customQuery?: CustomQuery }) | | ||
| useCart | isOnCart | (product: PRODUCT) | ({ product: PRODUCT }) | | ||
| useCart | removeCoupon | (coupon: COUPON, customQuery?: CustomQuery) | ({ coupon: COUPON, customQuery?: CustomQuery }) | | ||
| useCart | setCart | (newCart: CART) | ({ newCart: CART }) | | ||
| useCategory | search | (searchParams: CATEGORY_SEARCH_PARAMS, customQuery?: CustomQuery) | ({ ...searchParams: CATEGORY_SEARCH_PARAMS, customQuery?: CustomQuery }) | | ||
| useContent | search | (params: CONTENT_SEARCH_PARAMS) | No changes | | ||
| useFacet | search | (params?: AgnosticFacetSearchParams) | No changes | | ||
| useProduct | search | (searchParams: PRODUCT_SEARCH_PARAMS, customQuery?: CustomQuery) | ({ ...searchParams: PRODUCT_SEARCH_PARAMS, customQuery?: CustomQuery }) | | ||
| useReview | search | (searchParams: REVIEWS_SEARCH_PARAMS, customQuery?: CustomQuery) | ({ ...searchParams: REVIEWS_SEARCH_PARAMS, customQuery?: CustomQuery }) | | ||
| useReview | addReview | (addParams: REVIEW_ADD_PARAMS, customQuery?: CustomQuery) | ({ ...addParams: REVIEW_ADD_PARAMS, customQuery?: CustomQuery }) | | ||
| useUserBilling | addAddress | (address: USER_BILLING_ITEM) | ({ address: USER_BILLING_ITEM }) | | ||
| useUserBilling | deleteAddress | (address: USER_BILLING_ITEM) | ({ address: USER_BILLING_ITEM }) | | ||
| useUserBilling | updateAddress | (address: USER_BILLING_ITEM) | ({ address: USER_BILLING_ITEM }) | | ||
| useUserBilling | setDefault | (address: USER_BILLING_ITEM) | ({ address: USER_BILLING_ITEM }) | | ||
| useUserBilling | load | () | () | | ||
| useUserShipping | addAddress | (address: USER_SHIPPING_ITEM) | ({ address: USER_SHIPPING_ITEM }) | | ||
| useUserShipping | deleteAddress | (address: USER_SHIPPING_ITEM) | ({ address: USER_SHIPPING_ITEM }) | | ||
| useUserShipping | updateAddress | (address: USER_SHIPPING_ITEM) | ({ address: USER_SHIPPING_ITEM }) | | ||
| useUserShipping | setDefault | (address: USER_SHIPPING_ITEM) | ({ address: USER_SHIPPING_ITEM }) | | ||
| useUserShipping | load | () | () | | ||
| useUser | updateUser | (params: UPDATE_USER_PARAMS) | ({ user: UPDATE_USER_PARAMS }) | | ||
| useUser | register | (registerUserData: REGISTER_USER_PARAMS) | ({ user: REGISTER_USER_PARAMS }) | | ||
| useUser | login | (loginUserData: { username: string; password: string; }) | ({ user: LOGIN_USER_PARAMS }) | | ||
| useUser | logout | () | () | | ||
| useUser | changePassword | (currentPassword: string, newPassword: string) | ({ currentPassword: string, newPassword: string }) | | ||
| useUser | load | () | () | | ||
| useUserOrders | searchOrders | (searchParams: ORDER_SEARCH_PARAMS, customQuery?: CustomQuery) | ({ ...searchParams: ORDER_SEARCH_PARAMS, customQuery?: CustomQuery } = {}) | | ||
| useWishlist | addToWishlist | (product: PRODUCT, customQuery?: CustomQuery) | ({ product: PRODUCT, customQuery?: CustomQuery }) | | ||
| useWishlist | removeFromWishlist | (product: WISHLIST_ITEM, customQuery?: CustomQuery) | ({ product: WISHLIST_ITEM, customQuery?: CustomQuery }) | | ||
| useWishlist | load | (customQuery?: CustomQuery) | ({ customQuery?: CustomQuery } = {}) | | ||
| useWishlist | clearWishlist | () | () | | ||
| useWishlist | isOnWishlist | (product: PRODUCT) | ({ product: PRODUCT }) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Migration guide | ||
|
||
This guide contains a list of changes, in order to upgrade your VSF next to the RC.1 version. | ||
|
||
## The general overview | ||
|
||
In general, besides the smaller changes, we totally have changed the way of accessing configuration or API functions. | ||
Always, instead of using configuration or networking stored in the global objects, we recommend to use context, provided by us. | ||
|
||
Each time you want to access an integration stuff, such as network client, configuration or API functions please use `useVSFContext` | ||
|
||
```js | ||
import { useVSFContext } from '@vue-storefront/core'; | ||
|
||
export default { | ||
setup () { | ||
const { $integrationTag } = useVSFContext(); | ||
} | ||
} | ||
|
||
``` | ||
|
||
For more information, please read the section [Application Context](/general/context) in the general docs. | ||
|
||
## List of changes for certain users | ||
|
||
- [Changes for integrators](/migrate/integrators) | ||
- [Changes for projects](/migrate/projects) | ||
|
||
|
||
## Common problems | ||
|
||
### Composition API already installed | ||
|
||
``` | ||
[vue-composition-api] already installed. Vue.use(VueCompositionAPI) should be called only once. | ||
``` | ||
|
||
**Solution**: Please make sure that you have everywhere the same version of vue composition api as the one we use in the core | ||
|
||
### Using Composition API before is being installed | ||
|
||
``` | ||
Uncaught Error: [vue-composition-api] must call Vue.use(plugin) before using any function. | ||
``` | ||
**Solution**: if you are using compositon API (eg. `ref`) above the component, please make sure that you have `vue-composition-api` installed, or move these calls inside of the `setup` function. | ||
|
||
### Some of our package doesn't work, the context doesn't return anything or has missing data | ||
|
||
**Solution**: Please make sure that you put package in the raw sources section, and if the integration has nuxt module and extend an existing one, should be aded before our core nuxt module and the one with integration | ||
|
||
```js | ||
{ | ||
['@vue-storefront/some-new-integration/nuxt', {}], // 2 | ||
['@vue-storefront/nuxt', { | ||
coreDevelopment: true, | ||
useRawSource: { | ||
dev: [ | ||
'@vue-storefront/core' | ||
'@vue-storefront/other-package' // 1 | ||
], | ||
prod: [ | ||
'@vue-storefront/core', | ||
'@vue-storefront/other-package' // 1 | ||
] | ||
} | ||
}], | ||
['@vue-storefront/some-integration/nuxt', {}] | ||
} | ||
``` |