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
82
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
LLM開発・活用の舞台裏@2024.04.25
yushin_n
3
1.3k
Babylon.js JAPAN活動紹介 (2024/4)
limes2018
1
120
Building Dashboards as a Hobby
egmc
0
400
AWSやJAWS-UGとの出会いを振り返る
yoyoyopg
1
130
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
5
37k
個人のAWSアカウントをマルチ運用してみた
miura55
2
200
今日からできる!簡単 .NET 高速化 Tips -2024 edition-
xin9le
7
4.4k
20分で完全に理解するGrafanaダッシュボード
hamadakoji
5
950
ワールドカフェI /チューターを改良する / World Café I and Improving the Tutors
ks91
PRO
0
150
LangSmith入門―トレース/評価/プロンプト管理などを担うLLMアプリ開発プラットフォーム
os1ma
5
770
成長をサポートするピープルマネジメントのやり方
sioncojp
9
1.4k
TechFeed Experts Night#27 〜 フロントエンドフレームワーク最前線 (Svelte)
baseballyama
2
600
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
15
1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
14
8.4k
A Philosophy of Restraint
colly
197
16k
Product Roadmaps are Hard
iamctodd
45
9.8k
[RailsConf 2023] Rails as a piece of cake
palkan
28
4k
The Language of Interfaces
destraynor
151
23k
Scaling GitHub
holman
457
140k
Optimising Largest Contentful Paint
csswizardry
13
2.4k
GitHub's CSS Performance
jonrohan
1025
450k
Unsuck your backbone
ammeep
664
57k
Ruby is Unlike a Banana
tanoku
96
10k
Web Components: a chance to create the future
zenorocha
306
41k
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