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

Dive Into Symfony 4

Dive Into Symfony 4

Symfony 4 is all about making the developer life easier. You liked using SF for large and robust apps, you'll love using it for your next MVP, prototype or small project.

Kévin Dunglas

June 22, 2017

More Decks by Kévin Dunglas

Other Decks in Programming


  1. Dive Into Symfony 4

  2. Kévin Dunglas •Founder of Les-Tilleuls.coop •Symfony Core Team •API Platform

    Creator @dunglas
  3. Les-Tilleuls.coop •Self-managed company since 2011 •100% owned by employees •All

    benefits are equitably shared between employees •21 people, 97% growth in 2016 •We are hiring! => jobs@les-tilleuls.coop
  4. Symfony 4?

  5. Roadmap

  6. Don’t worry! It’s almost ready… and you can try it

  7. BC Promise and Upgrade Path •Released at the same time

    than Symfony 3.4 •SF 3.4 is compatible with SF 3.0:
 BC layer + deprecation notices •SF 4 = SF 3.4, without the BC layer •SF 3.4 is a LTS
  8. Symfony Flex

  9. Symfony Flex •A new installer for Symfony •It also installs

    and configures bundles and libs •One goal: improve the overall Symfony DX •It’s a Composer plugin •Designed and developed by Fabien Potencier
  10. Create a New Project …

  11. Microframework by Default

  12. Minimal Deps, PHP 7.1

  13. None
  14. You Want to Use Docker? dunglas/

  15. Simplified Directory Structure ;
 No More AppBundle!

  16. Microkernel, in src/

  17. 12-Factor Apps and Env Vars Good bye `parameters.yml`!

  18. Cherry-pick what you Need

  19. Bundles Autoregistration and Config

  20. Appropriate Files
 and Dir are Created
 Packages can also

  21. It’s Time to Learn Make Again

  22. None
  23. Install and Configure Curated Packages •composer req orm => Doctrine

    ORM •composer req api => API Platform •composer req admin => EasyAdminBundle •composer req jwt-auth => LexikJWTAuthenticationBundle
  24. Autowiring

  25. 0-config: Autowiring Everywhere

  26. Symfony 4 and Autowiring •On by default •Service ID =

    class name •Detects and registers automatically app’s classes as services •Autoconfigures known class (= autowire + add tags)
 ex: event subscriber, validation constraint, twig ext… •Supports named arguments (App\Foo: {$arg: ‘hello’}) •Uses PSR-11
  27. Webpack Encore

  28. Webpack Encore •A modern and easy way to manage assets

    •Built on top of Webpack •Babel support (welcome ES200*) •Written in JS •Created by Ryan Weaver
  29. Install yarn add
 @symfony/webpack-encore babel-cli babel-preset-env babel-preset-es2017 --dev

  30. A Basic Config File (ES2017)

  31. The Related Template

  32. Questions? Thanks! github.com/dunglas @dunglas