Framework určený pre tvorbu ambicioznych webových aplikácií. Alebo o tom, ako som spokojný s knižnicou, ktorá zlepšuje developer experience (DevX). Dozviete sa v čom spočívajú silné stránky embru, čím je unikátna architektúra a prečo je výhodné použiť ho pri multiplatformných riešeniach. Uvediem základné možnosti nasadenia a popíšem benefity a zistenia z praxe (wow's and dont's, deployment, lessons I've learned).
5. “A software framework, in computer
programming, is an abstraction in which
common code providing generic
functionality can be selectively overridden
or specialized by user code providing
specific functionality.”
ref
6. makes doing the right thing feel good
is built on top of maximally flexible primitives
evolves with the best practices of the community
nurtures a feedback loop that helps features iterate as
shared understanding develops
7. Current version: 1.11.1 (I really love ones!)
In December 2011 Sproutcore 2.0 was renamed to Ember.js
17. TEMPLATES
Designed to describe the UI in a meaningful way:
Expressions {{age}}
Outlets {{outlet}}
Components {{my-component}}
Helper {{t "user.edit.title"}}
18. given a controller has a people property:
export default Ember.Controller.extend({
people: [{name:'Yehuda'}, {name:'Tom'}, {name:'Trek'}]
});
then the following template
<ul>
{{#each person in people}}
<li>Hello, {{person.name}}!</li>
{{/each}}
</ul>
results into:
<ul>
<li>Hello, Yehuda!</li>
<li>Hello, Tom!</li>
<li>Hello, Trek!</li>
</ul>
22. REASON
like:
the complexity of the project is causing chaos
your company is starting a new project (!)
you're planning to extend an existing project
a start-up occurred
it will help to eliminate technical debt
23. USE CASE
complex data-model / data-structure
big-data app view layer (multiple data sources)
conversion operations (e-commerce)
media processing (audio, image, video)
dashboard, monitoring / conflagration capability
B2B or B2C app for daily usage (ERP, CRM, etc.)
26. overkill - scope, time, productivity, learning
time pressure
unclear added value (why?)
more dynamic than required - complication, productivity
loss
customer/stakeholder requests a framework
not required, like
static presentation e.g. opening hours, menu, contacts
30. Swiss-army command-line interface & ember's killer feature
out-of-the-box project scaffold via:
blueprint generator:
auto-rebuild when file changes & live-reload
transpile (ES6, sass, less, coffee)
minify, concat
$ ember new myprojectname
$ ember generate component mycomponent
31. managed dependencies | package.json, bower.json
single point of configuration: Brocfile.js
configurable build profiles:
dev , test , production , ci , ...
broccoli: fast, reliable asset pipeline, constant-time
rebuilds
easy import of 3rd party libraries
ember-cli-addon / export and import support for
fragments, project, 3rd party addons etc
$ bower install save moment
app.import('bower_components/moment/moment.js');
33. default project layout is not ideal (solution: pods)
adjusting to ember-cli wasn't trivial before version 0.1.0
different DI mechanism than Java
ember plays great with viz technologies svg (d3), canvas
34. we gave suggestions for improvements, still in progress :(
we expected i18n, currently only as 3rd party lib
result of build can't be split into desired artifacts
this is a good requirement for server side rendering, to
avoid adding business logic in client code
37. sketch idea first (whiteboard/draw.io), code later
make POCs before you invest a lot of effort...
try to spent few days, or a week developing some small
functionality with a framework and check if you're are
comfortable
38. DON'T FORGET TO WRITE UNIT TESTS
There is no excuse to not write unit tests,
just your laziness.
40. PROS
community, contributions, ecosystem - github, irc, forum
conventions - speeds up development, minimize faults
multiplatform support (browser, iOS/android, phone)
41. PROS
ES6, ES7 syntax support via babel.js
TDD support for unit & acceptance tests, testem, CI
Mature API (2.0 soon)
Batteries included - a lot functionality is ready for use
42. PROS
dozens of ember-cli addons will save time & bugs
backend agnostic (node, java, ruby, php, python, .net?)
ready for Functional reactive programming (RxJS)
43. CONS
learning takes longer
QUnit as default test-framework (see ember-cli-mocha!)
lazy loading of custom (route/template/model) is N/A
44. CONS
attention intensive / you need to check what's going on
absence of out-of-the-box i18n support
modifications are nontrivial - custom test runner, task
runner, test framework
46. BECAUSE:
DevX - intuitive, clean code, COC, DRY, KISS
Stability without stagnation principle
Tooling ember-cli & ember inspector
Is organized into 14D releases, many new features
Makes common tasks easy to complete (screen, widget)
Ember has vision, roadmap, architecture
49. AND MORE
ember 2.0
Server Side Rendering / SSR via Fastboot
Ember Services / Improved DI
HATEOAS powered dynamic app generation
Ember RFCs - github.com/emberjs/rfcs