Ember.js

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

Lua error in package.lua at line 80: module 'strict' not found.

Ember.js
Ember.js logo
Original author(s) Yehuda Katz
Developer(s) Ember Core Team
Initial release 8 December 2011; 12 years ago (2011-12-08)
Stable release 2.4.3 / March 17, 2016; 8 years ago (2016-03-17)
Development status Active
Written in JavaScript
Operating system Cross-platform
License MIT License
Website <strong%20class= "error"><span%20class="scribunto-error"%20id="mw-scribunto-error-2">Lua%20error%20in%20Module:Wd%20at%20line%20405:%20invalid%20escape%20sequence%20near%20'"^'. http://<strong%20class="error"><span%20class="scribunto-error"%20id="mw-scribunto-error-2">Lua%20error%20in%20Module:Wd%20at%20line%20405:%20invalid%20escape%20sequence%20near%20'"^'.Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).

Ember.js is an open-source JavaScript web framework, based on the Model–view–viewmodel (MVVM) pattern. It allows developers to create scalable single-page web applications[1] by incorporating common idioms and best practices into the framework.

Ember is used on many popular websites, including Discourse,[2] Groupon,[3] Vine, Live Nation, Nordstrom, and Chipotle.[4] Although primarily considered a framework for the web, it is also possible to build desktop and mobile applications in Ember.[5][6][7] The most notable example of an Ember desktop application is Apple Music,[8] a feature of the iTunes desktop application.

In November 2015 ember-cli was downloaded over 200,000 times from its npm repository.[9]

Philosophy and design

From the beginning Ember was designed around several key ideas:

Focus on ambitious web applications
Ember sets out to provide a wholesale solution to the client-side application problem. This is in contrast to many Javascript frameworks that start by providing a solution to the V in MVC, and attempt to grow from there.
More productive out of the box
Ember is one component of a set of tools that work together to provide a complete development stack. The aim of these tools is to make the developer productive immediately. For example Ember CLI,[10] provides a standard application structure and build pipeline. It also has a pluggable architecture and over two thousand addons to enhance and extend it.
Stability without stagnation
This is the idea that backward compatibility is important and can be maintained while still innovating and evolving the framework.[11]
Future web standards foresight
Ember has been an early adopter and pioneer of many standards around Javascript and the web including promises,[12] web components[13] and ES6 syntax. Yehuda Katz, one of Ember's cofounders, is a member on TC39, which is the committee responsible for future versions of the Javascript language.[14]

Like Ruby on Rails, Ember follows Convention over Configuration (CoC), and the Don't Repeat Yourself (DRY) principle.[15] It has been described as a highly opinionated framework built to be very flexible.[16]

Basic concepts

Ember consists of five key concepts:[17]

Routes
In Ember, the state of an application is represented by a URL. Each URL has a corresponding route object that controls what is visible to the user.
Models
Every route has an associated model, containing the data associated with the current state of the application.[18] While one can use jQuery to load JSON objects from a server and use those objects as models, most applications use a model library such as Ember Data to handle this.
Templates
Templates are used to build the application's HTML and are written with the HTMLBars templating language. (HTMLBars is a variation of Handlebars that builds DOM elements rather than a String.)[19]
Components
A component is a custom HTML tag. Behavior is implemented using JavaScript and its appearance is defined using HTMLBars templates. Components "own" their data. They can also be nested and can communicate with their parent components through actions (events). Other component libraries such as Polymer can also be used with Ember.[20]
Services
Services are just singleton objects to hold long-lived data such as user sessions.[21]

Note: In Ember 2.0, components and services implement the functionality previously handled by views and controllers.[22]

Ember also provides dependency injection, declarative two-way data binding, computed properties, and automatically-updating templates.[23]

Ember 2.0

Ember 2.0 was released August 13, 2015.[24] The guiding principles for the release were simplification and stability without stagnation.[25] The biggest changes occur in the view layer and include:

  • One way data flow by default. (Referred to as "data down, actions up".[26])
  • "Just refresh it" when something changes.
  • Standard lifecycle hooks for components.

Another major change was the introduction of the Glimmer rendering engine with the aim of improving re-render performance. Glimmer adopts a value-diffing strategy, using a virtual tree of the dynamic areas of the document object model (DOM), similar to React.[27] A number of benchmarks illustrating the speedup in performance have been published.[28]

