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
How to use Scala.js in real world?
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
kyo_ago
January 29, 2016
Technology
2.2k
1
Share
How to use Scala.js in real world?
kyo_ago
January 29, 2016
More Decks by kyo_ago
See All by kyo_ago
フロントエンドの リソース管理の話 TechFeed Summit#1 #techfeed #techfeedsummit
kyo_ago
5
2k
TypeScriptでType Match的なことをする話 #すえなみチャンス暑気払い
kyo_ago
1
1.4k
WebReplayから見るWeb開発の未来 #builderscon
kyo_ago
2
1k
今日から始めるbugbounty
kyo_ago
0
320
karmaを使ったSPA向けE2Eテスト技法
kyo_ago
6
5.7k
E2Eという名称の指すもの
kyo_ago
0
2.6k
Other Decks in Technology
See All in Technology
大規模災害時でも高い信頼性を維持するアプリケーション基盤の実現/nikkei-tech-talk46
nikkei_engineer_recruiting
0
110
AI時代に改めて考える、ドメイン駆動設計 - モデリングが「AIへの共通言語」になる
littlehands
8
2.7k
食べログのサーキットブレーカー導入を振り返って
atpons
1
140
Don't Just Patch — MOTTAINAI! Learn Security from Laravel CVE Diffs
codmoninc
0
140
AI時代の私の技術インプットとアウトプット術
tonkotsuboy_com
15
7.4k
Claude Code x Accounting
kawaguti
PRO
1
330
Typiaで配信JSONの安全性を構造的に担保する(TSKaigi2026)
righttouch
PRO
1
190
自作エディターをOSSにして分かった、一人に刺さる開発が世界を動かす理由
shinyasaita
1
450
Agentic AI時代における メルカリのAIガバナンスとガードレール実装
naoichihara
16
16k
Copilot CLI・IDE・Web・スマホで途切れない開発フローを目指して / One Copilot flow - CLI IDE Web Mobile
aeonpeople
1
1.1k
Spring AI × MCP 入門〜AIエージェントへのツール公開、境界設計から始める最小構成 〜
yuyamiyamoto
0
150
大学生が本気でDatabricksを活用してDiscordサークルをデータ駆動させてみた
phantomjuju
0
230
Featured
See All Featured
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
820
Optimising Largest Contentful Paint
csswizardry
37
3.7k
The Cult of Friendly URLs
andyhume
79
6.9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
190
A designer walks into a library…
pauljervisheath
211
24k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
200
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
110
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
470
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
Speed Design
sergeychernyshev
33
1.7k
We Are The Robots
honzajavorek
0
230
Transcript
How to use Scala.js in real world? Kyo Ago
About me - work for ChatWork - using JavaScript for
9 years - using Scala for 0.5 year ࣗݾհɻChatWorkͰJavaScriptॻ͍ͯ·͢
Scala is great! Scala͍͍Ͱ͢Ͷʂ
But Ͱ
We want to develop UI, don't we!? UIΛ࡞Γ͍ͨʂ
Hmm... ͡Ό͋
Scala.js!! Scala.jsͰ͢Ͷʂ
Wait ... Ͱ
Scala.js is production ready yet? Scala.js͑Δͷʁ
Yes, it is! ͑Δ
1. "almost" compatible to Javascript JavaScriptͱͷޓੑ΄΅ສશ - bit-size in number
types - runtime semantics in exceptions - difference of regex defs
2. Type definition can be applied by using TypeScript ܕఆٛTypeScript͔ΒಋೖՄೳ
sjrd/scala-js-ts-importer
3. fast compile ߴͳίϯύΠϧ 1-2 seconds even when optimized fullOptJS
is used
4. small footprint ܰྔ Hello world! is 17KB(with fullOptJS). 6KB
with gzip
5. supports SourceMap SourceMapαϙʔτ
6. Java API implementation is going actively Java APIͷ࣮ਐΜͰΔ
Why isn't Scala.js widely used? ͡Ό͋ɺͳΜͰΘΕͯͳ͍ͷʁ
1. type safety is too much for small projects খنͳΒܕ҆શੑͷඞཁੑ͍
2. widely proven framework is preferred in large projects. େنͳΒ࣮͕ͳ͍ϑϨʔϜϫʔΫ࠾༻͠ʹ͍͘
3. difficult to call Scala.js from Javascript JavaScript͔ΒScala.jsΛݺͼग़͢ͷ͕͍͠ The part
actively developed right now
4. difficult to change if html was embedded to code
ίʔυʹhtmlΛຒΊࠐΉͱUIมߋʹऑ͍
5. compatibility/ability to track the latest version between other JavaScript
libraries JavaScriptϥΠϒϥϦͱͷޓੑɺ࠷৽൛ͷैੑ
6. debugging cost on browsers ϒϥβ্Ͱͷσόοάίετ
Then, we can't use, can we!? ͡Ό͋ɺ͑ͳ͍ͷʁ
Architecture can be an answer ΞʔΩςΫνϟͰղܾ
Scala.js should covers only logic. Scala.jsϩδοΫͷΈΛ࣮
Javascript should covers UI JavaScriptͰUIΛ࣮
communicate each other by JSON ͓ޓ͍ʹJSONͰ௨৴
UI should be contsructed by JSON UIJSON͔Βߏங͢Δ
Pros ར
1. reduces integration between Scala.js and JavaScript Scala.jsͱJavaScriptͷ࿈ܞ͕ݮΔ
2. we can develop in Scala.js similar to usual development
in Scala ௨ৗͷScala։ൃͱಉ͡Α͏ʹScala.jsͰ։ൃͰ͖Δ
3. flexibility of implementing UI UI࣮ͷࣗ༝্͕͕Δ
Cons ܽ
1. communication cost between Scala.js and UI Scala.jsͱUI෦ͱͷ௨৴͕සൃ͢Δ
2. logic is prone to be complex ϩδοΫ͕ෳࡶԽ͢Δ
Is this really achievable? ࣮ݱՄೳʁ
Yes, at least on the architecture level ΞʔΩςΫνϟతʹՄೳ
Let's discuss together at ChatWork Booth! ৄ͘͠ϒʔεͰ
Thank you! ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ
We're Hiring!! ͝Ԡื͓͍ͪͯ͠·͢ʂ http://corp.chatwork.com/ja/recruit/engineer/