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
36
Build in Private
matheusrich
0
64
Start TDDing in 5 minutes
matheusrich
0
98
3 Steps Every Test Should Take
matheusrich
0
80
Taming God Objects: easy, incremental and secure
matheusrich
1
97
BEM - A simple CSS methodology
matheusrich
0
48
De Repente 7
matheusrich
0
13
Other Decks in Programming
See All in Programming
Webinar: AI-Powered Development: Transformiere deinen Workflow mit Coding Tools und MCP Servern
danielsogl
0
130
LLMOpsのパフォーマンスを支える技術と現場で実践した改善
po3rin
8
940
Vibe coding コードレビュー
kinopeee
0
450
Flutterと Vibe Coding で個人開発!
hyshu
1
250
自作OSでDOOMを動かしてみた
zakki0925224
1
1.4k
State of CSS 2025
benjaminkott
1
110
AHC051解法紹介
eijirou
0
590
ゲームの物理
fadis
5
1.2k
LLMは麻雀を知らなすぎるから俺が教育してやる
po3rin
3
2.2k
Honoアップデート 2025年夏
yusukebe
1
760
あなたとJIT, 今すぐアセンブ ル
sisshiki1969
1
700
DockerからECSへ 〜 AWSの海に出る前に知っておきたいこと 〜
ota1022
5
1.6k
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
183
54k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Scaling GitHub
holman
462
140k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
BBQ
matthewcrist
89
9.8k
A Tale of Four Properties
chriscoyier
160
23k
Code Review Best Practice
trishagee
69
19k
How to Ace a Technical Interview
jacobian
279
23k
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