惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
Webroot Blog
Webroot Blog
AI
AI
P
Palo Alto Networks Blog
Attack and Defense Labs
Attack and Defense Labs
WordPress大学
WordPress大学
月光博客
月光博客
阮一峰的网络日志
阮一峰的网络日志
Spread Privacy
Spread Privacy
T
Tor Project blog
罗磊的独立博客
小众软件
小众软件
S
Security Affairs
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
Apple Machine Learning Research
Apple Machine Learning Research
T
Threatpost
NISL@THU
NISL@THU
博客园_首页
PCI Perspectives
PCI Perspectives
大猫的无限游戏
大猫的无限游戏
IT之家
IT之家
N
News and Events Feed by Topic
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Forbes - Security
Forbes - Security
博客园 - 叶小钗
D
Darknet – Hacking Tools, Hacker News & Cyber Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
L
LINUX DO - 热门话题
T
Threat Research - Cisco Blogs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
Security Latest
Security Latest
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
The Cloudflare Blog
A
About on SuperTechFans
爱范儿
爱范儿
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
TaoSecurity Blog
TaoSecurity Blog
宝玉的分享
宝玉的分享
G
GRAHAM CLULEY
雷峰网
雷峰网
F
Full Disclosure
I
Intezer
Cloudbric
Cloudbric
博客园 - 三生石上(FineUI控件)
U
Unit 42

Ember.js Blog

Ember 7.0 Released Announcing the Official TypeScript Types Public Preview Accessibility Working Group Update The 2020 Ember Roadmap Countdown to The New Year - Built-in Addons Countdown to The New Year - Ember Exam Countdown to The New Year - Ember Code Snippet Countdown to The New Year - Ember Changeset Countdown to The New Year - Ember In Viewport Countdown to The New Year - Ember CLI Update Countdown to The New Year - Ember Template Invocation Location Countdown to The New Year - Ember CLI TypeScript Countdown to The New Year - Ember Bootstrap and Ember Paper Countdown to The New Year - Ember CSS Modules Countdown to The New Year - Ember Mapbox GL Countdown to The New Year - Ember Shepherd Countdown to The New Year - Ember Template Lint Countdown to The New Year - Ember Composable Helpers Countdown to The New Year - Ember Leaflet Countdown to The New Year - Ember Intl Countdown to The New Year - Ember Test Selectors Countdown to The New Year - Ember Power Select Countdown to The New Year - Ember Simple Auth Countdown to The New Year - Ember SVG Jar Countdown to The New Year - Ember Page Title Countdown to The New Year- Ember A11Y Testing Countdown to The New Year - Ember Angle Brackets Codemod Countdown to The New Year - Ember CLI Sass Countdown to The New Year - Ember Animated Countdown to The New Year - Ember Auto Import Countdown to The New Year - Ember Concurrency Countdown to The New Year - Ember Tether Countdown to The New Year - Ember Modifier Countdown to The New Year - Ember CLI Mirage Countdown to The New Year - Ember Sortable Coming Soon in Ember Octane - Part 5: Glimmer Components Coming Soon in Ember Octane - Part 4: Modifiers Coming Soon in Ember Octane - Part 3: Tracked Properties Coming Soon in Ember Octane - Part 2: Angle Brackets & Named Arguments Preview Weekend: 2019 Ember Community Survey Coming Soon in Ember Octane - Part 1: Native Classes First Annual DecEmber Event! 2018 Ember Community Survey 2017 Ember Community Survey Announcing The Glimmer 2 Alpha Upcoming deprecation of baseURL in Ember CLI 2.7 2016 Ember Community Survey Announcing Ember Core Team Face to Face, January 2016 Ember.js 1.13.0 and 2.0 Beta Released Another Ember 2.x Status Update Ember.js 1.12 and 1.13 Beta (Glimmer!) Released Ember.js 1.11.1 Released Ember.js 1.11.0 and 1.12 Beta Released Ember.js 1.10.0 and 1.11 Beta Released Compiling templates with Ember 1.10 Core Team Meeting Minutes - 2014/08/01 Core Team Meeting Minutes - 2014/08/14 Core Team Meeting Minutes - 2014/09/12 Cleaning Up Github Issues Core Team Meeting Minutes - 2014/07/11 Core Team Meeting Minutes - 2014/07/25 Core Team Meeting Minutes - 2014/06/13 Core Team Meeting Minutes - 2014/06/20 Core Team Meeting Minutes - 2014/06/27 Core Team Meeting Minutes - 2014/06/06 Core Team Meeting Minutes - 2014/04/25 Core Team Meeting Minutes - 2014/04/04 Ember 1.5.0 and 1.6 Beta Released Core Team Meeting Minutes - 2014/03/07 Core Team Meeting Minutes - 2014/03/14 Core Team Meeting Minutes - 2014/03/21 Core Team Meeting Minutes - 2014/02/28 Core Team Meeting Minutes - 2014/02/21 Core Team Meeting Minutes - 2014/02/14 Ember 1.4.0 and 1.5 Beta Released Core Team Meeting Minutes - 2014/01/27 Core Team Meeting Minutes - 2014/01/31 Core Team Meeting Minutes - 2014/02/07 Core Team Meeting Minutes - 2014/01/17 Core Team Meeting Minutes - 2014/01/03 Ember 1.3.0 and 1.4 Beta Released Core Team Meeting Minutes - 2013/12/20 Core Team Meeting Minutes - 2013/12/06 Ember 1.2.0 and 1.3 Beta Released Ember 1.1.2 Released Ember 1.1.1 and 1.2 Beta Released Ember 1.0 Released Ember 1.0 RC8 Released Ember 1.0 RC7 Released Ember 1.0 RC6.1, RC5.1, RC4.1, RC3.1, RC2.1 RC1.1 Released Ember 1.0 RC6 Ember 1.0 RC5 Ember 1.0 RC4 Ember 1.0 RC3 Announcing the Ember.js Security Policy Ember 1.0 RC2 Ember 1.0 RC Ember 1.0 Prerelease 2 Ember 1.0 Prerelease
Ember Data v1.0.0-beta.9 Released
2014-08-18 · via Ember.js Blog

