Skip to content

Roadmap ​

WARNING

Single File Component (SFC) support for Administration extensions is experimental. It is available since Shopware 6.7.16.0. The APIs described on this page can still change without a deprecation. Try it out and tell us what you find, but do not ship an extension built on it to customers or to the Shopware Store until the API is declared stable (planned for 6.9).

Where the Single File Component extension system stands: what you can build with it today, what is still being worked on, and where to tell us when something does not fit.

What experimental means here ​

The system is available since Shopware 6.7.16.0. There is no feature flag to enable and nothing to opt into - a .vue file in your plugin is compiled by the extension build as it is.

Experimental means the API can still change, at any time and without a deprecation. The plan is for it to become a stable, deprecation-protected API in 6.9. How much it still has to change depends on what you run into and on how the Administration's own migration goes.

Until the API is declared stable, an SFC extension written today may need changes with every Shopware update.

Timeline ​

WhenWhat happens
6.7.16The extension system is available, and experimental.
6.8The Administration's @private components, which are not part of the public extension contract, are converted and run in production for the first time.
6.9Planned: the extension system becomes a stable API, and a first handful of public components are converted with it.
LaterThe remaining components follow. The shims keep working for a while after that.

Most of the work is converting the Administration's own components, and that is why the experimental phase lasts as long as it does: every converted component can break an existing extension, and those breaks should surface during the experimental phase rather than after the API is declared stable.

What is supported today ​

Vue's own macros ​

Base components compile as ordinary <script setup>, so Vue's macros behave as they do in any Vue 3 project. An override has no props or emits of its own, and reaches the overridden component's through the override composables instead.

MacroBaseOverride
defineProps(), withDefaults()✅useSwProps() instead
defineEmits(), defineSlots(), defineOptions()✅useSwContext() instead
defineExpose()❌ generated from swDefinePublic()❌
defineModel()❌❌

Blocks ​

FeatureSupported
<sw-block name="..."> to declare an extension point✅
<sw-block extends="..."> to contribute to one✅
<sw-block-parent /> to render the previous content of the chain✅
Several plugins extending the same block✅

Reaching the component you override ​

FeatureSupported
useSwPreviousState(), useSwProps(), useSwContext()✅
Replacing a binding with swDefineOverride()✅
Writing to the previous stateRead only; replace a binding with swDefineOverride() instead
Overriding a propProps are always declared by the base component

Alongside Twig ​

Both directions work, so a converted component and an unconverted one extend the same way from the outside. Coverage is not complete, though: the shims handle the shapes components actually use, and an unusual one can still fall through.

What you writeWhat it extendsSupported
A .vue overrideA component that still ships a Twig template and an Options API configuration⚠️ in most cases
A Twig overrideA component that has been converted to a Single File Component⚠️ in most cases

Tooling ​

FeatureSupported
Type checking and editor support through the extension tooling✅
Build-time validation, in the build and in your editor✅
Importing stores, utilities, mixins and DAL helpers through shopware:*✅
Testing an SFC extension❌ not yet
A codemod that converts a component for you❌ not yet

Composables replacing mixins ​

A Single File Component cannot use a mixin, so the mixins a plugin is likely to use are getting a composable counterpart:

MixinComposable
cart-notification❌ being worked on
cms-element✅ useCmsElement()
cms-state✅ useCmsState()
discard-detail-page-changes❌ being worked on
generic-condition❌ being worked on
listing✅ useListing()
media-grid-listener✅ useMediaGridListener()
media-sidebar-modal-mixin✅ useMediaSidebarModal()
notification✅ useNotification()
notification-translation✅ useNotificationTranslation()
placeholder✅ usePlaceholder()
position✅ usePosition()
remove-api-error❌ being worked on
rule-between-operator✅ useRuleBetweenOperator()
ruleContainer✅ useRuleContainer()
salutation✅ useSalutation()
sw-extension-error❌ being worked on
sw-form-field❌ being worked on
sw-inline-snippet✅ useInlineSnippet()
translate-with-fallback✅ useTranslateWithFallback()
user-settings✅ useUserSettings()
validation✅ useValidation()
video-cover✅ useVideoCover()

Until a composable lands, a component that needs its mixin stays on the Options API. And nothing is taken away when one arrives: an Options API component keeps using the mixin it always used.

The Twig shims ​

The two directions above work through shims. They stay while the Administration's components are being converted. Like the rest of the system they are experimental, and their removal will be announced on this roadmap.

The migration codemod ​

A codemod that converts an Options API component into a Single File Component is under development. It is meant for plugin developers too, not only for the Administration's own components.

Give us feedback ​

Tell us what you tried to extend and where the system got in your way, what an API made awkward, and what you could not do at all.

Share your feedback in the GitHub discussion on Single File Components.

If you have a reproducible defect, open an issue on shopware/shopware and start the title with [Admin SFC].

Was this page helpful?
UnsatisfiedSatisfied
Be the first to vote!
0.0 / 5  (0 votes)