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
28
Build in Private
matheusrich
0
57
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
77
BEM - A simple CSS methodology
matheusrich
0
44
De Repente 7
matheusrich
0
11
Other Decks in Programming
See All in Programming
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
280
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
440
週次リリースを実現するための グローバルアプリ開発
tera_ny
1
110
歴史と現在から考えるスケーラブルなソフトウェア開発のプラクティス
i10416
0
120
情報漏洩させないための設計
kubotak
3
650
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
290
モバイルアプリにおける自動テストの導入戦略
ostk0069
0
110
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
130
各クラウドサービスにおける.NETの対応と見解
ymd65536
0
160
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
340
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
7
1.4k
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
170
Featured
See All Featured
Writing Fast Ruby
sferik
628
61k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Adopting Sorbet at Scale
ufuk
73
9.1k
What's in a price? How to price your products and services
michaelherold
243
12k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
BBQ
matthewcrist
85
9.4k
Done Done
chrislema
182
16k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Faster Mobile Websites
deanohume
305
30k
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