Slide 1

Slide 1 text

SYMFONY 4.2 WHAT'S NEW? 1

Slide 2

Slide 2 text

Who am I? Tim Jabs Software Developer 
 @Sensiolabs Deutschland
 
 Twitter:
 @_Rubinum_ 2

Slide 3

Slide 3 text

3

Slide 4

Slide 4 text

4 Symfony 4.2

Slide 5

Slide 5 text

DEPRECATIONS !5

Slide 6

Slide 6 text

DEPRECATIONS !6

Slide 7

Slide 7 text

DEPRECATIONS !7 Deprecated template directory: old default:
 src/Resources/views/ new default:
 templates/ How can I change this?
 config/packages/twig.yaml
 twig.default_path

Slide 8

Slide 8 text

DEPRECATIONS !8 Deprecated the Kernel name and root dir: No more:
 KernelInterface::getName()/
 getRootDir() => getProjectDir()
 If you need a distinctive ID for the kernel: KernelInterface::getContainerClass()
 


Slide 9

Slide 9 text

DEPRECATIONS !9 Deprecated ContainerAwareCommand class: No more:
 ContainerAwareCommand Use:
 Command + dependency injection

Slide 10

Slide 10 text

DEPRECATIONS !10 Deprecated Controller Class: No more:
 Controller
 $this->get(FooClass::class) Use:
 AbstractController + dependency injection

Slide 11

Slide 11 text

DEPRECATIONS !11

Slide 12

Slide 12 text

DEPRECATIONS !12

Slide 13

Slide 13 text

DEPRECATIONS !13 Deprecated process input as string:

Slide 14

Slide 14 text

SIDE NOTE !14 before: after:

Slide 15

Slide 15 text

DEPRECATIONS !15 Deprecated tree builders without root nodes:

Slide 16

Slide 16 text

DEPRECATIONS !16 Take care! There are even more deprecations take this https://github.com/symfony/symfony/blob/4.2/ UPGRADE-4.2.md

Slide 17

Slide 17 text

NEW COMPONENT !17

Slide 18

Slide 18 text

NEW COMPONENT !18 VAREXPORTER

Slide 19

Slide 19 text

NEW COMPONENT !19 Example:
 export($data)

Slide 20

Slide 20 text

NEW COMPONENT !20

Slide 21

Slide 21 text

ENV FILE PER ENVIRONMENT !21

Slide 22

Slide 22 text

ENV FILE PER ENVIRONMENT !22 No More: .env.dist But: .env is part of of the repository now

Slide 23

Slide 23 text

ENV FILE PER ENVIRONMENT !23 before:
 .env after:
 .env
 .env.test
 .env.dev
 .env.dev.local

Slide 24

Slide 24 text

ENV FILE PER ENVIRONMENT !24 //.env DATABASE_URL: …
 DATABASE_URL_TEST: …
 DATABASE_URL_TEST_LOCAL: …

Slide 25

Slide 25 text

TRANSLATION RELATED IMPROVEMENTS !25

Slide 26

Slide 26 text

TRANSLATION RELATED IMPROVEMENTS !26 before:

Slide 27

Slide 27 text

TRANSLATION RELATED IMPROVEMENTS !27 after:

Slide 28

Slide 28 text

TRANSLATION RELATED IMPROVEMENTS !28 ICU parent locales as fallback: Example:
 
 before:
 es_AR => es
 after:
 es_AR => es_419 => es

Slide 29

Slide 29 text

TRANSLATION RELATED IMPROVEMENTS !29 Update XLF translations by default: before:
 bin/console translation:update // output default JSON after:
 bin/console translation:update // output default XLF

Slide 30

Slide 30 text

TRANSLATION RELATED IMPROVEMENTS !30 Lint multiple XLIFF dirs or files: bin/console lint:xliff supports multiple directories now

Slide 31

Slide 31 text

AUTOWIRING BY TYPE AND NAME !31

Slide 32

Slide 32 text

AUTOWIRING BY TYPE AND NAME !32

Slide 33

Slide 33 text

