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
48
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
31
Build in Private
matheusrich
0
61
Start TDDing in 5 minutes
matheusrich
0
90
3 Steps Every Test Should Take
matheusrich
0
66
Taming God Objects: easy, incremental and secure
matheusrich
1
80
BEM - A simple CSS methodology
matheusrich
0
46
De Repente 7
matheusrich
0
12
Other Decks in Programming
See All in Programming
pylint custom ruleで始めるレビュー自動化
shogoujiie
0
120
時計仕掛けのCompose
mkeeda
1
300
dbt Pythonモデルで実現するSnowflake活用術
trsnium
0
160
Flutter × Firebase Genkit で加速する生成 AI アプリ開発
coborinai
0
160
PHPカンファレンス名古屋2025 タスク分解の試行錯誤〜レビュー負荷を下げるために〜
soichi
1
200
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
110
color-scheme: light dark; を完全に理解する
uhyo
3
360
Grafana Loki によるサーバログのコスト削減
mot_techtalk
1
130
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
1k
Djangoアプリケーション 運用のリアル 〜問題発生から可視化、最適化への道〜 #pyconshizu
kashewnuts
1
250
技術を根付かせる / How to make technology take root
kubode
1
250
メンテが命: PHPフレームワークのコンテナ化とアップグレード戦略
shunta27
0
120
Featured
See All Featured
Making Projects Easy
brettharned
116
6k
The Cost Of JavaScript in 2023
addyosmani
47
7.3k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.3k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.3k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Documentation Writing (for coders)
carmenintech
67
4.6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.2k
Done Done
chrislema
182
16k
Visualization
eitanlees
146
15k
Optimizing for Happiness
mojombo
376
70k
Gamification - CAS2011
davidbonilla
80
5.1k
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