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!: override components and composables #452

Merged
merged 36 commits into from Nov 27, 2023
Merged

Conversation

patzick
Copy link
Collaborator

@patzick patzick commented Nov 6, 2023

List of changes

Info: signature breaking change: means that these changes might be breaking and require some migration steps on the project side

  • changed composables and cms-base packages from nuxt modules to nuxt layers - up to discussion if we want to introduce it as separate packages not to have breaking chane. Braking change would be very minor - 2 lines in nuxt config file.
  • changed composables package to export layer module with nuxt.config.ts as main file, built version with no possibility to override) is accessible under /dist for now (added as discussion point below)
  • breaking change: imports now are available under #imports with all dynamic
  • breaking change: types are now imported in a matter that can be overriden as well
  • possibility to override API types

PR changes to finish

  • add migration step to template changelogs
    • changing direct imports to import {} from "#imports"
    • changing types imports to import type { Schemas } from "#shopware"
  • replace types definitions with imports from #shopware to ensure that types comes from API, add deprecation message on types in types package. This can help avoid breaking change and allow for smoother transition towards new types definitions
  • improve importing types from composables package, currently it’s import type { SliderElementConfig } from "@shopware-pwa/composables-next/composables";
  • expose _useContext composable as useContext in package

Issues to create after this PR

  • address openAPI schema TODOs and create issues + generator fixes for them until resolved
  • adding more examples on how to manually override API types
  • rewrite helpers to use generic types instead of types
  • track all types package usage and progress with deprecation and removal process
  • prepare template for comsposable unit testing
  • guide to create types from custom instance and override them manually

Things to consider and decide

  • move composables and cms to layers, do we still need nuxt module?
    • might still be useful for example for devtools
  • check if plugins by default could be used inside layers and override it inside project if needed
  • imports for builded version (currently work version) /composables/**dist**
    • experiment with other possibilities for exports
    • consider another package for build package (no overrides)

Copy link

vercel bot commented Nov 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
frontends-demo ✅ Ready (Inspect) Visit Preview Nov 27, 2023 8:42pm
shopware-frontends-docs ✅ Ready (Inspect) Visit Preview Nov 27, 2023 8:42pm

@patzick patzick changed the title feat!: overwrite components and composables feat!: override components and composables Nov 14, 2023
patzick and others added 2 commits November 15, 2023 10:53
Co-authored-by: Maciek Kucmus <mkucmus@users.noreply.github.com>
@patzick patzick marked this pull request as ready for review November 27, 2023 14:52
Copy link
Collaborator

@mkucmus mkucmus left a comment

Choose a reason for hiding this comment

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

like a christmas gift 🎅

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.

None yet

3 participants