-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make snapshot lazier and fix defaultValue #5428
Conversation
adds an explicit test for laziness during findRecord cleanup test
0dcc8b3
to
f6d248b
Compare
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.
Seems good to me!
@@ -17,18 +17,23 @@ import { get } from '@ember/object'; | |||
*/ | |||
export default class Snapshot { | |||
constructor(internalModel, options = {}) { | |||
this._attributes = Object.create(null); | |||
this.__attributes = null; |
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'd like (at some point) to start discussing moving some of these state caches into weakmaps now that we can use them indiscriminately...
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 can try and tackle that enhancement... maybe use a similar weakmap implementation found elsewhere in the code?
Hi, thanks for this fix! Is it possible to include it in the next beta? |
Failing test coming from emberjs/data#5444 so we need at least [email protected]. Using 3.2.0.beta-2 we get a fail related to defaultValue emberjs/data#5428 so we need a new beta :) Also maybe-import-regenerator seems to not import the generator (?) so I’ve added `includePolyfill: true` on babel opts. (mirage) Serialized rels on ticket reload to match the back-end. Otherwise fine, RIP my hype.
Resolves #5426
Resolves #5419
Adds tests for
findRecord
for the very first time