Since version 1.8 new features identified for 2.0 have been shipped when ready on the 1.x branch, while still maintaining backward compatibility. Features due to be removed in 2.0 have been deprecated. This means that 1.13 contains virtually all 2.0 changes, with 2.0 mainly being about removing deprecated features from the code base.[29] In many cases the removed code is still available in addons.[30]

Ember Software Stack

Ember.js is one component of a complete front end stack built and supported by the Ember core team.

Ember CLI

Ember-cli aims to bring convention over configuration to build tools. A command line utility based on broccoli,[31] running the command ember new <app-name> generates a new Ember app with the default stack. This provides:

  • A standard file and directory structure.
  • Development server with live reload. Out of the box this will automatically rebuild apps incrementally whenever files are changed, and then reload the app in any open browser tabs.
  • A complete testing framework.[32]
  • Dependencies managed via bower and npm.[33]
  • ES6 modules.[34]
  • ES6/ES7+ syntax support (using Babel).
  • Asset management (including combining, minifying, and versioning).[35]

Other features include:

  • Blueprints, which are code generators for creating models, controllers, components, and so on that are needed in an application. Custom blueprints can also be created.[36]
  • Addons which provide the ability to extend the features of Ember CLI.[37] Addons can be installed by typing ember install <addon-name>. Over two thousand addons are currently available[38] including addons for CoffeeScript, LESS, Sass, Compass and Mocha.[39]

Ember CLI replaces the deprecated Ember App Kit.[40]

Ember Data

Most Ember applications use Ember Data,[41] a data-persistence library providing many of the facilities of an object-relational mapping (ORM). However it is also possible to use Ember without Ember Data.[42]

Ember Data maps client-side models to server-side data. It can then load and save records and their relationships without any configuration via a RESTful JSON API that implements the JSON API specification,[43] provided certain conventions are followed.[44] However it is also easily configurable and can work with any server through the use of adapters and addons.[45] JSON API has server library implementations for PHP, Node.js, Ruby, Python, Go, .NET and Java.[46] Connecting to a Java-Spring based server is also documented.[47]

The first stable version of Ember Data (labelled 1.13 to align with Ember itself) was released on 18 June 2015.[48]

Ember Inspector

The Ember Inspector is an extension currently available for the Mozilla Firefox[49] and Google Chrome[50] web browsers that claims to make debugging Ember applications easier. Features include the ability to see which templates, components, and views are currently rendered, see the properties of any Ember object with a UI that computes bindings and computed properties, and access your application's objects from the console.[51] If Ember Data is used, one can also see the records loaded for each model.

  • The Object Inspector allows you to view and edit the runtime contents of Ember Objects and Classes.
  • The View Tree visually displays the structure of the rendered Ember application.
  • The Routes tab allows one to determine and follow the router state and the urls used to represent routes.
  • The Data tab can show you the models in your application and records loaded for each model.
  • The Info tab displays versions of your dependencies.
  • The Deprecations tab allows for getting stacktraces of deprecation warnings that do not trigger exceptions.
  • The Promises tab allows for tracing of code through asynchronous operations.
  • The Container tab is useful for checking which objects have been loaded.
  • The Render Performance tab is for determining what is slowing down your Ember application.

Fastboot

Fastboot is an Ember CLI addon created by the Ember core team that gives Ember developers the ability to run their apps in Node.js. Currently in alpha,[52] once complete, this feature will allow end users to see HTML and CSS right away, with the JavaScript downloading in the background and taking over once it has fully loaded.[53]

Liquid Fire

Liquid Fire provides animation support for Ember applications.[54] Features include animated transitions between routes and between models within a single route. It provides a DSL for laying out spatial route relationships, cleanly separated from view-layer implementation details. A simple example would be to animate a screen transition, so that the new screen appears to slide in from one edge of the browser.[55]

Release process

Release cycle

Ember follows a six-week release cycle, inspired by the rapid release cycle of Google Chrome.[56] Every six weeks a new release is made available, and at the same time a beta for the next release is also published. Generally several betas are produced before the next major release comes round, roughly one beta per week.

Starting with Ember 2.0, related projects supported by the core team have their releases coordinated, and share a version number with Ember itself.[57]

Upgrading and backward compatibility

