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
47
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
27
Build in Private
matheusrich
0
53
Start TDDing in 5 minutes
matheusrich
0
88
3 Steps Every Test Should Take
matheusrich
0
64
Taming God Objects: easy, incremental and secure
matheusrich
1
76
BEM - A simple CSS methodology
matheusrich
0
44
De Repente 7
matheusrich
0
11
Other Decks in Programming
See All in Programming
as(型アサーション)を書く前にできること
marokanatani
10
2.7k
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
110
初めてDefinitelyTypedにPRを出した話
syumai
0
420
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.3k
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
630
Ethereum_.pdf
nekomatu
0
470
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
5
1.5k
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
Amazon Qを使ってIaCを触ろう!
maruto
0
420
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
Featured
See All Featured
The Language of Interfaces
destraynor
154
24k
Building Adaptive Systems
keathley
38
2.3k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
The Cost Of JavaScript in 2023
addyosmani
45
6.8k
GitHub's CSS Performance
jonrohan
1030
460k
The Invisible Side of Design
smashingmag
298
50k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
GraphQLとの向き合い方2022年版
quramy
43
13k
Bash Introduction
62gerente
608
210k
Building Your Own Lightsaber
phodgson
103
6.1k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Code Reviewing Like a Champion
maltzj
520
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