shopware: Child theme inheritance is very slow

Description
Today I have discovered a potential issue. After 15-20 hours research (no joke) in the previous months, I have finally found a way to create a child theme from a premium theme (Orion Theme in my case). This discussion helped me a lot and shows how to do this (language is german): https://forum.shopware.com/discussion/68431/child-theme-vererbung-tut-nicht

However, if I install my child theme, every page load takes about 5 minutes to complete! My child theme does not contain any twig templates, only the base.scss, overrides.scss & main.js files, which are completely empty.

If I change the theme back to the parent theme, everything is loading normally. It seems like the theme inheritance with a depth of 3 or more causes huge performance problems.

Here is my theme.json:

{
    "name": "CrehlerOrionChild",
    "author": "Child",
    "views": [
        "@Storefront",
        "@Plugins",
        "@CrehlerOrion",
        "@CrehlerOrionChild"
    ],
    "style": [
        "app/storefront/src/scss/overrides.scss",
        "@CrehlerOrion",
        "app/storefront/src/scss/base.scss"
    ],
    "script": [
        "@CrehlerOrion",
        "app/storefront/dist/storefront/js/crehler-orion-child.js"
    ],
    "asset": [
        "@CrehlerOrion",
        "app/storefront/src/assets"
    ],
    "config": {
         // Complete copy of all options from the parent theme
    }
}

Here my base plugin:

<?php declare(strict_types=1);

namespace CrehlerOrionChild;

use Shopware\Core\Framework\Plugin;
use Shopware\Storefront\Framework\ThemeInterface;

class CrehlerOrionChild extends Plugin implements ThemeInterface
{
    /**
     * @since 1.0.0
     *
     * @inheritdoc
     */
    public function getStorefrontScriptPath(): string
    {
        return 'Resources/dist/storefront/js';
    }
}

Does anyone have the same problem?

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 19 (2 by maintainers)

Most upvoted comments

This is the theme.json we use for a child’s child theme;

{
    "name": "OurTheme",
    "views": [
        "@Storefront",
        "@3rdPartyTheme",
        "@OurTheme"
    ],
    "style": [
        "@Storefront",
        "app/storefront/src/scss/overrides.scss",
        "@3rdPartyTheme",
        "app/storefront/src/scss/base.scss"
    ],
    "script": [
        "@Storefront",
        "@3rdPartyTheme",
        "app/storefront/dist/storefront/js/our-theme.js"
    ],
    "asset": [
        "@Storefront",
        "@3rdPartyTheme",
        "app/storefront/src/assets"
    ]
}

Seems to work fine, except for database config inheritance.