Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[SyliusCon 2023] Event-driven layouts with Twig...

[SyliusCon 2023] Event-driven layouts with Twig Events

Jacob Tobiasz

November 03, 2023
Tweet

More Decks by Jacob Tobiasz

Other Decks in Programming

Transcript

  1. About me • Core Team Member @ Sylius • Technical

    Content Creator • I connect the backend and the frontend worlds 3
  2. YAML config 18 • It’s easy to fi nd an

    event or a block by name • Indentation increases readability
  3. YAML config 18 • It’s easy to fi nd an

    event or a block by name • Indentation increases readability • However…
  4. YAML config 18 • It’s easy to fi nd an

    event or a block by name • Indentation increases readability • However… • We don’t see what events are rendered inside the blocks without opening them
  5. YAML config 18 • It’s easy to fi nd an

    event or a block by name • Indentation increases readability • However… • We don’t see what events are rendered inside the blocks without opening them • Long con fi g fi les = jumping
  6. YAML config 18 • It’s easy to fi nd an

    event or a block by name • Indentation increases readability • However… • We don’t see what events are rendered inside the blocks without opening them • Long con fi g fi les = jumping
  7. YAML config 18 • It’s easy to fi nd an

    event or a block by name • Indentation increases readability • However… • We don’t see what events are rendered inside the blocks without opening them • Long con fi g fi les = jumping
  8. Browser dev tools 20 • It’s easy to fi nd

    an event or a block by name
  9. Browser dev tools 20 • It’s easy to fi nd

    an event or a block by name • Pretty to easy to fi nd descendant elements
  10. Browser dev tools 20 • It’s easy to fi nd

    an event or a block by name • Pretty to easy to fi nd descendant elements • However…
  11. Browser dev tools 20 • It’s easy to fi nd

    an event or a block by name • Pretty to easy to fi nd descendant elements • However… • Complex events blocks decrease readability
  12. Browser dev tools 20 • It’s easy to fi nd

    an event or a block by name • Pretty to easy to fi nd descendant elements • However… • Complex events blocks decrease readability
  13. Browser dev tools 20 • It’s easy to fi nd

    an event or a block by name • Pretty to easy to fi nd descendant elements • However… • Complex events blocks decrease readability
  14. Rule of thumb If a piece of HTML can be

    moved in an X or an Y axis (and still makes sense) it’s a candidate for an event block
  15. Rule of thumb If a piece of HTML can be

    moved in an X or an Y axis (and still makes sense) it’s a candidate for an event block
  16. Rule of thumb If a piece of HTML can be

    moved in an X or an Y axis (and still makes sense) it’s a candidate for an event block
  17. Rule of thumb If a piece of HTML can be

    moved in an X or an Y axis (and still makes sense) it’s a candidate for an event block
  18. Rule of thumb If a piece of HTML can be

    moved in an X or an Y axis (and still makes sense) it’s a candidate for an event block
  19. Rule of thumb If a piece of HTML can be

    moved in an X or an Y axis (and still makes sense) it’s a candidate for an event block
  20. Rule of thumb If a piece of HTML can be

    moved in an X or an Y axis (and still makes sense) it’s a candidate for an event block
  21. Rule of thumb If a piece of HTML can be

    moved in an X or an Y axis (and still makes sense) it’s a candidate for an event block
  22. Rule of thumb If a piece of HTML can be

    moved in an X or an Y axis (and still makes sense) it’s a candidate for an event block
  23. Rule of thumb If a piece of HTML can be

    moved in an X or an Y axis (and still makes sense) it’s a candidate for an event block
  24. Twig Events - key features 77 • Sylius-agnostic • Compatible

    with Symfony 5.4 and newer • Improved debug tools
  25. Twig Events - key features 77 • Sylius-agnostic • Compatible

    with Symfony 5.4 and newer • Improved debug tools • New features like support for Twig/Live Components
  26. Twig Events - key features 77 • Sylius-agnostic • Compatible

    with Symfony 5.4 and newer • Improved debug tools • New features like support for Twig/Live Components • New documentation (both “agnostic” and for Sylius)
  27. Twig Events - key features 77 • Sylius-agnostic • Compatible

    with Symfony 5.4 and newer • Improved debug tools • New features like support for Twig/Live Components • New documentation (both “agnostic” and for Sylius) • … and many more 😎