vue-storefront
vue-storefront copied to clipboard
feat!: make on create an async function
Description
The goal of this task was to make the onCreate an async function. To achieve that we must introduce BC change. The most intrusive change is that theapiClientFactory also becomes an async function.
Because the onCreate function is strongly coupled with the factory and lifecycles, there is no other way to make it an async function but to make the whole creation process asynchronous.
As a migration step, all onCreate functions in index.server.ts in all integrations must be updated to the async function. This is a huge change and will have an impact on all integrations.
Motivation and Context
How Has This Been Tested?
I tested that for the Magento integration. Once the onCreate function was updated to the async function build and app started to work properly as before without any noticeable bugs or problems.
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [x] I have read the CONTRIBUTING document.
Changelog
- [x] I have updated the Changelog (V1) v2 and mentioned all breaking changes in the public API.
- [x] I have documented all new public APIs and made changes to existing docs mentioning the parts I've changed so they're up to date.
Tests
- [ ] I have written test cases for my code
- [x] I have tested my Pull Request on production build and (to my knowledge) it works without any issues
- [ ] I have added tests to cover my changes.
- [x] All new and existing tests passed.
I tested manually my code, and it works well with both:
- [x] Default Theme
- [ ] Capybara Theme
Code standards
- [ ] My code follows the code style of this project.
- [ ] I have followed naming conventions
Docs
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.