Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update Vue Storefront core packages to 2.5.7 #282

Merged

Conversation

fpdrozd
Copy link
Contributor

@fpdrozd fpdrozd commented Dec 14, 2022

This PR is the first step of incrementally upgrading Vue Storefront to the latest version (2.7.3 at the time).

Description

According to the 2.5.7 Changelog this is the first version that introduces some breaking changes since the current 2.5.0.

The middlewareUrl is applied now and it is being generated from the BASE_URL environment variable and it defaults to localhost:3000 if not specified. This property is required since 2.5.7.

Parts of the app had to be refactored. The cacheControl theme helper is not available anymore.

Related Issue

Motivation and Context

How Has This Been Tested?

Tested by performing a checkout pass.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@@ -189,6 +188,7 @@ export default {
{ code: 'USD', label: 'Dollar' },
{ code: 'EUR', label: 'Euro' }
],
backendUrl: process.env.BACKEND_URL
backendUrl: process.env.BACKEND_URL,
middlewareUrl: 'http://localhost:3000/api/'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this used? It looks a bit tricky, we should at least use an env variable here + do some reasonable fallback

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's one of the breaking changes - see here. Basically storefront expects this url now in the nuxt config instead of computing it on its own. We already use env variables for the middleware server config in the same file so we can do the same here:

server: {
  port: process.env.PORT || 3000,
  host: process.env.HOST || '0.0.0.0'
}

But first I want to make it work :)

@fpdrozd
Copy link
Contributor Author

fpdrozd commented Mar 20, 2023

FYI, I resolved the error by bringing back the @vue-storefront/middleware/nuxt to the nuxt.config.js.

You need to remove the Server Middleware module from the nuxt.config.js and configure the domain your middleware is using.

// nuxt.config.js
export default {
  modules: [
-    '@vue-storefront/middleware/nuxt'
  ],
+  publicRuntimeConfig: {
+    middlewareUrl: 'http://localhost:3000/api/'
+  }
}

Out of context it looked like an upgrade instruction attached to the PR with that change.

@fpdrozd fpdrozd force-pushed the feat/update-storefront-2.5.7 branch from 39903b7 to 515ce7e Compare March 20, 2023 15:28
@fpdrozd fpdrozd marked this pull request as ready for review March 21, 2023 08:35
@fpdrozd fpdrozd requested a review from rafalcymerys March 21, 2023 08:35
@rafalcymerys rafalcymerys merged commit 8e67818 into vuestorefront-community:main Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants