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
kyo_ago
January 29, 2016
Technology
1
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
1.9k
TypeScriptでType Match的なことをする話 #すえなみチャンス暑気払い
kyo_ago
1
1.3k
WebReplayから見るWeb開発の未来 #builderscon
kyo_ago
2
920
今日から始めるbugbounty
kyo_ago
0
260
karmaを使ったSPA向けE2Eテスト技法
kyo_ago
6
5.4k
E2Eという名称の指すもの
kyo_ago
0
2.4k
Other Decks in Technology
See All in Technology
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
13
3.6k
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
110
生成AIのガバナンスの全体像と現実解
fnifni
1
180
なぜCodeceptJSを選んだか
goataka
0
160
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
240
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
530
サービスでLLMを採用したばっかりに振り回され続けたこの一年のあれやこれや
segavvy
2
390
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
300
Wvlet: A New Flow-Style Query Language For Functional Data Modeling and Interactive Data Analysis - Trino Summit 2024
xerial
1
110
PHPからGoへのマイグレーション for DMMアフィリエイト
yabakokobayashi
1
170
どちらを使う?GitHub or Azure DevOps Ver. 24H2
kkamegawa
0
690
非機能品質を作り込むための実践アーキテクチャ
knih
3
950
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
510
How to train your dragon (web standard)
notwaldorf
88
5.7k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
Gamification - CAS2011
davidbonilla
80
5.1k
How to Ace a Technical Interview
jacobian
276
23k
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/