Since Ember Data v1.0.0-beta.8, a lot has changed. Since we didn't write a blog post for beta.8, this blog post will contain features in both beta.8 and beta.9.

New Release Schedule

Since the first beta release for Ember Data 1.0, Ember Data has typically been released when we felt like critical features or bugfixes were merged. Due to the ever changing nature of Ember Data, we'd like to reward Ember Data users for keeping up with changes by providing more frequent releases until a release candidate emerges. Beginning Monday, August 18th 2014, Ember Data will release a new beta version every 3 weeks. The builds will be available on the builds page, Bower, Rubygems, and soon, NPM.

Breaking Changes

Object.create shim required

Ember Data now requires an Object.create polyfill for environments without Object.create or incorrect Object.create implementations such as Internet Explorer 8. Ember.js will be shipping with an Object.create polyfill in 1.8.0. If you are using stable builds of Ember, we recommend using ES5Shim's es5-sham.js file available on NPM and Bower. You can refer to Kangax's Compatibility Tables to see if you need the shim.

Ember Data uses Object.create under the hood for faster and collision-free caches.

Dates Serialized with ISO8601 by Default

Due to the various ways dates can be serialized across the wire, Ember Data has decided to use the well-known, well-supported, and accurate ISO8601 format. Although the JavaScript programming language has had support for ISO8601 strings since ECMAScript5, environment such as Internet Explorer 8 do not support Date.prototype.toISOstring. However, Ember Data does include a shim so you need no further work here except to make sure your backend is supporting ISO8601.

RESTAdapter.prototype.findMany changed behavior and method signature

