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

feat: implement graph diffing #8807

Merged
merged 15 commits into from
Sep 3, 2023
6 changes: 4 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@
**/dist-control/
**/dist-experiment/
**/tmp/
/packages/-ember-data/docs/
/packages/tracking/addon/
/packages/request/addon/
/packages/store/addon/
/packages/adapter/addon/
/packages/-ember-data/docs/
/packages/tracking/addon/
/packages/serializer/addon/
/packages/model/addon/
/packages/json-api/addon/
/packages/graph/addon/
/packages/legacy-compat/addon/
/packages/request-utils/addon/
/packages/rest/addon/
/packages/active-record/addon/

**/DEBUG/

Expand Down
33 changes: 33 additions & 0 deletions @types/ember-data-qunit-asserts/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import type { CacheOperation, NotificationType } from "@ember-data/store/-private/managers/notification-manager";
import type { StableDocumentIdentifier } from "@ember-data/types/cache/identifier";
import type { StableRecordIdentifier } from "@ember-data/types/q/identifier";

declare global {
interface DeprecationConfig {
id: string;
Expand All @@ -22,6 +26,26 @@ declare global {
expectNoWarning(callback: () => unknown): Promise<void>;
expectAssertion(callback: () => unknown, matcher: string | RegExp): Promise<void>;
expectNoAssertion(callback: () => unknown): Promise<void>;
/**
* Asserts that each member of actual strictly matches the corresponding member of expected.
* Asserts that actual is an array and has the same length as expected.
*/
arrayStrictEquals<T>(actual: unknown, expected: T[], message: string): void;
/**
* Asserts that the given identifier has been notified of a change to the given bucket
* and optional key the given number of times during the test.
*
* Clears the notification count for the given identifier, bucket and key after the assertion
* is made so that it is easy to assert notification counts in between steps of a test.
*/
notified(
identifier: StableDocumentIdentifier | StableRecordIdentifier,
bucket: NotificationType | CacheOperation,
key: string | null,
count: number
): void;

clearNotifications(): void;
}

namespace QUnit {
Expand All @@ -33,6 +57,15 @@ declare global {
expectNoWarning(callback: () => unknown): Promise<void>;
expectAssertion(callback: () => unknown, matcher: string | RegExp): Promise<void>;
expectNoAssertion(callback: () => unknown): Promise<void>;
arrayStrictEquals<T>(unknown, expected: T[], message: string): void;
notified(
identifier: StableDocumentIdentifier | StableRecordIdentifier,
bucket: NotificationType | CacheOperation,
key: string | null,
count: number
): void;

clearNotifications(): void;
}
}

Expand Down
1 change: 1 addition & 0 deletions ember-data-types/q/record-data-schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface RelationshipSchema {
async: boolean; // controls inverse unloading "client side delete semantics" so we should replace that with a real flag
polymorphic?: boolean;
inverse: string | null; // property key on the related type (if any)
resetOnRemoteUpdate?: false; // manages the deprecation `DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE`
[key: string]: unknown;
};
// inverse?: string | null;
Expand Down
Loading