vue-storefront-1 icon indicating copy to clipboard operation
vue-storefront-1 copied to clipboard

Excessive storeView initialization

Open lukeromanowicz opened this issue 6 years ago • 1 comments

Current behavior

As mentioned in vuestorefront/vue-storefront#3270, in multistore mode the default storeview is unnecessarily being initialized and later changed to target storeview.

The full scenario is as follows:

  • Server initializes full default storeview including translations, sync task storage etc in https://github.com/DivanteLtd/vue-storefront/blob/c53ccb0073c0810b735df0f944bd20d6fba608d4/core/app.ts#L75
  • Server adds to the router every single page for every single storeview defined in the config
  • Server's router matches a page with the corresponding storecode https://github.com/DivanteLtd/vue-storefront/blob/c53ccb0073c0810b735df0f944bd20d6fba608d4/core/server-entry.ts#L73-L83
  • Server initializes full target storeview by storecode from the previous step <-- extend mechanism is here

In addition, appendStoreCode attribute is used in 2nd step, while it's being inherited in the 4th step so it cannot be extended.

Expected behavior

App initialization in multistore mode is rewritten to a way that there is no need to initialize any other storeview than the target one. All storeview attributes should be inherited through the "extend" mechanism, including appendStoreCode and url.

After fixing inheritance of attributes mentioned above, please adjust the docs.

Can you handle fixing this bug by yourself?

  • [x] YES but not anytime soon.
  • [ ] NO

Which Release Cycle state this refers to? Info for developer.

Pick one option.

  • [x] This is a bug report for test version on https://test.storefrontcloud.io - In this case Developer should create branch from develop branch and create Pull Request 2. Feature / Improvement back to develop.
  • [ ] This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from release branch and create Pull Request 3. Stabilisation fix back to release.
  • [ ] This is a bug report for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version hotfix - In this case Developer should create branch from hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.

lukeromanowicz avatar Jul 25 '19 07:07 lukeromanowicz

I guess it's been already done within 1.11 @lukeromanowicz

pkarw avatar Nov 07 '19 14:11 pkarw