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
Using only CoffeeScript to build an SmartPhone ...
Search
Naoya Ito
October 29, 2011
Technology
9.9k
19
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Using only CoffeeScript to build an SmartPhone Application
Naoya Ito
October 29, 2011
More Decks by Naoya Ito
See All by Naoya Ito
Haskell を武器にして挑む競技プログラミング ─ 操作的思考から意味モデル思考へ
naoya
12
4.3k
Haskell でアルゴリズムを抽象化する / 関数型言語で競技プログラミング
naoya
21
7.8k
Functional TypeScript
naoya
18
6.8k
TypeScript 関数型スタイルでバックエンド開発のリアル
naoya
77
38k
シェルの履歴とイクンリメンタル検索を使う
naoya
16
6.8k
20230227-engineer-type-talk.pdf
naoya
91
86k
関数型プログラミングと型システムのメンタルモデル
naoya
63
110k
TypeScript による GraphQL バックエンド開発
naoya
29
37k
フロントエンドのパラダイムを参考にバックエンド開発を再考する / TypeScript による GraphQL バックエンド開発
naoya
67
25k
Other Decks in Technology
See All in Technology
エンジニアリング戦略の作り方 / Crafting Engineering Strategy
iwashi86
21
7k
スキルと MCP ツール、責務をどう分けるか? AI が迷わないインターフェース設計の戦略
cdataj
1
1.1k
AI時代のコスト管理を考えよう〜明日から使える実践AWSノウハウ~
yoshimi0227
0
130
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
3k
いまさら聞けない「仕様駆動開発入門」 〜AI活用時代の開発プロセスを考える〜
findy_eventslides
2
150
Bedrock AgentCore RuntimeでAuth0 Changelog調査AIをアップグレードした話
t5u8a5a
1
170
【セミナー資料】Claude Code をセキュアに使うための考え方と設定の勘どころ / Claude Code Webinar 20260616
masahirokawahara
2
380
AmazonRoute 53ではじめてのドメイン取得!HTTPS化までの道のりを整理してみた
usanchuu
3
150
【NRUG vol.18】なぜ多くのオブザーバビリティ導入は失敗するのか
nrug_member
0
170
フィジカル版Github Onshapeの紹介
shiba_8ro
0
270
データサイエンスを価値につなげるプロジェクト設計 〜 DS一年目が現場で得た気づき 〜
ysd113
1
270
現地で盛り上がった WWDC26 Keynote
zozotech
PRO
1
250
Featured
See All Featured
Everyday Curiosity
cassininazir
0
230
New Earth Scene 8
popppiees
3
2.3k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Color Theory Basics | Prateek | Gurzu
gurzu
0
360
The Mindset for Success: Future Career Progression
greggifford
PRO
0
360
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
160
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
250
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Transcript
CoffeeScript using only to build an SmartPhone Application Naoya Ito
Chrome To iOS
None
Node Titanium Mobile Chrome Extension + +
JavaScript
}); }); }); }); }); });
\(^o^)/
CoffeeScript will save us from the darkside of JavaScript
Node express = require "express" app = module.exports = express.createServer()
app.get "/", (req, res) -> res.render "index", title: "Express"
Titanium Mobile win = Ti.UI.createWindow title: "Chrome To iOS" table
= Ti.UI.createTableView top: 0 data: [] win.add table tabGroup = Ti.UI.createTabGroup tab = Ti.UI.createTab window: win tabGroup.addTab tab tabGroup.open()
Chrome Extension chrome.browserAction.onClicked.addListener (tab) -> chrome.tabs.executeScript null, file: "jquery-1.6.4.min.js", ->
chrome.tabs.executeScript null, file: "content_script.js" chrome.extension.onConnect.addListener (port) -> port.onMessage.addListener (info) -> socket = io.connect 'http://localhost:3000' socket.emit 'fireEvent:openUrl' title: info.title url: info.url image: info.image
To learn more about CoffeeScript
CoffeeScript All your product are belong to
How do they communicate with each other?
None
socket.emit() socket.emit() using socket.io for messaging
Hacking Titanium for enabling Socket.IO WebView proxy technique 0px WebView
left: -100 top: -100 enabling socket.io on HTML <head> socket.emit() Titanium.App.fireEvent() github.com/euforic/ChatSocks/tree/wv-proxy
WebView proxy for Socket.IO socket = {} socket.connect = (win)
-> proxy = Ti.UI.createWebView url: "webview/webview.html" top: -100, left: -100, width: 0 height: 0 win.add proxy # Alias for Titanium functions just for fun socket.emit = (e, params) -> Ti.App.fireEvent e, params socket.on = (e, callback) -> Ti.App.addEventListener e, callback on Titanium App
Open new URL when receiving socket events socket.on 'openUrl', (params)
-> table.prependRow $$.ui.createRow title: params.title || params.url message: 'URLを開く' image: params.image click: -> w = Ti.UI.createWindow() w.add Ti.UI.createWebView url: params.url tab.open w on Titanium App
Using socket.io on Chrome is easy # background.html <html> <head>
<script type="text/javascript" src="http://localhost:3000/socket.io/socket.io.js"></script> <script type="text/javascript" src="background.js"></script> </head> </html> # background.coffee chrome.extension.onConnect.addListener (port) -> port.onMessage.addListener (info) -> socket = io.connect 'http://localhost:3000' socket.emit 'fireEvent:openUrl' ... on Chrome Extension
done!
Node & Titanium Mobile can help you to write SmartPhone
Apps only in CoffeeScript Socket.IO makes work easy!
To learn more about CoffeeScript NO MORE JS HELL!?
Thanks! github/naoya/push-to-ios (Titanium App & Node server) github/naoya/chrome2ios (Chrome Extension)
Design inspired by: zachholman.com/posts/slide-design-for-developers/