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
Ember 1.8 Beta
Search
Martin Muñoz
September 11, 2014
Programming
0
86
Ember 1.8 Beta
Martin Muñoz
September 11, 2014
Tweet
Share
More Decks by Martin Muñoz
See All by Martin Muñoz
Anatomy of HTMLBars Templates
mmun
8
1.3k
Other Decks in Programming
See All in Programming
Rubyで始める関数型ドメインモデリング
shogo_tksk
0
110
データベースのオペレーターであるCloudNativePGがStatefulSetを使わない理由に迫る
nnaka2992
0
170
『テスト書いた方が開発が早いじゃん』を解き明かす #phpcon_nagoya
o0h
PRO
2
290
2,500万ユーザーを支えるSREチームの6年間のスクラムのカイゼン
honmarkhunt
6
5.3k
Kubernetes History Inspector(KHI)を触ってみた
bells17
0
230
Grafana Cloudとソラカメ
devoc
0
170
CSS Linter による Baseline サポートの仕組み
ryo_manba
1
110
チームリードになって変わったこと
isaka1022
0
200
苦しいTiDBへの移行を乗り越えて快適な運用を目指す
leveragestech
0
630
なぜイベント駆動が必要なのか - CQRS/ESで解く複雑系システムの課題 -
j5ik2o
12
4.1k
JavaScriptツール群「UnJS」を5分で一気に駆け巡る!
k1tikurisu
9
1.8k
AWS Organizations で実現する、 マルチ AWS アカウントのルートユーザー管理からの脱却
atpons
0
150
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
461
33k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
12
960
Agile that works and the tools we love
rasmusluckow
328
21k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Gamification - CAS2011
davidbonilla
80
5.1k
Rebuilding a faster, lazier Slack
samanthasiow
80
8.8k
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.5k
The Cost Of JavaScript in 2023
addyosmani
47
7.3k
Transcript
ember 1.8 beta and metal-views By Martin Muñoz
I work at Crowdmark still @_mmun on twitter :(
warning: the typography of this presentation will aggravate you
what’s new in ember 1.8 beta?
i don’t actually know
we’re still using Ember 1.5 at Crowdmark!
here’s what they tell me…
IE 6 and 7 are deprecated.
[applause]
what does that mean?
we still support them. please report issues.
Deprecate global access to view classes from template {{view App.PostView}}
Deprecate global access to view classes from template {{view App.PostView}}
Deprecate global access to view classes from template {{view "post"}}
Deprecate global access to view classes from template {{view "post"}}
“but I use multiple namespaces :(“ window.Blahg = Em.Namespace.create(); Blahg.PostView
= Em.View.extend(...);
np! {{view "blahg/post"}}
some big performance improvements…
Lots of string operations are now cached: - camelize/dasherize/whateverfy -
a hash lookup to tell if a path is global - a hash lookup to split
backburner’s pushUnique got a lot of love. This has a
big effect on: - Ember Data - rendering big {{each}} blocks
Thanks Stefan!
Hmm.. what else happened…
None
[ the font is called Flesh Wound ]
The metal-views rewrite entirely removes the dependency on the metamorph
package
Consequently, you will no longer see metamorph script tags
[applause]
how is that even possible?
it’s really simple!
we still use script tags!
…but they are immediately removed and replaced with two empty
TextNodes
I’ll talk more about it some day.
Today, I want to talk about bindings.
Today, I want to talk about bindings.
{{comment-list comments=model}} Specifically, how does this work?
obj from to Binding
commentListView from to Binding {{comment-list comments=model}}
commentListView from “comments” Binding {{comment-list comments=model}}
commentListView “_parentView.context.model” “comments” Binding {{comment-list comments=model}}
The job of bindings: • observe both sides of the
binding • if either side changes, schedule an update on the runloop • break ties: down always wins.
{{#each item in items}} {{name-tag name=item.name}} {{/each}} how does binding
to keywords work? how? :(
nameTagView “templateData.keywords.item.name” “name” Binding {{name-tag name=item.name}}
This doesn’t use bindings, but instead uses its own way
to resolve keywords. {{item.name}}
Ok who cares?
Well, I think its cool but…
{{#each item in items}} {{name-tag name=item.name}} {{/each}} what happens when
items changes?
Because of some complications and some others, the entire each
view much be re-rendered. So we can’t do any smart React style diffing or anything at all smarter than “actually rerender everything”.
In order for Ember to get better, we need to
improve how keywords work. It will have far reaching consequences on the composibility of components
Have you ever used _view or _view._parentView?
We can do better!
The solution we’re working on is streams.
[gasps]
It’s not done yet, and I haven’t figured out how
to explain it very well.
{{myvar}} {{#if myvar}} {{myvar}}!! {{/if}} {{x-foo value=myvar}} {{#each item
in items}} {{name-tag name=item.name}} {{item.name}} {{/each}}
{{myvar}} {{#if myvar}} {{myvar}}!! {{/if}} {{x-foo value=myvar}} {{#each item
in items}} {{name-tag name=item.name}} {{item.name}} {{/each}}
(obj2, to) Stream (obj3, to) (obj1, to) source