Slide 1

Slide 1 text

Les-Tilleuls.coop Symfony 4 Run-through

Slide 2

Slide 2 text

Les-Tilleuls.coop Kévin Dunglas ❏ ❏ ❏ @dunglas

Slide 3

Slide 3 text

Les-Tilleuls.coop Self-managed ⬆ ➡ Les-Tilleuls.coop

Slide 4

Slide 4 text

Les-Tilleuls.coop factory.football ⚽

Slide 5

Slide 5 text

Les-Tilleuls.coop

Slide 6

Slide 6 text

Les-Tilleuls.coop

Slide 7

Slide 7 text

Les-Tilleuls.coop Symfony 4 ⏰

Slide 8

Slide 8 text

Les-Tilleuls.coop hAmZAP

Slide 9

Slide 9 text

Les-Tilleuls.coop Symfony 3.4 and 4.0 3.4 ❏ ❏ ❏ ❏ 4.0 ❏ ❏ ❏ ❏

Slide 10

Slide 10 text

Les-Tilleuls.coop Install

Slide 11

Slide 11 text

Les-Tilleuls.coop Install Symfony 4 composer create-project \ -s beta \ # Default to Symfony 3 otherwise symfony/skeleton factory.football

Slide 12

Slide 12 text

Les-Tilleuls.coop

Slide 13

Slide 13 text

Les-Tilleuls.coop

Slide 14

Slide 14 text

Les-Tilleuls.coop The Symfony Skeleton ❏ composer.json ❏ ❏ ❏ ❏

Slide 15

Slide 15 text

Les-Tilleuls.coop

Slide 16

Slide 16 text

Les-Tilleuls.coop

Slide 17

Slide 17 text

Les-Tilleuls.coop Structure

Slide 18

Slide 18 text

Les-Tilleuls.coop

Slide 19

Slide 19 text

Les-Tilleuls.coop New structure ❏ ❏ App\ ❏ index.php app*.php ❏ ❏ ❏ .env parameter.yml ❏

Slide 20

Slide 20 text

Les-Tilleuls.coop Microframework means microkernel!

Slide 21

Slide 21 text

Les-Tilleuls.coop Symfony Flex

Slide 22

Slide 22 text

Les-Tilleuls.coop Symfony Flex ❏ ❏ ❏ ❏ ❏

Slide 23

Slide 23 text

Les-Tilleuls.coop Flex Recipes ❏ ❏ ❏ ❏ symfony/recipes ❏ symfony/recipes-contrib

Slide 24

Slide 24 text

Les-Tilleuls.coop

Slide 25

Slide 25 text

Les-Tilleuls.coop Example: Installing Twig

Slide 26

Slide 26 text

Les-Tilleuls.coop

Slide 27

Slide 27 text

Les-Tilleuls.coop

Slide 28

Slide 28 text

Les-Tilleuls.coop

Slide 29

Slide 29 text

Les-Tilleuls.coop More packages composer req \ serializer annotation orm

Slide 30

Slide 30 text

Les-Tilleuls.coop

Slide 31

Slide 31 text

Les-Tilleuls.coop DI and controllers

Slide 32

Slide 32 text

Les-Tilleuls.coop 0 config ❏ ➡ No more service config! ❏ ❏ ❏ ❏ ➡

Slide 33

Slide 33 text

Les-Tilleuls.coop Designed by @nicolasgrekas and me during last year #ForumPHP’s community drink

Slide 34

Slide 34 text

Les-Tilleuls.coop All you need is here A real-life controller

Slide 35

Slide 35 text

Les-Tilleuls.coop Automatic dependency injection ❏ ❏ ❏

Slide 36

Slide 36 text

Les-Tilleuls.coop Action injection

Slide 37

Slide 37 text

Les-Tilleuls.coop Symfony 2 style

Slide 38

Slide 38 text

Les-Tilleuls.coop Much more to say! ❏ ❏ ❏ ❏ ➡ ❏ App\Foo: {$arg: hello} ❏ ❏

Slide 39

Slide 39 text

Les-Tilleuls.coop You want more?

Slide 40

Slide 40 text

Les-Tilleuls.coop Cloud Native ☁

Slide 41

Slide 41 text

Les-Tilleuls.coop 12-factor app and env vars ❏ ❏ .env ❏ ❏ ❏ parameters.yml

Slide 42

Slide 42 text

Les-Tilleuls.coop Minimalist logger ❏ ❏ ❏ ❏

Slide 43

Slide 43 text

Les-Tilleuls.coop

Slide 44

Slide 44 text

Les-Tilleuls.coop Various improvements ❏ ❏ ❏

Slide 45

Slide 45 text

Les-Tilleuls.coop

Slide 46

Slide 46 text

Les-Tilleuls.coop Docker support

Slide 47

Slide 47 text

Les-Tilleuls.coop Docker support docker-compose up

Slide 48

Slide 48 text

Les-Tilleuls.coop

Slide 49

Slide 49 text

Les-Tilleuls.coop Docker support ❏ ❏ ❏ ❏ ❏ ❏

Slide 50

Slide 50 text

Les-Tilleuls.coop Symfony Encore

Slide 51

Slide 51 text

Les-Tilleuls.coop Webpack Encore ❏ ❏ ❏ ❏ ❏

Slide 52

Slide 52 text

Les-Tilleuls.coop Install composer req encore # Use Flex (not mandatory) yarn install # Alternatively: npm install

Slide 53

Slide 53 text

Les-Tilleuls.coop Easy configuration

Slide 54

Slide 54 text

Les-Tilleuls.coop For legacy apps...

Slide 55

Slide 55 text

Les-Tilleuls.coop Build # Dev (not minified) ./node_modules/.bin/encore env # Production (minified) ./node_modules/.bin/encore production

Slide 56

Slide 56 text

Les-Tilleuls.coop Include assets in the template

Slide 57

Slide 57 text

Les-Tilleuls.coop H2 Push & hints ⚡

Slide 58

Slide 58 text

Les-Tilleuls.coop Specifications W3C’s Preload ❏ ❏ W3C’s Resource Hints ❏

Slide 59

Slide 59 text

Les-Tilleuls.coop Install and usage composer req weblink

Slide 60

Slide 60 text

Les-Tilleuls.coop Result

Slide 61

Slide 61 text

Les-Tilleuls.coop

Slide 62

Slide 62 text

Les-Tilleuls.coop Official packages

Slide 63

Slide 63 text

Les-Tilleuls.coop So you want an admin? composer req admin # Install EasyAdminBundle, by @javiereguiluz

Slide 64

Slide 64 text

Les-Tilleuls.coop

Slide 65

Slide 65 text

Les-Tilleuls.coop What about an hypermedia API? composer req api # Install API Platform, by your humble servant

Slide 66

Slide 66 text

Les-Tilleuls.coop

Slide 67

Slide 67 text

Les-Tilleuls.coop Yes, it supports GraphQL!

Slide 68

Slide 68 text

Les-Tilleuls.coop joind.in/talk/2ac51 awards.symfony.com

Slide 69

Slide 69 text

Les-Tilleuls.coop @dunglas @coopTilleuls