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
Modular JavaScript: FEL, Feb 2013
Search
Jack Franklin
February 28, 2013
Technology
0
80
Modular JavaScript: FEL, Feb 2013
Jack Franklin
February 28, 2013
Tweet
Share
More Decks by Jack Franklin
See All by Jack Franklin
Advanced React Meetup: Testing JavaScript
jackfranklin
1
170
Components on the Web: Frontend NE
jackfranklin
1
690
ReactiveConf: Lessons Migrating Complex Software
jackfranklin
0
390
Front Trends: Migrating complex software
jackfranklin
1
690
Migrating from Angular to React: Manc React
jackfranklin
1
130
Half Stack Fest: Webpack
jackfranklin
4
460
FullStackFest: Elm for JS Developers
jackfranklin
1
200
Codelicious: Intro to ES2015
jackfranklin
0
320
PolyConf: Elm for JS Developers
jackfranklin
0
250
Other Decks in Technology
See All in Technology
DevOpsメトリクスとアウトカムの接続にトライ!開発プロセスを通して計測できるメトリクスの活用方法
ham0215
2
240
複雑な構成要素を持つUIとの向き合い方 〜新・支出グラフでの実例〜 / B43 TECH TALK
nakamuuu
0
140
Meta Quest 3 で動く桜マシマシ WebXR アプリを IBM Cloud Code Engine と Babylon.js で作った話
1ftseabass
PRO
0
120
KubeConにproposalを送りたい人へのアドバイス
sat
PRO
3
250
20分で完全に理解するGrafanaダッシュボード
hamadakoji
3
620
一生覚えておきたい「システム開発=コミュニケーション」〜初めての実務案件振り返りLT〜
maimyyym
0
140
ChatworkのSRE部って実は 半分くらいPlatform Engineering部かもしれない
saramune
0
160
データベース02: データベースの概念
trycycle
0
160
Hands-on Gemini, the Google DeepMind LLM
meteatamel
1
110
サーバー間 GraphQL と webmock-graphql の話 / server-to-server graphql and webmock-graphql
qsona
2
190
FrontDoorとWebAppsを組み合わせた際のリダイレクト処理の注意点
kenichirokimura
1
520
Cloud Native Java with Spring Boot (CNCF Aarhus, April 2024)
thomasvitale
1
170
Featured
See All Featured
Visualization
eitanlees
136
14k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
Git: the NoSQL Database
bkeepers
PRO
422
63k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
40
4.4k
Fashionably flexible responsive web design (full day workshop)
malarkey
398
65k
Designing the Hi-DPI Web
ddemaree
276
33k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.6k
KATA
mclloyd
15
12k
Build your cross-platform service in a week with App Engine
jlugia
225
17k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
14
1.6k
StorybookのUI Testing Handbookを読んだ
zakiyama
13
4.6k
Writing Fast Ruby
sferik
621
60k
Transcript
Modular JavaScript @Jack_Franklin
First: An Apology...
Who is this guy? Author of "Beginning jQuery" Blogger at
javascriptplayground.com Developer for Kainos (JS & Ruby) Comp-Sci student at University of Bath
Book Giveaway! Tweet your most cringe-worthy, clean joke with the
hashtag #feljoke I'll pick two winners once I'm done talking.
The era of web applications
What is Modular Development?
Separation of Concerns
One Module One Concern
Loose Coupling
modules don't know about each other modules are independent modules
don't talk to each other directly so they need some way of communicating
Publish and Subscribe
Modules have no knowledge of each other Modules publish events
Modules subscribe to events Loosely coupled, more maintainable modules don't publish events to specific other modules, but just do it generally
JS Patterns JavaScript is really good!
The Module Pattern var APP = (function() { var _count
= 0; var incrementCount = function() { _count++; } var getCount = function() { return _count; } return { incrementCount: incrementCount, getCount: getCount }; })(); _count is kept private can only be manipulated through incrementCount
RequireJS
RequireJS Implements the AMD Spec define() modules require() them No
more <script> tag rubbish Dynamic module loading Build tool
Package Managers
Package Managers JamJS Bower Component Volo nodefetch
GruntJS The JavaScript Task Runner
GruntJS Run tasks on your JS, including plugins for: -
Concatenating - Minifying - RequireJS Build Tool - Sass / LESS - CoffeeScript - Handlebars / Jade / templating - QUnit / Jasmine / Mocha / testing
Going Modular
- one step at a time - split your JS
up (in development) - use a tool (Grunt) for production JS - jQuery does Pub/Sub - initial hurdles outweighed by long-term gains
Questions? @Jack_Franklin javascriptplayground.com jackfranklin.co.uk github.com/jackfranklin