AUTOWIRING BY TYPE AND NAME !33

Slide 34

Slide 34 text

CACHE STAMPEDE !34

Slide 35

Slide 35 text

CACHE STAMPEDE !35

Slide 36

Slide 36 text

CACHE STAMPEDE !36

Slide 37

Slide 37 text

CACHE STAMPEDE !37

Slide 38

Slide 38 text

SECURITY !38

Slide 39

Slide 39 text

SECURITY !39 Detailed security voters decisions

Slide 40

Slide 40 text

SECURITY !40 before:

Slide 41

Slide 41 text

SECURITY !41 after:

Slide 42

Slide 42 text

FORMS !42

Slide 43

Slide 43 text

FORMS !43 Clear form errors:

Slide 44

Slide 44 text

FORMS !44 Improved form type extension

Slide 45

Slide 45 text

FORMS !45 before: Improved form type extension

Slide 46

Slide 46 text

FORMS !46 before: Improved form type extension

Slide 47

Slide 47 text

FORMS !47 after: Improved form type extension

Slide 48

Slide 48 text

FORMS !48 Improved form type extension

Slide 49

Slide 49 text

DIVISIBLE CONSTRAINT !49

Slide 50

Slide 50 text

PDO-BASED LOCK !50

Slide 51

Slide 51 text

PDO-BASED LOCK !51

Slide 52

Slide 52 text

PDO-BASED LOCK !52

Slide 53

Slide 53 text

PDO-BASED LOCK !53

Slide 54

Slide 54 text

THANK YOU 54

Slide 55

Slide 55 text

BONUS 4.3 PREVIEW !55

Slide 56

Slide 56 text

CONSOLE HYPERLINKS !56

Slide 57

Slide 57 text

TWIG DEPRECATED TAG !57

Slide 58

Slide 58 text

CONTRIBUTE? 58 You want to be part of Symfony? Take a look: https://symfony.com/doc/current/contributing/ index.html

Slide 59

Slide 59 text

REFERENCES !59 Overview: 
 https://symfony.com/blog/symfony-4-2-curated-new-features Changelog: https://symfony.com/blog/symfony-4-2-0-beta1-released https://symfony.com/blog/symfony-4-2-0-beta2-released Translations: https://symfony.com/blog/new-in-symfony-4-2-translation-related-improvements https://symfony.com/blog/new-in-symfony-4-2-intlmessageformatter Deprecations: https://symfony.com/blog/new-in-symfony-4-2-important-deprecations Security: https://symfony.com/blog/new-in-symfony-4-2-samesite-cookie-configuration https://symfony.com/blog/new-in-symfony-4-2-auto-secure-cookies https://symfony.com/blog/new-in-symfony-4-2-detailed-security-voters-decisions

Slide 60

Slide 60 text

REFERENCES !60 Forms: https://symfony.com/blog/new-in-symfony-4-2-clear-form-errors https://symfony.com/blog/new-in-symfony-4-2-improved-form-type-extensions Misc: https://symfony.com/blog/new-in-symfony-4-2-cache-stampede-protection https://symfony.com/blog/new-in-symfony-4-2-divisibleby-constraint https://symfony.com/blog/new-in-symfony-4-2-addlink-shortcut https://symfony.com/blog/new-in-symfony-4-2-define-env-vars-per-environment https://symfony.com/blog/new-in-symfony-4-2-acceptable-request-formats https://symfony.com/blog/new-in-symfony-4-2-simpler-custom-serialized-names https://symfony.com/blog/new-in-symfony-4-2-wait-until-processes-are-ready https://symfony.com/blog/new-in-symfony-4-2-varexporter-component https://symfony.com/blog/new-in-symfony-4-2-console-tables-improvements https://symfony.com/blog/new-in-symfony-4-2-pdo-based-lock-storage https://symfony.com/blog/new-in-symfony-4-2-autowiring-by-type-and-name https://symfony.com/blog/new-in-symfony-4-2-simpler-functional-tests https://symfony.com/doc/current/configuration/dot-env-changes.html