Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
A Less Complex Web with Ratchet & Jank
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Jay Hayes
May 10, 2017
Programming
400
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
A Less Complex Web with Ratchet & Jank
https://conferences.oreilly.com/oscon/oscon-tx/public/schedule/detail/56904
Jay Hayes
May 10, 2017
Transcript
64 slides
Ratchet+Jank live slides: bit.ly/2pV0PhP @iamvery ♥
@iamvery ♥ This is a talk about the web.
None
@iamvery ♥ This is a talk about the web.
@iamvery ♥ This is a talk about complexity.
None
None
None
@iamvery ♥ "
@iamvery ♥ COMPLEXITY
@iamvery ♥ git reset --hard 2004
@iamvery ♥ Turbolinks
View
@iamvery ♥ <% if [earth, moon, sun].all?(&:aligned?) %> <figure> <%=
moon.between?(earth..sun) ? sun.eclipsed : moon.eclipsed %> </figure> <% else %> <% if earth.daytime? %> <figure><%= sun.shine %></figure> <% else %> <figure><%= moon.shine %></figure> <% end %> <% end %>
@iamvery ♥ <figure>…</figure>
@iamvery ♥ <figure> <%= celestial_body.display %> </figure> <figure> {{ celestial_body.display
}} </figure>
@iamvery ♥ Logic-less
@iamvery ♥ HTML
The Web Something I’m building Something you’re building
@iamvery ♥ Plain HTML
@iamvery ♥ <article> <h2>The Post Title</h2> <p> The post body.
</p> </article>
@iamvery ♥ %{ posts: [ %{title: "Interesting Facts”, body: "Cats
are soft. Dogs are noisy."}, %{title: "Bears", body: "Bears eat beets."}, ] }
@iamvery ♥ <%= for post <- @data.posts %> <article> <h2><%=
post.title %></h2> <p><%= post.body %></p> </article> <% end %>
@iamvery ♥ <article data-prop="posts"> <h2 data-prop="title"></h2> <p data-prop="body"></p> </article>
@iamvery ♥ <article data-prop="posts"> <h2 data-prop=“title">Interesting Facts</h2> <p data-prop=“body”> Cats
are soft. Dogs are noisy. </p> </article> <article data-prop="posts"> <h2 data-prop="title">Bears</h2> <p data-prop=“body”> Bears eat beets. </p> </article>
@iamvery ♥ Content
@iamvery ♥ The 5 Forms of Data
@iamvery ♥ 1. Properties are mapped
@iamvery ♥ %{property: “value”}
@iamvery ♥ 2. Tag content
@iamvery ♥ “value” %{property: }
@iamvery ♥ 3. Tag attributes
@iamvery ♥ [href: “http://…”]
@iamvery ♥ 4. Combined content
@iamvery ♥ {“Click”, href: “http://…”}
@iamvery ♥ 5. Iteration
@iamvery ♥ <%= for post <- @data.posts %> <article> <h2><%=
post.title %></h2> <p><%= post.body %></p> </article> <% end %>
@iamvery ♥ %{items: [“first”, “second”]}
@iamvery ♥ %{ active_user: %{name: "Jay"}, posts: [ %{ title:
"Cats Facts", body: "Some cats are fuzzy.", comments: ["I like cats.", "I prefer dogs."], edit_link: {"Edit 'Cat Facts'", href: "http://example.com/posts/1"}, }, %{ title: "Sleepy Dog", body: "Dogs sleep a lot.", comments: [], edit_link: {"Edit 'Sleepy Dog'", href: "http://example.com/posts/2"}, }, ], new_post: [disabled: true], }
@iamvery ♥ Ratchet
@iamvery ♥ “A set of pre-defined transformations used to bind
content to elements” https://github.com/iamvery/ratchet
(Demo)
@iamvery ♥ Caching
@iamvery ♥ I Designers ❤
ERB EEX JSX %
@iamvery ♥ “It’s a mystery to me why we can’t
write plain HTML and CSS.” - Designer
Client
@iamvery ♥ But…
Data Transform View
@iamvery ♥ Jank
Controller Browser Model View Router JS DOM Jank Channel Hi
(Demo)
@iamvery ♥ “Like Ratchet, but more Janky” https://github.com/iamvery/jank
Jay Hayes https://iamvery.com — @iamvery
None
None
None
We develop.
We teach.
We write.
pakyow.org
@iamvery ♥ HTML Templates
@iamvery ♥ The web works.
@iamvery Questions?
More Decks by Jay Hayes
See All by Jay Hayes
Build Elixir Phoenix
iamvery
0
110
Elixir in Elixir
iamvery
1
170
Feature. Tests. Implementation.
iamvery
0
110
Ratchet & Jank
iamvery
0
220
Elixir in Elixir
iamvery
6
1.2k
Rubyist Does Swift
iamvery
0
120
Swift Introduction
iamvery
0
350
Data Integrity
iamvery
0
130
Pairing with tmux
iamvery
2
270
Other Decks in Programming
See All in Programming
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
180
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
380
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
850
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
100
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
250
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
16
9.1k
graphql-ruby を Spinel で速くしようとした話
mtsmfm
0
140
小さなアプリを作って公開するまで
onozaty
0
170
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
300
AI-Powered Domain-Driven Design
ziobrando
0
440
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
330
まずはコードより業務と向き合う:テーブル解体のためにPdMを呼んだ話
sakawe_ee
0
220
Featured
See All Featured
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.3k
Ethics towards AI in product and experience design
skipperchong
2
460
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Visualization
eitanlees
153
17k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
560
How to make the Groovebox
asonas
2
2.6k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
43k
Believing is Seeing
oripsolob
1
280
What's in a price? How to price your products and services
michaelherold
247
13k
Why Our Code Smells
bkeepers
PRO
340
58k
Accessibility Awareness
sabderemane
1
300
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k