Skip to content
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

Remove feature flagging for ds-extended-errors. #5107

Closed
wants to merge 51 commits into from

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Jul 29, 2017

The feature was enabled in ember-data@2.13, the feature flagging can now be removed.

This is a work around to a bug in the feature flagging system used by ember-data, that will need to be fixed on master branch.

Fixes #5020.

Note: this targets release branch. I'll submit a forward port for beta/master.

bmac and others added 30 commits April 28, 2017 16:26
…er-cli and is failing on master

This is a temporary change to unblock Ember Data

See ember-cli/ember-cli#7019 for a more long term fix

(cherry picked from commit ef68161)
The argument passed into `instance-initializers` is _either_ an
`Ember.ApplicationInstance` instance _or_ a `Ember.EngineInstance`
instance. The `.application` property is only present on
`Ember.ApplicationInstance`'s.

This change adds some inline comments around the various conditionals
and swaps the logic to use `instance.base` when present and avoid
erroring if neither `.base` or `.application` is present.

(cherry picked from commit 6318832)
(cherry picked from commit c6eab01)
…rivate export file

(cherry picked from commit 96a9208)
(cherry picked from commit a36a44f)
…export using `default`.

(cherry picked from commit f79d398)
… < 2.12. (emberjs#5022)

ember-cli@2.12 and higher have the addon itself responsible for transpiling
modules so that the output of the `treeForAddon` hook is expected to be
AMD.

Prior versions of ember-cli (i.e. < 2.12) do second pass (that is not possible
to disable) to transpile the output of `treeForAddon` **again** (to transpile
modules).

This commit changes things around leveraging ember-cli-babel@6's built in
ability to detect the various ember-cli version scenarios and either
transpile `ember-data/-private` down to AMD or not correctly.
emberjs#5048)

* [BUGFIX release] createRecord should only setup relationships it has data for

* update deps

(cherry picked from commit 3eb760b)
 - store#filter() is now deprecated
 - Don't suggest it's usage
[BACKPORT] Update doc for deprecated function.
…ion when possible.

This reverts commit 16b8a04.

—

The `deleteRecord() { return null; }` changes are to allow the back ported tests to work with the older JSONSerializer rather then the JSONAPISerializer which the test suite (in beta and master) use. For reference the JSONSerializer -> JSONAPISerializer landed -> emberjs#5003
[BUGFIX release] Preserve local relationship changes after persisting a delet…
stefanpenner and others added 16 commits July 21, 2017 08:09
…-destroy

[BACKPORT 2 release] Release fix unload after destroy
If a relationship was setup with duplicate entries, it would enter an
invalid state. Specifically, this.canonicalMembers and
this.canonicalState would be out of sync. Resulting in some sad things.

This was most likely introduced by emberjs@f8304b2#commitcomment-23256408
{release} [BUGFIX release] handle dupe relationship entries
{release} Bump `amd-name-resolver` version to enable parallel babel transpile
…rd()

For an async relationship [x, y] with x.unloadRecord(), now adjusts only
the relationship’s currentState, leaving that relationship’s canonical
state alone, ensuring the existing client-side delete semantics are
preserved. But when that relationship is reloaded, the canonicalState
consulted.

For sync relationship [x, y] with x.unloadRecord(), both currentState
and canonical state are updated. This is to mirror the client-side
delete semantics. But since we cannot reload a sync relationship we must
assume this to be the new canonical state and rely on subsequent `push`
or `adapterPayloads` or manual `store.push` to update.

This aims to:

* [FIX] hasMany arrays never contain dematerialized records (so they no longer become broken)
* [FIX] using unloadRecord as a type of client side delete is restored
* [PRESERVE] the garbage collector pass to cleanup orphaned models
* [PRESERVE] second access to a relationship which did contain an unloadRecord to cause a reload

note: if both sides of a relationships are unloaded, the above doesn’t
apply. This is largely just when members of a loaded relationship are
themselves unloaded.

[fixes emberjs#4986 emberjs#5052 emberjs#4987 emberjs#4996]
[BUGFIX release] relationship [x, y] should not break on x.unloadRecord()
The following should be possible:

```js
const record = store.find(‘record’, 1);
record.unloadRecord();
store.createRecord(‘record’, 1);
```

before this commit, the `createRecord` would fail,
as the `record` would not yet be fully unloaded, 
and its ID would still be reserved.
Given unloadRecord followed by a synchronous findRecord, we should be sure
any orphaned relationships are discarded.
The feature was enabled in ember-data@2.13, the feature flagging can
now be removed.

This is a work around to a bug in the feature flagging system used
by ember-data, that will need to be fixed on master branch.
@urbany
Copy link

urbany commented Aug 17, 2017

Hi @rwjblue will this make it to the 2.15 release?
Thank you so much in advance!

@bmac
Copy link
Member

bmac commented Sep 28, 2017

rebased as #5191. Sorry for the delay @rwjblue.

@bmac bmac closed this Sep 28, 2017
@ashrafhasson
Copy link

I'm encountering this with ember-data 2.15 :(

@bmac
Copy link
Member

bmac commented Sep 28, 2017

I'll try to cut a 2.15.2 release later today. This pr didn't make it into 2.15.1.

@sihuang
Copy link

sihuang commented Oct 8, 2017

@bmac did it make 2.15.2 or any later build?

@bmac
Copy link
Member

bmac commented Oct 8, 2017

Yes. Its in 2.15.2 and 2.16.0.

@sihuang
Copy link

sihuang commented Oct 8, 2017

@bmac thanks for updating.

@rwjblue rwjblue deleted the fix-extended-errors branch May 1, 2019 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.