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
53
0
Share
Stimulus 2.0-alpha - What's new?
Light talk about the upcoming features of Stimulus.js.
Matheus Richard
April 02, 2020
More Decks by Matheus Richard
See All by Matheus Richard
The Fast Lane: Asynchronous Rails
matheusrich
0
55
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
我々はなぜ「層」を分けるのか〜「関心の分離」と「抽象化」で手に入れる変更に強いシンプルな設計〜 #phperkaigi / PHPerKaigi 2026
shogogg
2
800
おれのAgentic Coding 2026/03
tsukasagr
1
130
AI駆動開発がもたらすパラダイムシフト
ryosuke0911
0
120
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.8k
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
7
1.2k
「速くなった気がする」をデータで疑う
senleaf24
0
140
L’IA au service des devs : Anatomie d'un assistant de Code Review
toham
0
200
[PHPerKaigi 2026]PHPerKaigi2025の企画CodeGolfが最高すぎて社内で内製して半年運営して得た内製と運営の知見
ikezoemakoto
0
320
Nuxt Server Components
wattanx
0
240
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
2
150
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
1
300
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
190
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
200
Practical Orchestrator
shlominoach
191
11k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
140
Making the Leap to Tech Lead
cromwellryan
135
9.8k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
330
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
750
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
160
How to Talk to Developers About Accessibility
jct
2
170
The Language of Interfaces
destraynor
162
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