Ember follows the semantic versioning convention.[58] In particular this means that breaking changes are only introduced at major version numbers such as 1.0, 2.0 etc. While new features can be added at point releases (1.1, 1.2...), and features deprecated, no breaking changes to the public API's are introduced and upgrading within a major version is designed to be as simple as possible. Tooling is also under development to help streamline the upgrade process.[59]

In addition to this process a number of steps were taken to mitigate issues around upgrading to the 2.0 release:

  • All major 2.0 features were in fact introduced early and spread out over a number of releases in order to reduce many of the issues caused by big-bang upgrades.
  • Most features that were removed are still available through addons.

The process follows the core Ember principle of Stability without Stagnation and is in marked contrast to the upgrade plans of similar projects such as AngularJS.[60]

Future development

Project status can be tracked via the core team meeting minutes.[61] However major changes to Ember go through the Request For Comment process.[62] This gives the Ember community a chance to give feedback on new proposals. Notable RFCs include:

  • Routeable Components.[63] The motivation is to eliminate Controllers.
  • Component unification (Angle brackets).[64] In addition to nicer syntax, they serve as an opt-in for features such as default one-way bindings.
  • Engines.[65] Engines allow multiple logical applications to be composed together into a single application from the user's perspective. Currently released as an experimental addon.[66]
  • Release cycle improvements.[67] Among other things it proposes changes to Ember CLI to support "svelte builds", which will strip out deprecated and unused features.
  • Outlet Focusing.[68] Making Ember accessible by default. This RFC aims to improves the user experience for people using screen readers.

History

In December 2011, the SproutCore 2.0 framework was renamed to Ember.js, to reduce confusion between the application framework and the widget library of SproutCore 1.0.[69][70] The framework was created by Yehuda Katz, a member of the jQuery, Ruby on Rails and SproutCore core teams. Like many of Katz's other projects, it advocates convention over configuration.

Legacy browser support

Support for Internet Explorer 8 is available up to version 1.13, but will be dropped from release 2.0 onwards. Internet Explorer 9 and later will continue to be supported.[71] The core team will continue to periodically publish point releases in the 1.13 series to patch security bugs and browser compatibility issues, including issues in IE8.[72]

Corporate sponsorship

Unlike other projects such as AngularJS (Google) and React (Facebook) which have the backing of one main company, Emberjs has a variety of sponsors. These include Yahoo!,[73] LinkedIn, Addepar and Bustle which are all major users of the framework.[74]

