Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Why Puli?
Search
Titouan Galopin
January 27, 2016
Programming
0
110
Why Puli?
What is Puli? How can I use it in my application? Why is it the "next package revolution of PHP"?
Titouan Galopin
January 27, 2016
Tweet
Share
More Decks by Titouan Galopin
See All by Titouan Galopin
Concevoir son API pour le futur
tgalopin
2
1.6k
Content editing in Symfony
tgalopin
3
1k
Symfony UX: a new JavaScript ecosystem for Symfony
tgalopin
4
4.1k
[SymfonyLive Paris 2020] Pragmatic frontend for Symfony developers
tgalopin
2
1.2k
SymfonyInsight: How to setup quality processes in Symfony apps
tgalopin
2
390
Symfony 5 - AFUP Day Lille 2020
tgalopin
1
960
Pragmatic frontend for Symfony developers
tgalopin
2
1.2k
Demystifying React for Symfony developers
tgalopin
3
790
Symfony 5
tgalopin
1
710
Other Decks in Programming
See All in Programming
git worktree × Claude Code × MCP ~生成AI時代の並列開発フロー~
hisuzuya
1
550
GraphRAGの仕組みまるわかり
tosuri13
8
530
AI時代のソフトウェア開発を考える(2025/07版) / Agentic Software Engineering Findy 2025-07 Edition
twada
PRO
76
25k
AIエージェントはこう育てる - GitHub Copilot Agentとチームの共進化サイクル
koboriakira
0
510
すべてのコンテキストを、 ユーザー価値に変える
applism118
3
1.2k
Hypervel - A Coroutine Framework for Laravel Artisans
albertcht
1
110
新メンバーも今日から大活躍!SREが支えるスケールし続ける組織のオンボーディング
honmarkhunt
4
6.5k
ペアプロ × 生成AI 現場での実践と課題について / generative-ai-in-pair-programming
codmoninc
1
16k
関数型まつりレポート for JuliaTokai #22
antimon2
0
160
WebViewの現在地 - SwiftUI時代のWebKit - / The Current State Of WebView
marcy731
0
110
A2A プロトコルを試してみる
azukiazusa1
2
1.3k
初学者でも今すぐできる、Claude Codeの生産性を10倍上げるTips
s4yuba
16
11k
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
How GitHub (no longer) Works
holman
314
140k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
Producing Creativity
orderedlist
PRO
346
40k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
730
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.4k
Transcript
Why Puli? Titouan Galopin SensioLabs University 1
About Titouan Galopin Puli core contributor puli.js lead developer @tgalopin
// titouangalopin.com 2
Why this talk? 3
Agenda I. What’s Puli? II. How to use Puli in
your application? III. Status of Puli and what’s coming in 2016 4
I. What’s Puli? 5
Currently in Packagist Libraries Symfony bundles Drupal modules Zend Framework
modules Laravel packages What’s Puli? 6
All framework extensions do the same things What’s Puli? 7
Ideal world Libraries ✓ Symfony bundles Drupal modules Zend Framework
modules Laravel packages What’s Puli? 8
Why do we need framework extensions? What’s Puli? 9
What’s Puli? Application FOSUserBundle login.html.twig To simplify access to resources
Before: return $this->render( __DIR__ . ‘/../../vendor/ friendsofsymfony/user- bundle/Resources/views/Security/index.html. twig’ ); After: return $this->render( ‘FOSUserBundle:Security:login.html.twig’ ); 10
What’s Puli? Application translator FOSUserBundle messages.fr.xlst To autoload specialized files
/FOS /UserBundle /Command /ActivateUserCommand.php <= /Controller /DependencyInjection /FOSUserBundleExtension.php <= /Resources /translations /messages.en.xlst <= /messages.fr.xlst <= /... 11
What’s Puli? To publish assets /web/bundles/fos-user-bundle /css /style.css /images /image.png
/vendor/.../FOS/UserBundle /Resources /public /css /style.css /images /image.png 12
Puli replaces framework extensions by solving these 3 problems What’s
Puli? 13
Three targets : Libraries developers Frameworks developers Applications developers What’s
Puli? 14
Library developers A single config file and your library is
available for everyone What’s Puli? 15
Frameworks developers Stop wasting efforts by reinventing the wheel What’s
Puli? 16
Application developers Puli is usable in your application! What’s Puli?
17
II. How to use Puli in your application? 18
How to use Puli in your application? 19 Puli CLI
vs puli.json
How to use Puli in your application? 20 puli.json /app
/src /vendor /web /composer.json /puli.json
How to use Puli in your application? 21 Simplify access
to resources
How to use Puli in your application? 22 // puli.json
{ "resources": { "/app": "app/Resources", "/custom-library": "vendor/..." } } Simplify access to resources
How to use Puli in your application? 23 require ‘vendor/autoload.php’;
$puliClass = PULI_FACTORY_CLASS; $puli = new $puliClass(); $repo = $puli->createRepository(); Simplify access to resources
How to use Puli in your application? 24 echo $repo->get('/app/views/index.html.twig')
->getBody(); echo $repo->get('/app/views/index.html.twig') ->getFilesystemPath(); echo $repo->get('/custom-library'. .'/views/index.html.twig') ->getFilesystemPath(); Simplify access to resources
meh. How to use Puli in your application? 25
puli/composer-plugin How to use Puli in your application? 26
Let library developers create their puli.json How to use Puli
in your application? 27
How to use Puli in your application? 28 // /vendor/acme/custom-library/puli.json
{ "resources": { "/views": "views", ... } } Simplify access to resources
How to use Puli in your application? 29 $ composer
require acme/custom-library Updating dependencies (including require-dev) - Installing acme/custom-library (1.0.0) Downloading: 100% Synchronizing Puli with Composer Installing acme/custom-library Deleting the ".puli" directory Running "puli build" Simplify access to resources
How to use Puli in your application? 30 echo $repo->get('/acme/custom-library'.
.'/views/index.html.twig') ->getFilesystemPath(); Simplify access to resources
How to use Puli in your application? 31 Autoload specialized
files
How to use Puli in your application? 32 // your
app puli.json { "resources": { "/app": "app", "/res": "app/Resources" }, "provide": { "/app/config/services.yml": "symfony/services", "/res/translations/*.yml": "symfony/translations" } } Autoload specialized files Defined by Symfony to load your files using Puli $discovery->findBindings('...')
How to use Puli in your application? 33 // /vendor/acme/custom-library/puli.json
{ "resources": { "/config": "res/config", "/translations": "res/translations" }, "provide": { "/config/symfony-services.yml": "symfony/services", "/config/pimple-services.yml": "pimple/services", "/config/php-di-services.yml": "php-di/services", "/translations/*.xlst": "php-fig/xlst-translations" } } Autoload specialized files Usable by libraries! Binding are not necessarily used by the “consumer”
How to use Puli in your application? 34 $ composer
require acme/custom-library => Services available in your container => Translations available in your translator => Doctrine entities, Twig extensions, ... Autoload specialized files Plug’n’Play (even more than bundles!)
How to use Puli in your application? 35 Publish assets
How to use Puli in your application? 36 Coming in
2016: puli.js JS library to resolve Puli path in filesystem paths Publish assets
How to use Puli in your application? 37 // gulpfile.babel.js
gulp.task('babel', () => gulp.src(puli.paths('/app/**/*.jsx') .pipe(babel()) .pipe(ulgify()) .pipe(header('(c) SensioLabs')) .pipe(gulp.dest('web/built/min.js')) ); Publish assets
Let’s resume Why Puli is the future of PHP packages
38
Puli is for libraries developers 39 Let’s resume
40 Less community fragmentation Let’s resume
One library to rule them all Develop for every framework
at the same time: single codebase 41 Let’s resume
Puli is for framework developers 42 Let’s resume
Don’t reinvent the wheel, use Puli puli/repository puli/manager puli/discovery 43
Let’s resume
Puli is for applications developers 44 Let’s resume
Remove framework extensions complexity Install Twig Bundle/Extension/Module Install Twig 45
Let’s resume
Plug’n’Play packages composer require => ready to use 46 Let’s
resume
Less Magic Everything is configured 47 Let’s resume
Easy to extend Add your own bindings, your own resources,
... 48 Let’s resume
Powerful features Overriding, Versioning, Symbolic links, ... 49 Let’s resume
Integrate in your development process Composer, puli.js 50 Let’s resume
III. Status of Puli and what’s coming in 2016 51
1.0.0-beta10 52 Status of Puli and what’s coming in 2016
Already used in production 53 Status of Puli and what’s
coming in 2016
Documentation on docs.puli.io 54 Status of Puli and what’s coming
in 2016
Working Symfony bundle puli/symfony-bundle 55 Status of Puli and what’s
coming in 2016
Projects working on a Puli integration out of the box
56 Status of Puli and what’s coming in 2016
Get involved! github.com/puli/issues 57 Status of Puli and what’s coming
in 2016
Questions? 58 Titouan Galopin SensioLabs University