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

推荐订阅源

G
Google Developers Blog
S
Schneier on Security
The Hacker News
The Hacker News
P
Proofpoint News Feed
Spread Privacy
Spread Privacy
L
LINUX DO - 热门话题
L
Lohrmann on Cybersecurity
I
Intezer
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Schneier on Security
Schneier on Security
Security Latest
Security Latest
AWS News Blog
AWS News Blog
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
有赞技术团队
有赞技术团队
博客园 - 叶小钗
The Last Watchdog
The Last Watchdog
O
OpenAI News
月光博客
月光博客
Hacker News: Ask HN
Hacker News: Ask HN
阮一峰的网络日志
阮一峰的网络日志
S
Security @ Cisco Blogs
Google Online Security Blog
Google Online Security Blog
云风的 BLOG
云风的 BLOG
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Latest news
Latest news
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
M
MIT News - Artificial intelligence
Google DeepMind News
Google DeepMind News
P
Proofpoint News Feed
C
CERT Recently Published Vulnerability Notes
Apple Machine Learning Research
Apple Machine Learning Research
U
Unit 42
PCI Perspectives
PCI Perspectives
博客园 - 聂微东
SecWiki News
SecWiki News
宝玉的分享
宝玉的分享
Forbes - Security
Forbes - Security
H
Heimdal Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Troy Hunt's Blog
博客园 - 三生石上(FineUI控件)
Application and Cybersecurity Blog
Application and Cybersecurity Blog
罗磊的独立博客
WordPress大学
WordPress大学
D
Darknet – Hacking Tools, Hacker News & Cyber Security

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.17/18 Released
2015-05-21 · via Ember.js Blog

– By Stanley Stuart

Beta.17 and Beta.18 contained many bugfixes from the community! Please check them out in the CHANGELOG. Thank you to everyone who submitted patches!

While many bugs were stomped, some important changes are worth calling out:

(Possibly) Breaking Deprecations

record.constructor.typeKey is now record.constructor.modelName

In Ember Data, when you ask for a model, Ember Data looks its class up using Ember's Dependency Injection API. When the model class is looked up, Ember Data stores the type on the model class.

For example, when the following code runs in your application:

var post = this.store.getById('post', 1);

and Ember Data will store the string "post" on the model class:

console.log(post.constructor.typeKey); // 'post'

Ember Data uses this typeKey property internally when creating and extracting payloads in Serializers, and when locating models in Adapters. The typeKey is also currently available on Snapshots, which are passed to adapter and serializer methods. typeKey was previously always normalized to be a camelCased string.

In Ember Data 1.0.0-beta.18, this property is now called modelName. In addition, the modelName is a dasherized string. For example, if you had a model called TacoShop, it would be stored on the model's constructor's modelName property as taco-shop, whereas previously it would be stored as tacoShop.

Accessing the typeKey property should still work, but will trigger deprecation warnings.

If you don't have any custom serializers or adapters, you are good to go; outgoing payloads and URLs shouldn't change. If you've overridden a method in your subclass, remember to call this._super, or to normalize modelName in your code. If you need to transform this string, you can use Ember.String's camelize and underscore functions. Keep in mind you can't change modelName on the model's constructor; it is read-only and will trigger an assertion error if you try to override it.

We changed typeKey to modelName to allow us to align to dasherized strings as Ember and Ember CLI also align with dasherized strings. Changing the name allows us to make this change with a deprecation phase.

DS.RESTSerializer.typeForRoot is now DS.RESTSerializer.modelNameFromPayloadKey

To gain more consistency in the naming change of typeKey to modelName, typeForRoot has been renamed to modelNameFromPayloadKey. The function serves the same purpose, so this should be a quick refactor you can achieve via search and replace in your project. While calling typeForRoot will trigger a deprecation warning, overriding in a subclass won't.

New Features

DS.RESTSerializer.payloadKeyFromModelName

While modelNameFromPayloadKey returns a model for a JSON payload key, payloadKeyFromModelName can be used to override the serialization of a model to the server. For instance, you may have a Post model, but your server expects a message as the root. You can override it like so:

// app/serializers/application.js
export default DS.RESTSerializer.extend({
  payloadKeyFromModelName: (modelName) {
    if (modelName === 'post') {
      return 'message';
    }
    return this._super(modelName);
  }
});

This would produce the following payload:

{
  "message": {
    "id": "1",
    "title": "Action Cable comes with 3 Months of Free HBO"
  }
}

Another example is that ActiveModelSerializer uses this hook to convert a dasherized modelName to an under_scored string.

While this was possible previously in Ember Data, we noticed that users used several different hooks to achieve this goal, so it made sense to make one unifying place for this kind of serialization.

store.unloadAll() can now unload all models when not passed a modelName

Previously, store.unloadAll required a modelName argument to unload records of a type. Now, you can unload all records without calling store.destroy. Thanks to svox1 for this pull request!

DS.RESTAdapter.buildURL refactored into different hooks

buildURL has been refactored into several hooks like urlForFindQuery. This makes overriding methods like buildURL easier to reason about and easier to change without breaking other request types. Thanks to thejameskyle for taking on this refactor!

While beta.17 did introduce a regression, this has been fixed in beta.18.