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.js - ответ на почти все вопросы
Search
fwdays
April 29, 2014
Programming
0
2.2k
Ember.js - ответ на почти все вопросы
Андрей Листочкин
fwdays
April 29, 2014
Tweet
Share
More Decks by fwdays
See All by fwdays
Symfony best practices и не только Олег Зинченко
fwdays
0
2.1k
Beyond Testing Михаил Боднарчук
fwdays
0
770
Yii2 - на пути от Alpha до GA. Взгляд с практической стороны Александр Бордун
fwdays
0
1.8k
Laravel 4: простота во всем. Евгений Косинский
fwdays
0
960
Маленькая библиотека для большой компании. Антон Шевчук
fwdays
0
3.8k
Phalcon. Что нового? Александр Торош
fwdays
0
1.1k
Выбираем поисковик умом головы. Андрей Аксенов
fwdays
0
1.4k
Past, Present, and Future: The Evolution of PHP Development. Nate Abele
fwdays
0
770
Функциональный тулчейн Nix
fwdays
1
460
Other Decks in Programming
See All in Programming
ペアプロ × 生成AI 現場での実践と課題について / generative-ai-in-pair-programming
codmoninc
1
7.7k
dbt民主化とLLMによる開発ブースト ~ AI Readyな分析サイクルを目指して ~
yoshyum
3
450
エラーって何種類あるの?
kajitack
5
340
技術同人誌をMCP Serverにしてみた
74th
1
590
ISUCON研修おかわり会 講義スライド
arfes0e2b3c
0
300
地方に住むエンジニアの残酷な現実とキャリア論
ichimichi
5
1.5k
CursorはMCPを使った方が良いぞ
taigakono
1
220
PHPでWebSocketサーバーを実装しよう2025
kubotak
0
260
新メンバーも今日から大活躍!SREが支えるスケールし続ける組織のオンボーディング
honmarkhunt
3
3.3k
AIと”コードの評価関数”を共有する / Share the "code evaluation function" with AI
euglena1215
1
110
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
710
第9回 情シス転職ミートアップ 株式会社IVRy(アイブリー)の紹介
ivry_presentationmaterials
1
260
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.4k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
17
950
For a Future-Friendly Web
brad_frost
179
9.8k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Mobile First: as difficult as doing things right
swwweet
223
9.7k
GitHub's CSS Performance
jonrohan
1031
460k
Done Done
chrislema
184
16k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Code Review Best Practice
trishagee
69
18k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
810
Making Projects Easy
brettharned
116
6.3k
Transcript
None
Привет, я Андрей! Программирую на чем угодно, люблю JavaScript и
веб-технологии Соведущий Frontend UA Hangout Архитектор в очках и с бородой
None
Холивары!
DOM + Эффекты + Ajax jQuery Prototype DOMAssistant MooTools
Модули + Widgets Yahoo UI Google Closure jQuery UI Ext
JS
Desktop UI
MVC / MVP / MV* Backbone Knockout Angular Ember React/Om
HTML
Ajax
Острова интерактива
None
Моностраничные приложения
Поле Боя MV*
Веб-клиенты
None
None
None
None
2011
Yehuda Katz
C V M
C V M DAO DAO UNIT TESTABLE
C V M
C V M
C ? M
M C ?
Logic-less Templates 2009 Chris Wanstrath - Mustache.rb Jan Lehnardt -
Mustache.js <h1>Hello, {{username}}</h1>
None
None
Tom Dale
Идея - 2011 Run Loop - SprouteCore MVC - Cocoa
Logic-less Templates + Helpers - Handlebars Data-binding - Metamorph Convention over Configuration - Rails
None
Идея - 2011 Run Loop Cocoa MVC Logic-less Templates +
Helpers Data-binding Convention over Configuration
Идея - 2013 Run Loop Cocoa MVC Logic-less Templates +
Helpers Data-binding Convention over Configuration Routing and Application State Data Access Components
None
MVC Route Model Controller View Template
1. URL - царь горы
URL Смена URLа - событие
URL Смена URLа - событие URL - модуль
URL Смена URLа - событие URL - модуль URL -
глобальное состояние
URL https://myapp.com/posts/1 App.Router.map(function () { this.resource('posts', function () { this.resource('post',
{ path: ':post_id'}); }); });
URL https://myapp.com/posts/1 PostsRoute PostsController <posts> {{outlet}} PostRoute PostController <post>
URL var Post = DS.Model.extend({ title: DS.attr('string') body: DS.attr('string') published:
DS.attr('date') });
URL var PostsRoute = Ember.Router.extend({ model: function () { return
this.store.find('post'); } }); var PostsController = Ember.ArrayController.extend({ … });
URL <ul> {{! posts.hbs }} {{#each post in model}} <li>
{{#link-to 'post' post}} {{post.title}} {{/link-to}} </li> {{/each}} </ul> {{outlet}}
URL var PostRoute = Ember.Router.extend({ model: function (params) { return
this.store.find('post', params.post_id); } }); var PostController = Ember.ObjectController.extend({ … });
URL {{! post.hbs}} <h2>{{title}}</h2> <p>{{format-date published}}</p> <div> {{body}} </div>
2. Асинхронность Promise
Promises var PostRoute = Ember.Router.extend({ model: function (params) { return
this.store.find('post', params.post_id); } });
3. Dependency Injection
Dependency Injection var PostRoute = Ember.Router.extend({ model: function (params) {
return this.store.find('post', params.post_id); } });
Dependency Injection var Session = Ember.Object.extend({...}); App.register('session:main', Session); App.inject('session:main', 'store',
'store:main'); App.inject('controller', 'session', 'session:main'); App.inject('route:app', 'session', 'session:main'); // внутри PostEditController this.session.get('isLoggedIn')
4. Кодогенерация
URL var PostsRoute = Ember.Router.extend({ model: function () { return
this.store.find('post'); } }); var PostsController = Ember.ArrayController.extend({});
5. Объектная модель
Объектная модель Наследование Миксины Прокси-объекты Зависимые свойства Геттеры-сеттеры Алиасы ...
Объектная модель Uniform access principle: obj1 = { inner: {
prop: 'value' } }; obj2 = Ember.Object.create({ inner: { prop: 'value' } }); Ember.get(obj1, 'inner.prop'); Ember.get(obj2, 'inner.prop'); obj2.get('inner.prop'); someOtherObject.get(computed.property')
Объектная модель var Person = DS.Model.extend({ first: DS.attr('string'), last: DS.attr('string'),
full: function () { return this.get('first') + ' ' + this.get('last') }.property('first', 'last') }); tom.get('full') // => 'Tom Dale'
6. MVC
MVC https://myapp.com/posts/1 PostsRoute PostsController <posts> {{outlet}} PostRoute PostController <post>
MVC Init View Templat e Model Route Controller
MVC Init View Templat e Model Route Controller
MVC Init View Templat e Model Route Controller
MVC Init View Templat e Model Route Controller
MVC Data View Templat e Model Route Controller Controller View
MVC Events View Templat e Model Route Controller DOM Actions
Actions Actions
MVC Model Controller Route Application Route Route Route Route View
View View View View Model Controller Model Controller View View View View View View View View View View
MVC
7. Компоненты
Компоненты {{#my-tag param=value}} … {{/my-tag}} {{! components/my-tag.hbs}} ... {{yield}} …
MyTagComponent = Ember.Component.extend
Angular's bi-directionally bound isolate scope, transcluded, element restricted directives Ember
Components
За кадром Поддержка тестирования Инструменты Ember Inspector - Chrome, Firefox
Ember-CLI ember new myapp Broccoli ES6, HTMLBars, JSON API
Заблуждения Не может быть встроен, все или ничего Не имеет
DI Нельзя тестировать Сложно начинать Монолитный
А холивар? голос из зала
Angular JS Routing / Nested Views Консистентное API Простые компоненты
Меньше граблей Большие Open-Source проекты Angular 2.0 догонит Эмбер по ряду пунктов :) но будет несовместим с Angular 1.x :(
Backbone + React/OM сравнимая с HTMLBars производительность общая структура проекта,
не “островки архитектуры в море плохого кода” Эмбер начинают использовать с персистентными структурами данных
Не повторяет ошибок других Принимает решения за вас BB Reasonable
Defaults for 95% case BB ng DI с барьерами ng Понятные директивы ng Одноразовая загрузка данных all Свой рендерринг-пайплайн Knockout ng
Модель разработки - PostgreSQL Tilde, Yapp, Prototypal, Adepar, Instructure, etc.
Релизы по расписанию
Компании 1. Apple 2. Google 3. Yahoo 4. Twitter 5.
Microsoft 6. Groupon 7. Square 8. Zendesk 9. Ballanced 10. Nitrous.io 11. USPO 12. DoD 13. NBCNews 14. Netflix
Проекты 1. Discource 2. Ballanced 3. Travis CI 4. Ghost
None
?