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
51
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
38
Build in Private
matheusrich
0
67
Start TDDing in 5 minutes
matheusrich
0
110
3 Steps Every Test Should Take
matheusrich
0
86
Taming God Objects: easy, incremental and secure
matheusrich
1
100
BEM - A simple CSS methodology
matheusrich
0
49
De Repente 7
matheusrich
0
14
Other Decks in Programming
See All in Programming
CSC305 Lecture 11
javiergs
PRO
0
320
Reactive Thinking with Signals and the Resource API
manfredsteyer
PRO
0
120
組込みだけじゃない!TinyGo で始める無料クラウド開発入門
otakakot
2
380
EMこそClaude Codeでコード調査しよう
shibayu36
0
520
Pythonに漸進的に型をつける
nealle
1
140
Webサーバーサイド言語としてのRustについて
kouyuume
1
5k
マンガアプリViewerの大画面対応を考える
kk__777
0
440
AkarengaLT vol.38
hashimoto_kei
1
130
Introduce Hono CLI
yusukebe
6
3.3k
GC25 Recap: The Code You Reviewed is Not the Code You Built / #newt_gophercon_tour
mazrean
0
140
マイベストのシンプルなデータ基盤の話 - Googleスイートとのつき合い方 / mybest-simple-data-architecture-google-nized
snhryt
0
110
釣り地図SNSにおける有料機能の実装
nokonoko1203
0
200
Featured
See All Featured
Scaling GitHub
holman
463
140k
Faster Mobile Websites
deanohume
310
31k
How GitHub (no longer) Works
holman
315
140k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.1k
Testing 201, or: Great Expectations
jmmastey
46
7.7k
Practical Orchestrator
shlominoach
190
11k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
BBQ
matthewcrist
89
9.9k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
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