Software:Ember.js

From HandWiki
Revision as of 15:48, 14 February 2024 by Jworkorg (talk | contribs) (update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Ember.js
Ember.js logotype
Original author(s)Yehuda Katz
Developer(s)Ember Core Team
Initial release8 December 2011; 12 years ago (2011-12-08)
RepositoryEmber.js Repository
Written inJavaScript
Operating systemCross-platform
TypeJavaScript library
LicenseMIT License[1]
Websiteemberjs.com

Ember.js is an open-source JavaScript web framework that utilizes a component-service pattern. it is designed with the aim of allowing developers to create scalable single-page web applications by incorporating common idioms, best practices, and patterns from other single-page-app ecosystem patterns into the framework.[2]

Ember is used on many websites including HashiCorp, DigitalOcean, Apple Music, Square, Inc., Intercom, Discourse, Groupon, LinkedIn, Live Nation, Ghost, Nordstrom, and Twitch.[3][4][5] Although primarily considered a framework for the web, it is also possible to build desktop and mobile applications with Ember when utilizing a hybrid app pattern.[6][7][8] The most notable example of an Ember desktop application is Apple Music, a feature of the iTunes desktop application.[9]

The Ember trademark is owned by Tilde Inc.[10]

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.[11][12] The framework was created by Yehuda Katz, a member of the jQuery, Ruby on Rails and SproutCore core teams.

Design

According to the company, Ember was designed around four key ideas:

Web applications
Ember sets out to provide a solution to the client-side application problem.[citation needed]
More productivity
Ember is one component of a set of tools to provide a development stack. Ember CLI provides an application structure and build pipeline with add-on.[13][14]
Stability
Ember aims to prioritize backward compatibility and allow it to be maintained while still evolving the framework.[15]
Future web standards
Ember was an adopter of standards around JavaScript and the web, including promises, web components and ES6 syntax.[16][17] Yehuda Katz, one of Ember's co founders, is a member on TC39, which is the committee responsible for future versions of the JavaScript language.[18]

Like Ruby on Rails, Ember follows convention over configuration (CoC), and the don't repeat yourself (DRY) principle.[19] It has been described as a highly opinionated framework built to be very flexible.[20]

Concepts

According to the company, Ember consists of five key concepts:[21]

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.[22] While one can use window.fetch 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.)[23]
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.[24]
Services
Services are just singleton objects to hold long-lived data such as user sessions.[25]
Ember also provides dependency injection, declarative one-way data-flow, tracked properties, and automatically updating templates.[26]

Ember software / Addons

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, running the command ember new <app-name> generates a new Ember app with the default stack.[27] This provides:

  • A standard file and directory structure
  • Development server with live reload
  • A testing framework[28]
  • Dependencies managed via npm.[29]
  • ES6/ES7+ syntax support (using Babel)
  • Asset management (including combining, minifying, and versioning)[30]

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.[31]
  • Addons which provide the ability to extend the features of Ember CLI.[32] Addons are installed by typing ember install <addon-name>. Around two thousand addons are currently available (as of 2018)[33] including addons for CoffeeScript, LESS, Sass, Compass and Mocha.[34]

Ember Data

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

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,[37] provided certain conventions are followed.[38] However it is also configurable and can work with servers through the use of adapters and addons.[39] JSON API has server library implementations for PHP, Node.js, Ruby, Python, Go, .NET and Java.[40] Connecting to a Java-Spring-based server is also documented.[41]

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

Ember Inspector

The Ember Inspector is an extension currently available for the Mozilla Firefox and Google Chrome web browsers for debugging Ember applications.[43][44] 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 one's application's objects from the console.[45] If Ember Data is used, one can also see the records loaded for each model.

  • The Object Inspector allows viewing and editing of 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 shows the models in the application and the records loaded for each model.
  • The Info tab displays dependency versions.
  • The Deprecations tab allows for stack traces of deprecation warnings that do not trigger exceptions.
  • The Promises tab allows for the tracing of code through asynchronous operations.
  • The Container tab is used to check which objects have been loaded.
  • The Render Performance tab is for determining what is slowing down an Ember application.

Fastboot

Fastboot is an Ember CLI add-on created by the Ember core team that gives Ember developers the ability to run their apps in Node.js. This feature allows end users to see HTML and CSS right away, with the JavaScript downloading in the background and taking over once it has fully loaded.[46]

Liquid Fire

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

Release process

