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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
SpeechTranscriber + AIによる文字起こし機能
kazuki1220
0
120
AWS WAFの運用を地道に改善し、自社で運用可能にするプラクティス
andpad
1
580
Databricks 月刊サービスアップデートまとめ 2026年04月号
tyosi1212
0
130
JaSSTに関わることで変わった人生観 #jasstnano
makky_tyuyan
0
150
コーディングエージェントはTypeScriptの 型エラーをどう自己修正しているのか
melonps
2
180
TypeScriptはどのようにどこまで推論できるのか ─ とにかく as は禁止で
ypresto
0
190
Gaussian Splattingの実用化 - 映像制作への展開
gpuunite_official
0
200
最新技術を"今は選ばない"という技術選定
leveragestech
PRO
0
280
React Compiler導入から21ヶ月、いま始めるならこうやる
astatsuya
2
270
20260515 ⾃分のアカウントとプライバシーを守る認証と認可の話〜利⽤者向け〜
oidfj
0
790
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
100k
【禁断】Obsidianの第二の脳に「知の巨人」と呼ばれた師匠の脳をロードしてみた
nagatsu
0
160
Featured
See All Featured
Done Done
chrislema
186
16k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
A better future with KSS
kneath
240
18k
Fireside Chat
paigeccino
42
3.9k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.5k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
200
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.4k
Git: the NoSQL Database
bkeepers
PRO
432
67k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Deep Space Network (abreviated)
tonyrice
0
150
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
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/