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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
kyo_ago
January 29, 2016
Technology
1
2.2k
How to use Scala.js in real world?
kyo_ago
January 29, 2016
Tweet
Share
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.3k
WebReplayから見るWeb開発の未来 #builderscon
kyo_ago
2
990
今日から始めるbugbounty
kyo_ago
0
310
karmaを使ったSPA向けE2Eテスト技法
kyo_ago
6
5.6k
E2Eという名称の指すもの
kyo_ago
0
2.6k
Other Decks in Technology
See All in Technology
Azure Durable Functions で作った NL2SQL Agent の精度向上に取り組んだ話/jat08
thara0402
0
130
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
73k
OCI Database Management サービス詳細
oracle4engineer
PRO
1
7.3k
Data Hubグループ 紹介資料
sansan33
PRO
0
2.7k
AIと新時代を切り拓く。これからのSREとメルカリIBISの挑戦
0gm
0
660
しろおびセキュリティへ ようこそ
log0417
0
280
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
110
入社1ヶ月でデータパイプライン講座を作った話
waiwai2111
1
220
FinTech SREのAWSサービス活用/Leveraging AWS Services in FinTech SRE
maaaato
0
120
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
410
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
41k
2026年はチャンキングを極める!
shibuiwilliam
8
1.9k
Featured
See All Featured
Utilizing Notion as your number one productivity tool
mfonobong
2
210
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
78
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
130
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Side Projects
sachag
455
43k
Typedesign – Prime Four
hannesfritz
42
2.9k
KATA
mclloyd
PRO
34
15k
GraphQLとの向き合い方2022年版
quramy
50
14k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
270
A Soul's Torment
seathinner
5
2.2k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
190
How to build a perfect <img>
jonoalderson
1
4.9k
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/