See the releases blog for the full list of releases and detailed changelog.

Release cycle

Ember follows a six-week release cycle, inspired by the rapid release cycle of Google Chrome.[49]

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

Upgrading and backward compatibility

Ember follows the semantic versioning convention.[51] In particular, breaking changes are only introduced at significant 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 APIs are introduced. Tooling was also under development in 2015 to help streamline the upgrade process.[52]

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 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.[53]

Future development

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

  • Engines. Engines allow multiple logical applications to be composed together into a single application from the user's perspective. Currently released as an experimental add-on.[56][57]
  • Release cycle improvements. Among other things, it proposes changes to Ember CLI to support "svelte builds", which will strip out deprecated and unused features.[58]
  • Outlet Focusing. Making Ember accessible by default. This RFC aims to improves the user experience for people using screen readers.[59]

Sponsorship

Unlike other projects such as AngularJS (Google) and React (Facebook) which have the backing of one main company, Ember.js has a variety of sponsors and backers. These include users of the framework such as Yahoo!, LinkedIn and Bustle.[60][61]

References

  1. "ember.js/LICENSE" (in en). https://github.com/emberjs/ember.js/blob/master/LICENSE. 
  2. Aghassipour, Alexander; Chacko, Shajith (30 Nov 2012). "Enterprise Apps Are Moving To Single-Page Design". TechCrunch. https://techcrunch.com/2012/11/30/why-enterprise-apps-are-moving-to-single-page-design/. 
  3. "Building With Ember.js at Groupon". http://www.talentbuddy.co/blog/building-with-ember-js-at-groupon/. 
  4. "Discourse-Built with Ember.js". https://github.com/discourse/discourse#built-with. 
  5. "Intercom". http://intercom.com. 
  6. "Ember-Write Once, Run Everywhere". 5 Jul 2015. https://github.com/truenorth/MWDCON-example#write-once-run-everywhere. 
  7. "Build better desktop apps with Ember". 5 Jul 2015. https://speakerdeck.com/brzpegasus/build-better-desktop-apps-with-ember. 
  8. "Wicked Good Ember 2015 talk - Build better desktop apps with Ember, video". 5 Jul 2015. http://confreaks.tv/videos/wickedgoodember2015-build-better-desktop-apps-with-ember. 
  9. "Built with ember - Apple Music". http://builtwithember.io/featured/2015/07/04/apple-music/. 
  10. "Ember.js: Legal" (in en). https://emberjs.com/legal/. 
  11. "SproutCore 2.0 becomes Ember.js". The H. 13 Dec 2011. http://www.h-online.com/open/news/item/SproutCore-2-0-becomes-Ember-js-1394362.html. 
  12. "Amber.js (formerly SproutCore 2.0) is now Ember.js". yehudakatz.com. 12 Dec 2011. http://yehudakatz.com/2011/12/12/amber-js-formerly-sproutcore-2-0-is-now-ember-js/. 
  13. "Ember CLI". https://cli.emberjs.com/. 
  14. "Ember Addons". https://www.emberobserver.com/. 
  15. Asay, Matt (4 November 2014). "Innovating Fast And Slow: EmberJS Insists, "We Don't Need To Break The Web"". http://readwrite.com/2014/11/04/emberjs-javascript-framework-we-dont-need-to-break-the-web. 
  16. "JavaScript Promises". https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise. 
  17. "Web Components". http://webcomponents.org/. 
  18. "TC39: Members". http://tc39wiki.calculist.org/about/people/. 
  19. "What we've learnt from Ember.js after 2 months developing our new product.". 16 December 2014. http://getsolid.io/blog/what-weve-learn-from-ember-js-after-2-months-developing-our-new-product-a-solid-story/. 
  20. "Top Reasons Why Industry Experts Use Ember.js And How You Can Adopt It Yourself". http://www.talentbuddy.co/blog/top-reasons-why-industry-experts-use-ember-js-and-how-you-can-adopt-it-yourself/. 
  21. Frank Treacy. "5 Essential Ember 2.0 Concepts You Must Understand". http://emberigniter.com/5-essential-ember-2.0-concepts/. 
  22. "Ember.js - Models: Introduction". http://emberjs.com/guides/models/. 
  23. Jackson, Robert. "HTMLBars". https://github.com/tildeio/htmlbars. 
  24. "How To Add Polymer To Your Ember Project". 27 March 2015. http://www.programwitherik.com/how-to-add-polymer-to-your-ember-project/. 
  25. "Ember Services Tutorial". 26 July 2015. http://www.programwitherik.com/ember-services-tutorial/. 
  26. Bango, Rey (14 Mar 2013). "Getting Into Ember.js". Nettuts+. http://net.tutsplus.com/tutorials/javascript-ajax/getting-into-ember-js/. 
  27. "Ember CLI". https://cli.emberjs.com. 
  28. "Ember testing". https://guides.emberjs.com/release/testing/. 
  29. "Ember CLI-managing dependencies". https://cli.emberjs.com/release/basic-use/assets-and-dependencies/. 
  30. "Ember CLI asset compilation". https://cli.emberjs.com/release/advanced-use/asset-compilation/. 
  31. "Ember CLI Blueprints". https://cli.emberjs.com/release/advanced-use/blueprints/. 
  32. "Ember CLI Writing Addons". https://cli.emberjs.com/release/writing-addons/. 
  33. "Ember Addons directory". emberobserver.com. https://www.emberobserver.com/. 
  34. "Ember CLI Overview". https://cli.emberjs.com/release/. 
  35. "Ember Data README". https://github.com/emberjs/data/blob/master/README.md. 
  36. "Ember without Ember Data". Evil Trout. 23 March 2013. http://eviltrout.com/2013/03/23/ember-without-data.html. 
  37. "JSON API specification". http://jsonapi.org/. 
  38. "Ember.js Models". http://guides.emberjs.com/v1.12.0/models/. 
  39. "Ember Observer-Data". http://emberobserver.com/categories/data. 
  40. "JSON API implementations". http://jsonapi.org/implementations/. 
  41. "Integrating Ember.js with the Spring Framework". 20 August 2014. http://springember.blogspot.com.au/2014/08/using-ember-data-restadapter-with.html. 
  42. "Ember Data 1.13 release". 18 June 2015. http://emberjs.com/blog/2015/06/18/ember-data-1-13-released.html. 
  43. "Firefox Addons - Ember Inspector". Mozilla. https://addons.mozilla.org/en-us/firefox/addon/ember-inspector/. 
  44. "Chrome Web Store - Ember Inspector". Chrome Web Store. https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi. 
  45. "Ember Inspector". Ember.js. http://guides.emberjs.com/v1.13.0/ember-inspector/installation/. 
  46. "Inside Fastboot. Faking the DOM in node". 8 January 2015. http://emberjs.com/blog/2015/01/08/inside-fastboot-faking-the-dom-in-node.html. 
  47. "Liquid Fire: Animations & Transitions for Ember Apps". https://ember-animation.github.io/liquid-fire/. 
  48. "Animations in Ember.js with liquid-fire". airpair.com. https://www.airpair.com/ember.js/posts/animations-in-emberjs-with-liquidfire. 
  49. "New Ember release process". 6 September 2013. http://emberjs.com/blog/2013/09/06/new-ember-release-process.html. 
  50. "Ember Project at 2.0". 16 June 2015. http://emberjs.com/blog/2015/06/16/ember-project-at-2-0.html. 
  51. "Ember API Freeze". 18 January 2013. http://emberjs.com/blog/2013/01/18/this-week-in-ember-js-4.html#toc_api-freeze. 
  52. "Ember Watson Addon". https://www.npmjs.com/package/ember-watson. 
  53. "Angular 2.0 announcement". 29 October 2014. http://jaxenter.com/angular-2-0-announcement-backfires-112127.html. 
  54. "Ember core team meeting minutes". https://github.com/emberjs/core-notes/tree/master/ember.js. 
  55. "Ember RFC process". https://github.com/emberjs/rfcs. 
  56. "Ember Engines". https://www.npmjs.com/package/ember-engines. 
  57. "Engines". http://emberjs.com/blog/2016/01/23/core-team-face-to-face-january-2016.html#toc_engines. 
  58. "Refining the Release Process RFC". https://github.com/emberjs/rfcs/blob/master/text/0056-improved-release-cycle.md. [yes|permanent dead link|dead link}}]
  59. "Outlet Focusing RFC". https://github.com/nathanhammond/rfcs/blob/master/text/0000-outlet-focusing.md. 
  60. "Ember sponsors". http://emberjs.com/sponsors/. 
  61. "Interview with Mike North, Principal Software Engineer, Yahoo". https://emberweekend.com/episodes/componentize-all-the-things. 

Further reading

External links