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
52
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
53
Build in Private
matheusrich
0
72
Start TDDing in 5 minutes
matheusrich
0
110
3 Steps Every Test Should Take
matheusrich
0
98
Taming God Objects: easy, incremental and secure
matheusrich
1
110
BEM - A simple CSS methodology
matheusrich
0
52
De Repente 7
matheusrich
0
17
Other Decks in Programming
See All in Programming
Takumiから考えるSecurity_Maturity_Model.pdf
gessy0129
1
140
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
430
CSC307 Lecture 15
javiergs
PRO
0
240
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
720
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
420
AHC061解説
shun_pi
0
360
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
200
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
830
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
260
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
360
SourceGeneratorのマーカー属性問題について
htkym
0
180
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
1
240
Featured
See All Featured
Discover your Explorer Soul
emna__ayadi
2
1.1k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
From π to Pie charts
rasagy
0
150
Ethics towards AI in product and experience design
skipperchong
2
220
Between Models and Reality
mayunak
2
230
Marketing to machines
jonoalderson
1
5k
Writing Fast Ruby
sferik
630
63k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.4k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
470
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
970
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
170
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