Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Stimulus 2.0-alpha - What's new?
Search
Matheus Richard
April 02, 2020
Programming
57
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
80
Build in Private
matheusrich
0
75
Start TDDing in 5 minutes
matheusrich
0
130
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
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
190
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
350
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
760
mrbgem 三角測量 開発
ogom
0
200
Jetpack Compose Mechanisms
skydoves
2
500
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.8k
SREの越境 / SRE Collaboration
y0hgi
2
300
The Rails Doctrine Decade
koic
2
510
Workers Cache を知る
syumai
0
340
Rでドレミ/Do-Re-Mi_with_R
florets1
0
120
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
480
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
540
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
550
Abbi's Birthday
coloredviolet
4
10k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
320
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
510
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
460
Scaling GitHub
holman
464
140k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
570
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Skip the Path - Find Your Career Trail
mkilby
1
240
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
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