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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Matheus Richard
April 02, 2020
Programming
0
53
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
54
Build in Private
matheusrich
0
73
Start TDDing in 5 minutes
matheusrich
0
120
3 Steps Every Test Should Take
matheusrich
0
100
Taming God Objects: easy, incremental and secure
matheusrich
1
120
BEM - A simple CSS methodology
matheusrich
0
53
De Repente 7
matheusrich
0
18
Other Decks in Programming
See All in Programming
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
270
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
130
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
1.2k
「速くなった気がする」をデータで疑う
senleaf24
0
110
RailsのValidatesをSwift Macrosで再現してみた
hokuron
0
140
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
170
Codex CLI でつくる、Issue から merge までの開発フロー
amata1219
0
250
我々はなぜ「層」を分けるのか〜「関心の分離」と「抽象化」で手に入れる変更に強いシンプルな設計〜 #phperkaigi / PHPerKaigi 2026
shogogg
2
710
Rethinking API Platform Filters
vinceamstoutz
0
3.8k
Strategy for Finding a Problem for OSS: With Real Examples
kibitan
0
120
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
870
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
280
Featured
See All Featured
Amusing Abliteration
ianozsvald
0
140
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Building an army of robots
kneath
306
46k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
460
Everyday Curiosity
cassininazir
0
180
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
95
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.1k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
190
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
100
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
170
Embracing the Ebb and Flow
colly
88
5k
Optimising Largest Contentful Paint
csswizardry
37
3.6k
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