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

[TwigHooks] Implement autoprefixing feature #4

Merged
merged 3 commits into from
Apr 23, 2024

Conversation

jakubtobiasz
Copy link
Contributor

This PR introduces the autoprefixing feature. Previously we were forced to pass the whole hook name while declaring it. From now, we can

a) pass a magic _prefixes variable along with the hook context (!)

{% hook 'base' with {
    _prefixes: ['app', 'sylius_twig_hooks']
} %}

b) automatically resolve the prefixes passed with the HookableMetadata and prefix the short hook name.

{# considering there are `app.index, twig_hooks.index` prefixes in the metadata object #}

{% hook 'content' %} 

{# will produce app.index.content and twig_hooks.index.content keeping the order of prefixes #}

This feature will be documented more detailed later.

@jakubtobiasz jakubtobiasz added twig hooks Issues and Pull Requests related to Twig Hooks feature labels Apr 23, 2024
@jakubtobiasz jakubtobiasz merged commit 8561ae8 into main Apr 23, 2024
13 checks passed
@jakubtobiasz jakubtobiasz deleted the feature/autoprefixing branch April 23, 2024 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature twig hooks Issues and Pull Requests related to Twig Hooks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant