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
56
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
75
Build in Private
matheusrich
0
74
Start TDDing in 5 minutes
matheusrich
0
120
3 Steps Every Test Should Take
matheusrich
0
110
Taming God Objects: easy, incremental and secure
matheusrich
1
130
BEM - A simple CSS methodology
matheusrich
0
56
De Repente 7
matheusrich
0
22
Other Decks in Programming
See All in Programming
Google Apps Script で Ruby を動かす
kawahara
0
220
SlackアプリとLambdaの 連携を構築した話
pawn_4_s
1
120
数百円から始めるRuby電子工作
tarosay
0
150
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
2.8k
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
560
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
780
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
470
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
180
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
1
680
What's New in Android 2026
veronikapj
0
260
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
1.6k
Go 1.27 における memory allocation の高速化
andpad
0
170
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Technical Leadership for Architectural Decision Making
baasie
3
480
Typedesign – Prime Four
hannesfritz
42
3.1k
30 Presentation Tips
portentint
PRO
1
370
How to Talk to Developers About Accessibility
jct
2
510
Scaling GitHub
holman
464
140k
Into the Great Unknown - MozCon
thekraken
41
2.7k
The untapped power of vector embeddings
frankvandijk
2
1.8k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
350
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
460
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
240
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
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