References

  1. Lua error in package.lua at line 80: module 'strict' not found.
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. Lua error in package.lua at line 80: module 'strict' not found.
  4. http://libscore.com/?#Ember
  5. Lua error in package.lua at line 80: module 'strict' not found.
  6. Lua error in package.lua at line 80: module 'strict' not found.
  7. Lua error in package.lua at line 80: module 'strict' not found.
  8. Lua error in package.lua at line 80: module 'strict' not found.
  9. Lua error in package.lua at line 80: module 'strict' not found.
  10. Lua error in package.lua at line 80: module 'strict' not found.
  11. Lua error in package.lua at line 80: module 'strict' not found.
  12. Lua error in package.lua at line 80: module 'strict' not found.
  13. Lua error in package.lua at line 80: module 'strict' not found.
  14. Lua error in package.lua at line 80: module 'strict' not found.
  15. Lua error in package.lua at line 80: module 'strict' not found.
  16. Lua error in package.lua at line 80: module 'strict' not found.
  17. Lua error in package.lua at line 80: module 'strict' not found.
  18. Lua error in package.lua at line 80: module 'strict' not found.
  19. Lua error in package.lua at line 80: module 'strict' not found.
  20. Lua error in package.lua at line 80: module 'strict' not found.
  21. Lua error in package.lua at line 80: module 'strict' not found.
  22. Lua error in package.lua at line 80: module 'strict' not found.
  23. Lua error in package.lua at line 80: module 'strict' not found.
  24. Lua error in package.lua at line 80: module 'strict' not found.
  25. Lua error in package.lua at line 80: module 'strict' not found.
  26. Lua error in package.lua at line 80: module 'strict' not found.
  27. Lua error in package.lua at line 80: module 'strict' not found.
  28. Lua error in package.lua at line 80: module 'strict' not found.
  29. Lua error in package.lua at line 80: module 'strict' not found.
  30. Lua error in package.lua at line 80: module 'strict' not found.
  31. Lua error in package.lua at line 80: module 'strict' not found.
  32. Lua error in package.lua at line 80: module 'strict' not found.
  33. Lua error in package.lua at line 80: module 'strict' not found.
  34. Lua error in package.lua at line 80: module 'strict' not found.
  35. Lua error in package.lua at line 80: module 'strict' not found.
  36. Lua error in package.lua at line 80: module 'strict' not found.
  37. Lua error in package.lua at line 80: module 'strict' not found.
  38. Lua error in package.lua at line 80: module 'strict' not found.
  39. Lua error in package.lua at line 80: module 'strict' not found.
  40. Lua error in package.lua at line 80: module 'strict' not found.
  41. Lua error in package.lua at line 80: module 'strict' not found.
  42. Lua error in package.lua at line 80: module 'strict' not found.
  43. Lua error in package.lua at line 80: module 'strict' not found.
  44. Lua error in package.lua at line 80: module 'strict' not found.
  45. Lua error in package.lua at line 80: module 'strict' not found.
  46. Lua error in package.lua at line 80: module 'strict' not found.
  47. Lua error in package.lua at line 80: module 'strict' not found.
  48. Lua error in package.lua at line 80: module 'strict' not found.
  49. Lua error in package.lua at line 80: module 'strict' not found.
  50. Lua error in package.lua at line 80: module 'strict' not found.
  51. Lua error in package.lua at line 80: module 'strict' not found.
  52. Lua error in package.lua at line 80: module 'strict' not found.
  53. Lua error in package.lua at line 80: module 'strict' not found.
  54. Lua error in package.lua at line 80: module 'strict' not found.
  55. Lua error in package.lua at line 80: module 'strict' not found.
  56. Lua error in package.lua at line 80: module 'strict' not found.
  57. Lua error in package.lua at line 80: module 'strict' not found.
  58. Lua error in package.lua at line 80: module 'strict' not found.
  59. Lua error in package.lua at line 80: module 'strict' not found.
  60. Lua error in package.lua at line 80: module 'strict' not found.
  61. Lua error in package.lua at line 80: module 'strict' not found.
  62. Lua error in package.lua at line 80: module 'strict' not found.
  63. Lua error in package.lua at line 80: module 'strict' not found.
  64. Lua error in package.lua at line 80: module 'strict' not found.
  65. Lua error in package.lua at line 80: module 'strict' not found.
  66. Lua error in package.lua at line 80: module 'strict' not found.
  67. Lua error in package.lua at line 80: module 'strict' not found.
  68. Lua error in package.lua at line 80: module 'strict' not found.
  69. Lua error in package.lua at line 80: module 'strict' not found.
  70. Lua error in package.lua at line 80: module 'strict' not found.
  71. Lua error in package.lua at line 80: module 'strict' not found.
  72. Lua error in package.lua at line 80: module 'strict' not found.
  73. Lua error in package.lua at line 80: module 'strict' not found.
  74. Lua error in package.lua at line 80: module 'strict' not found.

Further reading

  • Lua error in package.lua at line 80: module 'strict' not found. Regularly updated.
  • Lua error in package.lua at line 80: module 'strict' not found. Regularly updated.
  • Lua error in package.lua at line 80: module 'strict' not found.

External links

  • No URL found. Please specify a URL here or add one to Wikidata.
  • ember.js on GitHub
  • Ember on TwitterLua error in Module:WikidataCheck at line 28: attempt to index field 'wikibase' (a nil value).
  • Lua error in package.lua at line 80: module 'strict' not found. The official guide to learn Ember.
  • Lua error in package.lua at line 80: module 'strict' not found.
  • Lua error in package.lua at line 80: module 'strict' not found.
  • Lua error in package.lua at line 80: module 'strict' not found.
  • Lua error in package.lua at line 80: module 'strict' not found.
  • Lua error in package.lua at line 80: module 'strict' not found. Collection of links to Ember resources.
  • Lua error in package.lua at line 80: module 'strict' not found. Weekly newsletter on Ember.
  • Lua error in package.lua at line 80: module 'strict' not found. Short screencasts covering various Ember features.
  • Lua error in package.lua at line 80: module 'strict' not found. Bi-weekly podcast.
  • Lua error in package.lua at line 80: module 'strict' not found. Weekly podcast.