-
-
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
fix: fix MandatorySetter error for Proxied PromiseProxy, silence ember-concurrency deprecations #8206
Merged
Merged
fix: fix MandatorySetter error for Proxied PromiseProxy, silence ember-concurrency deprecations #8206
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0d782df
npm ignore publish for yarn-error.log
runspired 08d6d43
dont wrap in deprecation proxy in prod builds
runspired e467bd6
add failing test to replicate bug
runspired 2bd896c
add fix
runspired bc6a9b9
restore original deprecation
runspired 5625c87
cleanup
runspired cd5b5ed
more cleanup
runspired 027da7c
dont deprecate for ec, fix prod test
runspired File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
packages/-ember-data/tests/acceptance/tracking-promise-flags-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { render, settled } from '@ember/test-helpers'; | ||
|
||
import hbs from 'htmlbars-inline-precompile'; | ||
import { module } from 'qunit'; | ||
|
||
import { setupRenderingTest } from 'ember-qunit'; | ||
|
||
import JSONAPIAdapter from '@ember-data/adapter/json-api'; | ||
import Model, { attr } from '@ember-data/model'; | ||
import Store from '@ember-data/store'; | ||
import { deprecatedTest } from '@ember-data/unpublished-test-infra/test-support/deprecated-test'; | ||
|
||
class Widget extends Model { | ||
@attr name; | ||
} | ||
|
||
module('acceptance/tracking-promise-flags', function (hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
hooks.beforeEach(function () { | ||
let { owner } = this; | ||
owner.register('service:store', Store); | ||
owner.register('model:widget', Widget); | ||
owner.register( | ||
'serializer:application', | ||
class { | ||
normalizeResponse = (_, __, data) => data; | ||
static create() { | ||
return new this(); | ||
} | ||
} | ||
); | ||
}); | ||
|
||
deprecatedTest( | ||
'can track isPending', | ||
{ id: 'ember-data:deprecate-promise-proxies', until: '5.0', count: 6 }, | ||
async function (assert) { | ||
const { owner } = this; | ||
let resolve; | ||
class TestAdapter extends JSONAPIAdapter { | ||
findRecord() { | ||
return new Promise((r) => { | ||
resolve = r; | ||
}); | ||
} | ||
} | ||
owner.register('adapter:application', TestAdapter); | ||
let store = owner.lookup('service:store'); | ||
store.DISABLE_WAITER = true; | ||
this.model = store.findRecord('widget', '1'); | ||
|
||
await render(hbs`{{#if this.model.isPending}}Pending{{else}}{{this.model.name}}{{/if}}`); | ||
|
||
assert.dom().containsText('Pending'); | ||
|
||
resolve({ | ||
data: { | ||
id: '1', | ||
type: 'widget', | ||
attributes: { | ||
name: 'Contraption', | ||
}, | ||
}, | ||
}); | ||
await settled(); | ||
|
||
assert.dom().containsText('Contraption'); | ||
} | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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've opened an issue in EC concerning this: machty/ember-concurrency#496, do you think it's legit, or should I close it ?
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.
Still a real issue though probably not terribly bad
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.
Ok, thank you, I will wait for feedback in EC then.