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
Stimulus 2.0-alpha - What's new?
Search
Matheus Richard
April 02, 2020
Programming
0
49
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
35
Build in Private
matheusrich
0
64
Start TDDing in 5 minutes
matheusrich
0
97
3 Steps Every Test Should Take
matheusrich
0
78
Taming God Objects: easy, incremental and secure
matheusrich
1
95
BEM - A simple CSS methodology
matheusrich
0
48
De Repente 7
matheusrich
0
12
Other Decks in Programming
See All in Programming
Google I/O Extended Incheon 2025 ~ What's new in Android development tools
pluu
1
210
AI Ramen Fight
yusukebe
0
120
リッチエディターを安全に開発・運用するために
unachang113
1
310
オンコール⼊⾨〜ページャーが鳴る前に、あなたが備えられること〜 / Before The Pager Rings
yktakaha4
2
1.2k
オホーツクでコミュニティを立ち上げた理由―地方出身プログラマの挑戦 / TechRAMEN 2025 Conference
lemonade_37
1
360
LLMは麻雀を知らなすぎるから俺が教育してやる
po3rin
2
1.4k
DataformでPythonする / dataform-de-python
snhryt
0
110
それ CLI フレームワークがなくてもできるよ / Building CLI Tools Without Frameworks
orgachem
PRO
13
3.3k
Comparing decimals in Swift Testing
417_72ki
0
130
MCPで実現できる、Webサービス利用体験について
syumai
7
2.2k
Understanding Kotlin Multiplatform
l2hyunwoo
0
240
なぜあなたのオブザーバビリティ導入は頓挫するのか
ryota_hnk
4
520
Featured
See All Featured
Six Lessons from altMBA
skipperchong
28
3.9k
Making the Leap to Tech Lead
cromwellryan
134
9.4k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
Rails Girls Zürich Keynote
gr2m
95
14k
For a Future-Friendly Web
brad_frost
179
9.8k
The Pragmatic Product Professional
lauravandoore
35
6.8k
A Modern Web Designer's Workflow
chriscoyier
695
190k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
110
19k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
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