Conversation
ac9dccd
to
535c692
Compare
Just looking at these changes, it's not obvious to me where the performance improvement comes from. I was wondering if you could elaborate on that or maybe point me toward something I could read. |
The factoryFor method seems to be way faster, according with the release notes of 2.12. |
The factory for RFC outlines the perf benefits. The short version is that Ember no longer has to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The call to owner._lookupFactory in getFlattenedTranslations() also needs to be updated.
535c692
to
d5caa54
Compare
@bwbuchanan Added |
addon/utils/locale.js
Outdated
let translations; | ||
if (owner.factoryFor) { | ||
let maybeTranslations = owner.factoryFor(`locale:${id}/translations`); | ||
translations = translations && translations.class; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be translations = maybeTranslations && maybeTranslations.class;
d5caa54
to
2531035
Compare
Looks good. My app's tests are green. |
Actually mine had so many deprecations that tests broke because travis cannot handle a log that big. Gives how much this addon used this feature that is why I hope the perf boost will nice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I flagged a couple examples, but generally speaking we need to just use the factory object that is returned by factoryFor
and not call .class on it.
Happy to take another look once that is updated...
addon/services/i18n.js
Outdated
let owner = getOwner(this); | ||
let ENV; | ||
if (owner.factoryFor) { | ||
ENV = owner.factoryFor('config:environment').class; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, we should return the object returned by factoryFor (not the .class property)
addon/utils/add-translations.js
Outdated
let existingTranslations; | ||
if (owner.factoryFor) { | ||
let maybeTranslations = owner.factoryFor(key); | ||
existingTranslations = maybeTranslations && maybeTranslations.class; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove .class
Feedback applied. |
2531035
to
5586bda
Compare
cd70ed1
to
b1cf707
Compare
This removes deprecations and should have a very positive perf outcome
b1cf707
to
fe39fa2
Compare
This removes deprecations and should have a very positive perf outcome in Ember 2.12