You should see the findMany documentation if you have overridden the findMany method in your adapter.

HasMany Coalescing Now Opt-In

See the section below on "Coalescing Find Requests" for more information. Previously, if you did not sideload data for a hasMany relationship, but did provide IDs, Ember Data would attempt to get all the records in one request.

For example:

// Given this payload:
{
  "author": {
    "id": "1",
    "name": "Lon Ingram",
    "post_ids": ["1", "2", "3"]
  }
}

this.store.getById('author', '1').get('posts');

// $.ajax GET /posts?ids[]=1&ids[]=2&ids[]=3

Unless you opt in, Ember Data will instead fire 3 requests:

this.store.getById('author', '1').get('posts');

// $.ajax GET /posts/1
// $.ajax GET /posts/2
// $.ajax GET /posts/3

See the section below on "Coalescing Find Requests" for more information.

New Features and Improvements

Embedded Records Mixin

Deserializing Relationships

Thanks to Igor Terzic, Brendan Mcloughlin, and Bill Heaton, the DS.EmbeddedRecordsMixin was extracted out of DS.ActiveModelSerializer in Ember Data v1.0.0-beta.8 so that users of JSONSerializer, RESTSerializer, and ActiveModelSerializer could easily serialize and deserialize relationships. To use the code in your app, you can include the EmbeddedRecordsMixin into your serializer:

App.PostSerializer = DS.RESTSerializer.extend(DS.EmbeddedRecordsMixin);

This means that your PostSerializer will now correctly bring in data for relationships if they are embedded in the response, rather than sideloaded.

For example, here is the previous JSON data response Ember Data expected for the RESTAdapter:

// GET /posts/1
{
  "post": {
    "id": "1",
    "name": "The Mother We Share Lyrics",
    "authorId": "1"
  },
  "authors": [
    {
      "id": "1",
      "name": "CHVRCHES"
    }
  ]
}

this.store.find('post', '1').then(function(post){
  console.log(post.get('author.name')); // => CHVRCHES
});

Now, if you mixin the EmbeddedRecordsMixin, Ember Data will understand the following payload:

// GET /posts/1
{
  "post": {
    "id": "1",
    "name": "The Mother We Share Lyrics",
    "author": {
      "id": "1",
      "name": "CHVRCHES"
    }
  }
}

this.store.find('post', '1').then(function(post) {
  console.log(post.get('author.name')); // => CHVRCHES
});

These settings are configurable. See the section below on "Serializing Relationships."

Serializing Relationships

The EmbeddedRecordsMixin also has support for sending information about relationships to the server. To override the defaults, you can configure the EmbeddedRecordsMixin by defining an attrs object on your serializer definition. For example, to serialize the complete record when serializing to the server:

App.PostSerializer = DS.RESTSerializer.extend(DS.EmbeddedRecordsMixin, {
  attrs: {
    author: {
      serialize: 'records'
    }
  }
});

var post = this.store.getById('post', '1');
post.set('name', 'Recover Lyrics');
post.save();

// POST /posts/1
{
  "post": {
    "name": "Recover Lyrics",
    "author": {
      "id": "1",
      "name": "CHVRCHES"
    }
  }
}

To see even more ways to customize serializing and deserializing behavior, check out the documentation for the EmbeddedRecordsMixin.

Coalescing Find Requests

One feature we're particularly excited about is the ability to coalesce find requests for the same record type.

To introduce this feature, I'll explain the basic concept behind Ember.js's "Run Loop". Typically in JavaScript code that re-renders whenever the data changes, changing the data multiple times within the same turn of the JavaScript event loop would cause multiple re-renders. Ember uses a microlibrary called Backburner to reduce the number of writes by only rendering once per "run loop". For more information, you can view the README on the Backburner on the repository and view the Ember.js Run Loop Guide.

Without "Coalescing Find Requests" turned on, the previous code would result in multiple network requests:

