$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Stimulus 2.0-alpha - What's new?
Search
Matheus Richard
April 02, 2020
Programming
0
51
Stimulus 2.0-alpha - What's new?
Light talk about the upcoming features of Stimulus.js.
Matheus Richard
April 02, 2020
Tweet
Share
More Decks by Matheus Richard
See All by Matheus Richard
The Fast Lane: Asynchronous Rails
matheusrich
0
42
Build in Private
matheusrich
0
69
Start TDDing in 5 minutes
matheusrich
0
110
3 Steps Every Test Should Take
matheusrich
0
89
Taming God Objects: easy, incremental and secure
matheusrich
1
110
BEM - A simple CSS methodology
matheusrich
0
50
De Repente 7
matheusrich
0
15
Other Decks in Programming
See All in Programming
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
440
AIコードレビューがチームの"文脈"を 読めるようになるまで
marutaku
0
350
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
380
Microservices Platforms: When Team Topologies Meets Microservices Patterns
cer
PRO
1
1k
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
2
660
How Software Deployment tools have changed in the past 20 years
geshan
0
29k
配送計画の均等化機能を提供する取り組みについて(⽩⾦鉱業 Meetup Vol.21@六本⽊(数理最適化編))
izu_nori
0
150
AWS CDKの推しポイントN選
akihisaikeda
1
240
AIコーディングエージェント(NotebookLM)
kondai24
0
170
社内オペレーション改善のためのTypeScript / TSKaigi Hokuriku 2025
dachi023
1
570
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
260
【CA.ai #3】Google ADKを活用したAI Agent開発と運用知見
harappa80
0
300
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1371
200k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Done Done
chrislema
186
16k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
970
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.2k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Optimizing for Happiness
mojombo
379
70k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Transcript
Stimulus 2.0-alpha What’s new?
TLDR Two new APIs with a nice surprise
Data Map API
Data Map API • A way to pass data to
a controller. • Use cases: ◦ Storing small strings, such as URLs, dates, or color values; ◦ Bootstrapping a controller with a JSON object or array.
HTML Controller
However, the Data Map API only works with string values.
That means we must manually convert to and from other types as needed
Values API
Values API • Makes possible to define values (data maps)
in the controller itself; • Create properties to accessing them.
Usage The Value object keys are Data Map keys, and
the values declare their data types
Value Properties They work just as the Target API works
A nice surprise: Value Changed Callback
Usage Now it’s easier to make your good old HTML
template look modern
How many times have you seen the following pattern?
HTML Controller
We’re coupling the controller to the class name
Maybe using the Data Map API?
HTML Controller
Classes API
HTML Controller
All that with a very small cost
Unifying target attributes Both syntaxes will be supported, but using
the original syntax will display a deprecation message in the developer console
Excited? Start using it now! Just add it to your
package.json
More info at https://github.com/stimulusjs/stimulus/pull/202
That’s it Feel free to ask any question