vue-storefront | source frontend for any eCommerce | Ecommerce library
kandi X-RAY | vue-storefront Summary
kandi X-RAY | vue-storefront Summary
Vue Storefront is the most popular and most advanced Frontend Platform for eCommerce.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vue-storefront
vue-storefront Key Features
vue-storefront Examples and Code Snippets
Community Discussions
Trending Discussions on vue-storefront
QUESTION
Integrating Algolia search with VSF/Next branch, got the basics down. Moving on to routing.
With Vanilla Nuxt the integration works as it should, although the workarounds are starting to stack.
To Repro:
- pull && yarn && yarn run dev
- http://192.168.1.4:3000/ && search for something
- URL gets rewritten
checkout VSF get a flicker re-render.
To Repro:
- same as above except go to /Search
- URL gets rewritten for a flash then render fires and goes back to original route
What I’ve tried:
- Built the two repos in isolation and it seems to not be an issue with nuxt itself, more an issue with Vue StoreFront
Reference: https://github.com/algolia/vue-instantsearch/issues/916 (tangential)
...ANSWER
Answered 2021-Apr-13 at 04:35Okee this has something to do with the nuxt comp passing the route
I was able to bypass it by doing this in the default template
QUESTION
I have very bad expirience with Vuestorefront rebuilding because every change in code takes about 25 second. So I decided to turn off SSR (for development) and now it takes about 3-4 seconds! ...but now there is problem with VueJs lifecycle.
What I use
- Official Vuestorefront repo: https://github.com/vuestorefront/vue-storefront
Storefront is installed with: yarn, demo API, SSR endpoints and default theme. Everything works perfectly, but it is slow for development.
- Optimized Webpack configuration: https://github.com/yireo-training/vsf1-local-webpack
Following tutorial in readme everything works fine, every change in code is builded in 4 second. Successful build automatically refresh website with hot-reload.
What is the problem?
- I can't open any link directly (link to product, category, etc...) and can't refresh/reload any page
I find out in these cases is skipped function asyncData
which preload data. For example product page: https://github.com/vuestorefront/vsf-default/blob/master/pages/Product.vue#L334
When I click on product detail from homepage, function asyncData
is triggered and product page is correctly loaded but with refresh (F5) is asyncData
skipped.
I tried to reimplement code from asyncData
to method beforeCreated
but it still doesn't work.
My question
How to force calling function asyncData
?
...or is there way to reconfigure Webpack to make this work?
...or is there another way to rebuild vuestorefront faster?
...ANSWER
Answered 2021-Mar-04 at 10:09thanks for trying out my Webpack config. Please note that it is far from perfect and it requires a collaboration of minds to make it work in all situations.
As you have seen already in the code: The Vue meta plugin uses the metaInfo
method to provide tags. The Product
component again calls upon a computable getCurrentProduct
computable, which again calls upon the Vuex getter product/getCurrentProduct
. And again this requires the asyncData()
method to be executed so that data is loaded from ElasticSearch or GraphQL.
The asyncData()
is normally either executed asynchronously in the browser (duh!) or synchronously on the server when SSR is working. This means that in a default VSF1 situation, the call this.getCurrentProduct.meta_title
(within the metaInfo
method) will never fail, because it will depend upon something from Vuex that has been loaded synchronously before already. However, without SSR, this leads into a code issue, because the Vuex store will be filled after the metaInfo
tag is executed. So it might make more sense to rewrite the metaInfo
method a bit like the following:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vue-storefront
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page