this.store.find('post', '1');
this.store.find('post', '2');
this.store.find('post', '3');

// $.ajax GET /posts/1
// $.ajax GET /posts/2
// $.ajax GET /posts/3

On the server-side, this is frequently referred to as an N+1 query.

By coalescing (also known as batching) these requests, Ember Data will observe that you requested several records of the same type and only send one request instead of 3.

this.store.find('post', '1');
this.store.find('post', '2');
this.store.find('post', '3');

// $.ajax GET /posts?ids[]=1&ids[]=2&ids[]=3

Coalescing find requests is currently turned off by default. To turn it on, you can use the following code:

DS.RESTAdapter.reopen({
  coalesceFindRequests: true
});

To override how the records are requested, you may override the findMany and findHasMany methods on your adapter.

Ember Inflector is Now a Standalone Package

Ember Inflector is Ember's approach for a Rails-compatible API for inflecting strings. This provides methods such as Ember.String.pluralize and Ember.String.singularize, and hooks for defining your own inflections. Previously, the Ember Inflector package was contained in Ember Data's repository and released alongside Ember Data. It has been pulled out to a separate repository. Although Ember Inflector is still included in the Ember Data release, you may now use it in projects that do not use Ember Data. Ember Inflector is currently released as a 1.0 semver package.

Ember Inflector String Caching

Ember Inflector now caches lookups of strings by default. This means that you should only pay the cost of transforming a string (via pluralize and singularize) once as the values are now stored using an in-memory cache. If you have memory concerns, you may want to monitor lookups and disable the cache by calling Ember.Inflector.inflector.disableCache() at the beginning of your app code.

Improved Uncountable / Irregular Definitions for Singularize

We would like to express our deep appreciation to Olivia Briggs for adding better support for uncountable/irregular singular words in Ember-Inflector. You should now not need definitions for dasherized and underscore versions of your inflections.

Handlebars Helpers for Inflections

You can now use pluralize and singularize in your Handlebars templates:

{{pluralize "octopus"}}
{{singularize "oxen"}}

The Handlebars helpers are bound, so they will stay up to date if you bind to a property:

{{pluralize type}}

Performance Improvements

Thanks to Stefan Penner from the Ember.js core team, your apps should be faster when used with Ember Data. We'd also like you to try out Ember 1.8 beta in your apps with Ember Data 1.0.0-beta.9 for additional performance improvements.

We have more performance improvements around the corner! Keep an eye out for Stef landing some commits on improving pushPayload calls and a commit to Backburner improving many hot code paths in Ember Data.

Better Support for Nested Records.

buildURL now takes a record, on which you can look up the relationship if you need to build a nested URL. For example:

App.CommentAdapter = DS.RestAdapter.extend({
  buildURL: function(type, id, record) {
    return '/posts/' + record.get('post.id') + '/comments/' + id;
  }
})

Added support for preloading records

For more information, go to Store documentation.

Special Thanks

We'd like to thank the following members of the Ember.js community for their continued contributions to Ember Data:

  • Igor Terzic as the project's main contributor (@terzicigor)
  • Brendan McLoughlin (@BezoMaxo) for responding to and triaging issues, and contributing documentation, bug fixes, and improvements.
  • Ilya Radchenko (@knownasilya)
  • Bradley Priest (@bradleypriest)
  • Bill Heaton (@pixelhandler)
  • Paul Chavard (@tchak)
  • Sylvain Mina (GH @sly7-7)
  • Ryunosuke Sato (@tricknotes)
  • Alexandre de Oliveira (@kurko) for his awesome work on the ember-localstorage-adapter and ember-indexeddb-adapter.
  • Jonathan Collins (Github @jcollins1991)
  • Stefan Penner (@stefanpenner)
  • Tom Dale (@tomdale)
  • Yehuda Katz (@wycats)

We’d also like to thank Instructure and PrecisionNutrition for sponsoring some of Igor’s development on Ember Data.