VOOZH
about
URL: https://speakerdeck.com/desandro/bower-introduction
⇱ Bower introduction - Speaker Deck
Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
👁 Speaker Deck
Speaker Deck
👁 Speaker Deck
Bower introduction
Sponsored
·
👁 Image
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
👁 Avatar for David DeSandro
David DeSandro
October 12, 2013
Programming
1.3k
2
Share
Embed
Bower introduction
What is Bower, why use it, and how I've been using it. Presented at ConvergeSE Richmond
👁 Avatar for David DeSandro
David DeSandro
October 12, 2013
More Decks by David DeSandro
See All by David DeSandro
Read color hex codes
👁 Avatar for David DeSandro
desandro
3
68k
Practical UI physics
👁 Avatar for David DeSandro
desandro
3
1.6k
Other Decks in Programming
See All in Programming
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
👁 Avatar for tk3fftk
tk3fftk
5
890
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
👁 Avatar for nrs
nrslib
0
290
AI 輔助遺留系統現代化的經驗分享
👁 Avatar for James Wang
jame2408
1
840
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
👁 Avatar for snhryt
snhryt
0
170
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
👁 Avatar for Manfred Steyer
manfredsteyer
PRO
0
110
キャリア迷子上等 ─ "ない道"は自分で作ればいい
👁 Avatar for 16bit_idol
16bitidol
3
2.2k
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
👁 Avatar for nrs
nrslib
4
1.4k
The ROI of Quarkus for Spring Boot Applications
👁 Avatar for Holly Cummins
hollycummins
0
120
Contextとはなにか
👁 Avatar for chiroruxx
chiroruxx
1
350
Claspは野良GASの夢をみるか
👁 Avatar for てらうちたかし
takter00
0
200
RTSPクライアントを自作してみた話
👁 Avatar for simotin13
simotin13
0
620
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
👁 Avatar for MinoDriven
minodriven
21
6.8k
Featured
See All Featured
BBQ
👁 Avatar for Matthew Crist
matthewcrist
89
10k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
👁 Avatar for Aleyda Solis
aleyda
1
2k
Practical Orchestrator
👁 Avatar for Shlomi Noach
shlominoach
191
11k
The untapped power of vector embeddings
👁 Avatar for Frank van Dijk
frankvandijk
2
1.8k
Money Talks: Using Revenue to Get Sh*t Done
👁 Avatar for Nikki Halliwell
nikkihalliwell
0
250
Claude Code どこまでも/ Claude Code Everywhere
👁 Avatar for nwiizo
nwiizo
65
56k
Lightning talk: Run Django tests with GitHub Actions
👁 Avatar for Sarah Abderemane
sabderemane
0
200
Become a Pro
👁 Avatar for Speaker Deck
speakerdeck
PRO
31
6k
Improving Core Web Vitals using Speculation Rules API
👁 Avatar for Sergey Chernyshev
sergeychernyshev
21
1.5k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
👁 Avatar for Akihiro Kokubo
akihiro_kokubo
PRO
71
40k
How to Ace a Technical Interview
👁 Avatar for Jacob Kaplan-Moss
jacobian
281
24k
Designing Dashboards & Data Visualisations in Web Apps
👁 Avatar for Des Traynor
destraynor
231
55k
Transcript
Bower
We make websites
Lots of stuff Bootstrap Foundation normalize.css fitvid.js Modernizr d3 jQuery
Underscore / Lo-dash Backbone Angular JS Effeckt.css Masonry Font Awesome Compass H5BP jQuery UI Easing form gallery modal / popup tooltip base CSS helper JS
How do you get it? Download git clone Saved locally,
copy files
Where do you put it? lib/ lib/vendor/ assets/js/vendor, assets/css/vendor,
assets/*/vendor
How you keep track of it? Centralized server In git,
commit to repo git-submodules
Lots of stuff Bootstrap Foundation normalize.css fitvid.js Modernizr d3 jQuery
Underscore / Lo-dash Backbone Angular JS Effeckt.css Masonry Font Awesome Compass H5BP jQuery UI Easing form gallery modal / popup tooltip base CSS helper JS
None
Messy Desk Not enough space to do work Slow down
creative process Hard to collaborate Spend time cleaning desk
Package Management
Lots of stuff Bootstrap Foundation normalize.css fitvid.js Modernizr d3 jQuery
Underscore / Lo-dash Backbone Angular JS Effeckt.css Masonry Font Awesome Compass H5BP jQuery UI Easing form gallery modal / popup tooltip base CSS helper JS
Package Management
Problem Package management Solution Bower Reason Why use Bower Results
How I’ve done so far
What is Bower?
Bower A package manager for the web
What is Bower? Command-line utility Built on Node JS
Install packages bower install jquery
None
Install a version bower install jquery#1.x
None
Search packages bower search normalize
None
bower.json Manifest file Use same installation on another machine Collaboration
bower.json bower init
None
bower.json "dependencies": { "jquery": "1.x", "normalize-‐css":
"~2.1.3" }
bower install bootstrap
None
Installing dependencies Bower will install the package and its dependencies
!"# bootstrap#3.0.0 !"" jquery#2.0.3
Dependencies Powerful feature Build packages on top of one another
No longer have to depend on big frameworks
Lots of other great features --offline: Offline mode Read the
docs: bower.io
What Bower does Easily gets packages Keeps them organized Manages
dependencies
Problem Solution Reason Results Package management Bower Why use Bower
How I’ve done so far
Why Bower?
Package managers Volo git-submodules Jam Component Browserify (npm) Ender
Bower is special Unopinionated Provides no direct way to consume
packages Core part of its philosophy
Consuming packages <link />, <script /> SASS or preprocessor RequireJS
Grunt Your own build script
bower list -‐-‐paths { "bootstrap": [
"bower_components/bootstrap/dist/js/ bootstrap.js", "bower_components/bootstrap/dist/css/ bootstrap.css" ], "jquery": "bower_components/jquery/jquery.js", "normalize-‐css": "bower_components/normalize-‐ css/normalize.css" }
Unopinionated Choosing on behalf of anyone else Don’t lock your
users into a methodology
Using Bower Twitter: Flight Google: Yeoman, Angular jQuery
Problem Solution Reason Results Package management Bower Unopinionated How I’ve
done so far
Results
Isotope Masonry
Same problem with unloaded images
Masonry ! Isotope !
Masonry ! Isotope ! images Loaded images Loaded images Loaded
Masonry ! Isotope ! images Loaded images Loaded images Loaded
Maintaining one project in three places
Now with Bower No more committing other projects into yours
Keep them separated Bower allows easily add them as dependencies
Front-end development with dependencies
Developing with dependencies Removing duplicated code jquery-bridget get-size get-style-property doc-ready
eventie EventEmitter
Each dependency Its own repository Its own issue tracker Its
own tests Finer granularity over bigger projects
For example: masonry#417
masonry#417 Issue reported in Masonry Actual problem with getSize
getSize Fix cut new release (v1.1.5) Masonry bower update deploy
Masonry ! getSize Isotope ! Dragga- billy ...
Encapsulation Literal naïve definition: Make capsules Breaking down something large
into smaller pieces, easier to swallow
Encapsulation Like DRY, a principle of good programming Take and
apply it project-level
Encapsulation A new avenue of thinking No longer had to
keep mental model of entire library in my head Focus on small libraries with single purpose
Growing up Growing out of relying on monolithic frameworks Empowering
developers to make and distribute their own purpose- built components
packery-‐docs#1.0.0 $"" classie#1.0.0 $"# doc-‐ready#1.0.2 % !""
eventie#1.0.3 $"# draggabilly#1.0.6 % $"" classie#1.0.0 % $"" eventEmitter#4.2.4 % $"" eventie#1.0.3 % $"# get-‐size#1.1.4 % % !"" get-‐style-‐property#1.0.2 % !"" get-‐style-‐property#1.0.2 $"" eventie#1.0.3 $"" get-‐style-‐property#1.0.2 $"" jquery#1.10.2 $"" jquery-‐ui-‐draggable#1.10.3 $"" normalize-‐css#2.1.3 !"# packery#1.1.2
Problem Solution Reason Results Package management Bower Unopinionated Grow
How? How do you hook up Grunt tasks to Bower?
How do you split a project into multiple files? How do you make JS work with both RequireJS and <script />? How do you create concatenated source files, for easy <link />ing?
Why use Bower and not ______? Because Bower is unopinionated.
Why use Bower at all? Because building with dependencies
is how we will grow.
Thank you! I have stickers. Get in my van. –
@desandro