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
47
Build in Private
matheusrich
0
71
Start TDDing in 5 minutes
matheusrich
0
110
3 Steps Every Test Should Take
matheusrich
0
94
Taming God Objects: easy, incremental and secure
matheusrich
1
110
BEM - A simple CSS methodology
matheusrich
0
50
De Repente 7
matheusrich
0
16
Other Decks in Programming
See All in Programming
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
710
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
0
300
Deno Tunnel を使ってみた話
kamekyame
0
310
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
310
Basic Architectures
denyspoltorak
0
160
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
290
Implementation Patterns
denyspoltorak
0
140
チームをチームにするEM
hitode909
0
440
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
520
ローカルLLMを⽤いてコード補完を⾏う VSCode拡張機能を作ってみた
nearme_tech
PRO
0
240
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
340
Go コードベースの構成と AI コンテキスト定義
andpad
0
150
Featured
See All Featured
Being A Developer After 40
akosma
91
590k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
35
Amusing Abliteration
ianozsvald
0
84
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.5k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
410
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Ruling the World: When Life Gets Gamed
codingconduct
0
120
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
How GitHub (no longer) Works
holman
316
140k
My Coaching Mixtape
mlcsv
0
21
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
0
34
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.8k
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