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
Java 21/25 Virtual Threads 소개
debop
0
310
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
480
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
580
20260315 AWSなんもわからん🥲
chiilog
2
180
How to stabilize UI tests using XCTest
akkeylab
0
150
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
170
AI活用のコスパを最大化する方法
ochtum
0
360
Nuxt Server Components
wattanx
0
210
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
180
Tamach-sre-3_ANDPAD-shimaison93
mane12yurks38
0
200
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
180
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
200
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.6k
Paper Plane (Part 1)
katiecoart
PRO
0
6.2k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
180
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
240
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
120
Claude Code のすすめ
schroneko
67
220k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
210
Why Our Code Smells
bkeepers
PRO
340
58k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
610
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