Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Mar 18, 2023
1 parent 434cec5 commit 6ae2d2f
Show file tree
Hide file tree
Showing 51 changed files with 72 additions and 78 deletions.
1 change: 1 addition & 0 deletions @types/@ember-data/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const DEBUG: boolean;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { warn } from '@ember/debug';
import { DEBUG } from '@glimmer/env';

import { DEBUG } from '@ember-data/env';
import type { Dict } from '@ember-data/types/q/utils';

import type { RequestData } from '../../rest';
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@

import EmberObject from '@ember/object';
import { inject as service } from '@ember/service';
import { DEBUG } from '@glimmer/env';

import { Promise as RSVPPromise } from 'rsvp';

import { DEBUG } from '@ember-data/env';
import type { SnapshotRecordArray } from '@ember-data/legacy-compat/-private';
import type Store from '@ember-data/store';
import type { Snapshot } from '@ember-data/store/-private';
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter/src/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { getOwner } from '@ember/application';
import { assert, warn } from '@ember/debug';
import { computed } from '@ember/object';
import { join } from '@ember/runloop';
import { DEBUG } from '@glimmer/env';

import { Promise as RSVPPromise } from 'rsvp';

import { DEBUG } from '@ember-data/env';
import type { SnapshotRecordArray } from '@ember-data/legacy-compat/-private';
import type Store from '@ember-data/store';
import type ShimModelClass from '@ember-data/store/-private/legacy-model-support/shim-model-class';
Expand Down
2 changes: 1 addition & 1 deletion packages/graph/src/-private/coerce-id.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DEBUG } from '@glimmer/env';
import { DEBUG } from '@ember-data/env';

// Used by the store to normalize IDs entering the store. Despite the fact
// that developers may provide IDs as numbers (e.g., `store.findRecord('person', 1)`),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from '@ember/debug';
import { DEBUG } from '@glimmer/env';
import { DEBUG } from '@ember-data/env';

import { DEPRECATE_NON_EXPLICIT_POLYMORPHISM } from '@ember-data/private-build-infra/deprecations';

Expand Down
2 changes: 1 addition & 1 deletion packages/graph/src/-private/graph/graph.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert } from '@ember/debug';
import { DEBUG } from '@glimmer/env';

import { DEBUG } from '@ember-data/env';
import { LOG_GRAPH } from '@ember-data/private-build-infra/debugging';
import { MergeOperation } from '@ember-data/types/q/cache';
import type { CacheStoreWrapper } from '@ember-data/types/q/cache-store-wrapper';
Expand Down
3 changes: 1 addition & 2 deletions packages/graph/src/-private/graph/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { DEBUG } from '@glimmer/env';

import { DEBUG } from '@ember-data/env';
import type Store from '@ember-data/store';
import type { CacheStoreWrapper } from '@ember-data/types/q/cache-store-wrapper';
import type { StableRecordIdentifier } from '@ember-data/types/q/identifier';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert } from '@ember/debug';
import { DEBUG } from '@glimmer/env';

import { DEBUG } from '@ember-data/env';
import type { StableRecordIdentifier } from '@ember-data/types/q/identifier';

import { assertPolymorphicType } from '../../debug/assert-polymorphic-type';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert } from '@ember/debug';
import { DEBUG } from '@glimmer/env';

import { DEBUG } from '@ember-data/env';
import type { StableRecordIdentifier } from '@ember-data/types/q/identifier';

import { assertPolymorphicType } from '../../debug/assert-polymorphic-type';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert } from '@ember/debug';
import { DEBUG } from '@glimmer/env';

import { DEBUG } from '@ember-data/env';
import type { StableRecordIdentifier } from '@ember-data/types/q/identifier';

import { assertPolymorphicType } from '../../debug/assert-polymorphic-type';
Expand Down
2 changes: 1 addition & 1 deletion packages/json-api/src/-private/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*/
import { assert } from '@ember/debug';
import { schedule } from '@ember/runloop';
import { DEBUG } from '@glimmer/env';

import { DEBUG } from '@ember-data/env';
import { graphFor, peekGraph } from '@ember-data/graph/-private';
import type { LocalRelationshipOperation } from '@ember-data/graph/-private/graph/-operations';
import type { ImplicitRelationship } from '@ember-data/graph/-private/graph/index';
Expand Down
3 changes: 2 additions & 1 deletion packages/legacy-compat/src/legacy-network-handler/common.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { deprecate } from '@ember/debug';
import { DEBUG } from '@glimmer/env';

import { resolve } from 'rsvp';

import { DEBUG } from '@ember-data/env';
import { DEPRECATE_RSVP_PROMISE } from '@ember-data/private-build-infra/deprecations';

export function _bind(fn, ...args) {
Expand All @@ -27,6 +27,7 @@ export function _objectIsAlive(object) {

export function guardDestroyedStore(promise, store, label) {
let token;
debugger;
if (DEBUG) {
token = store._trackAsyncRequestStart(label);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { assert, deprecate, warn } from '@ember/debug';
import { _backburner as emberBackburner } from '@ember/runloop';
import { DEBUG } from '@glimmer/env';

import { importSync, isDevelopingApp } from '@embroider/macros';
import { default as RSVP, resolve } from 'rsvp';

import { DEBUG } from '@ember-data/env';
import { HAS_GRAPH_PACKAGE } from '@ember-data/private-build-infra';
import { DEPRECATE_RSVP_PROMISE, DEPRECATE_V1_RECORD_DATA } from '@ember-data/private-build-infra/deprecations';
import type Store from '@ember-data/store';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { assert } from '@ember/debug';
import { DEBUG } from '@glimmer/env';

import { Promise, resolve } from 'rsvp';

import { DEBUG } from '@ember-data/env';
import type { Handler, NextFn } from '@ember-data/request/-private/types';
import type Store from '@ember-data/store';
import type { Snapshot } from '@ember-data/store/-private';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert } from '@ember/debug';
import { DEBUG } from '@glimmer/env';

import { DEBUG } from '@ember-data/env';
import type Store from '@ember-data/store';
import type ShimModelClass from '@ember-data/store/-private/legacy-model-support/shim-model-class';
import type { JsonApiDocument } from '@ember-data/types/q/ember-data-json-api';
Expand Down
2 changes: 1 addition & 1 deletion packages/model/src/-private/attr.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { assert } from '@ember/debug';
import { computed } from '@ember/object';
import { DEBUG } from '@glimmer/env';

import { DEBUG } from '@ember-data/env';
import { recordIdentifierFor } from '@ember-data/store';
import { peekCache } from '@ember-data/store/-private';

Expand Down
2 changes: 1 addition & 1 deletion packages/model/src/-private/belongs-to.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { assert, deprecate, warn } from '@ember/debug';
import { computed } from '@ember/object';
import { dasherize } from '@ember/string';
import { DEBUG } from '@glimmer/env';

import { DEBUG } from '@ember-data/env';
import {
DEPRECATE_RELATIONSHIPS_WITHOUT_ASYNC,
DEPRECATE_RELATIONSHIPS_WITHOUT_INVERSE,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from '@ember/debug';
import { DEBUG } from '@glimmer/env';
import { DEBUG } from '@ember-data/env';

import { DEPRECATE_NON_EXPLICIT_POLYMORPHISM } from '@ember-data/private-build-infra/deprecations';

Expand Down
3 changes: 2 additions & 1 deletion packages/model/src/-private/deprecated-promise-proxy.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { deprecate } from '@ember/debug';
import { get } from '@ember/object';
import { DEBUG } from '@glimmer/env';

import { resolve } from 'rsvp';

import { DEBUG } from '@ember-data/env';

import { PromiseObject } from './promise-proxy-base';

function promiseObject<T>(promise: Promise<T>): PromiseObject<T> {
Expand Down
2 changes: 1 addition & 1 deletion packages/model/src/-private/has-many.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { A } from '@ember/array';
import { assert, deprecate, inspect } from '@ember/debug';
import { computed } from '@ember/object';
import { dasherize } from '@ember/string';
import { DEBUG } from '@glimmer/env';

import { singularize } from 'ember-inflector';

import { DEBUG } from '@ember-data/env';
import {
DEPRECATE_RELATIONSHIPS_WITHOUT_ASYNC,
DEPRECATE_RELATIONSHIPS_WITHOUT_INVERSE,
Expand Down
2 changes: 1 addition & 1 deletion packages/model/src/-private/legacy-data-fetch.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { assert, deprecate } from '@ember/debug';
import { DEBUG } from '@glimmer/env';

import { resolve } from 'rsvp';

import { DEBUG } from '@ember-data/env';
import {
DEPRECATE_RELATIONSHIPS_WITHOUT_INVERSE,
DEPRECATE_RSVP_PROMISE,
Expand Down
2 changes: 1 addition & 1 deletion packages/model/src/-private/legacy-data-utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert } from '@ember/debug';
import { DEBUG } from '@glimmer/env';

import { DEBUG } from '@ember-data/env';
import type Store from '@ember-data/store';
import type ShimModelClass from '@ember-data/store/-private/legacy-model-support/shim-model-class';
import type { JsonApiDocument } from '@ember-data/types/q/ember-data-json-api';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { assert, deprecate } from '@ember/debug';
import { DEBUG } from '@glimmer/env';

import { importSync } from '@embroider/macros';
import { all, resolve } from 'rsvp';

import { DEBUG } from '@ember-data/env';
import type { UpgradedMeta } from '@ember-data/graph/-private/graph/-edge-definition';
import type { LocalRelationshipOperation } from '@ember-data/graph/-private/graph/-operations';
import type { ImplicitRelationship } from '@ember-data/graph/-private/graph/index';
Expand Down
2 changes: 1 addition & 1 deletion packages/model/src/-private/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { assert, deprecate, warn } from '@ember/debug';
import EmberObject from '@ember/object';
import { dependentKeyCompat } from '@ember/object/compat';
import { run } from '@ember/runloop';
import { DEBUG } from '@glimmer/env';
import { tracked } from '@glimmer/tracking';
import Ember from 'ember';

import { resolve } from 'rsvp';

import { DEBUG } from '@ember-data/env';
import { HAS_DEBUG_PACKAGE } from '@ember-data/private-build-infra';
import {
DEPRECATE_EARLY_STATIC,
Expand Down
2 changes: 1 addition & 1 deletion packages/model/src/-private/promise-many-array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import ArrayMixin, { NativeArray } from '@ember/array';
import type ArrayProxy from '@ember/array/proxy';
import { assert, deprecate } from '@ember/debug';
import { dependentKeyCompat } from '@ember/object/compat';
import { DEBUG } from '@glimmer/env';
import { tracked } from '@glimmer/tracking';
import Ember from 'ember';

import { resolve } from 'rsvp';

import { DEBUG } from '@ember-data/env';
import {
DEPRECATE_A_USAGE,
DEPRECATE_COMPUTED_CHAINS,
Expand Down
2 changes: 1 addition & 1 deletion packages/model/src/-private/record-state.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { assert } from '@ember/debug';
import { dependentKeyCompat } from '@ember/object/compat';
import { DEBUG } from '@glimmer/env';
import { cached, tracked } from '@glimmer/tracking';

import { DEBUG } from '@ember-data/env';
import { DEPRECATE_V1_RECORD_DATA } from '@ember-data/private-build-infra/deprecations';
import type Store from '@ember-data/store';
import { storeFor } from '@ember-data/store';
Expand Down
2 changes: 1 addition & 1 deletion packages/model/src/-private/references/belongs-to.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { deprecate } from '@ember/debug';
import { dependentKeyCompat } from '@ember/object/compat';
import { DEBUG } from '@glimmer/env';
import { cached, tracked } from '@glimmer/tracking';

import type { Object as JSONObject, Value as JSONValue } from 'json-typescript';
import { resolve } from 'rsvp';

import { DEBUG } from '@ember-data/env';
import type { Graph } from '@ember-data/graph/-private/graph/graph';
import type BelongsToRelationship from '@ember-data/graph/-private/relationships/state/belongs-to';
import { DEPRECATE_PROMISE_PROXIES, DEPRECATE_V1_RECORD_DATA } from '@ember-data/private-build-infra/deprecations';
Expand Down
2 changes: 1 addition & 1 deletion packages/model/src/-private/references/has-many.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { deprecate } from '@ember/debug';
import { dependentKeyCompat } from '@ember/object/compat';
import { DEBUG } from '@glimmer/env';
import { cached, tracked } from '@glimmer/tracking';

import type { Object as JSONObject, Value as JSONValue } from 'json-typescript';
import { resolve } from 'rsvp';

import { ManyArray } from 'ember-data/-private';

import { DEBUG } from '@ember-data/env';
import type { Graph } from '@ember-data/graph/-private/graph/graph';
import type ManyRelationship from '@ember-data/graph/-private/relationships/state/has-many';
import { DEPRECATE_PROMISE_PROXIES, DEPRECATE_V1_RECORD_DATA } from '@ember-data/private-build-infra/deprecations';
Expand Down
2 changes: 1 addition & 1 deletion packages/model/src/-private/relationship-meta.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { dasherize } from '@ember/string';
import { DEBUG } from '@glimmer/env';

import { singularize } from 'ember-inflector';

import { DEBUG } from '@ember-data/env';
import type Store from '@ember-data/store';
import type { RelationshipSchema } from '@ember-data/types/q/record-data-schemas';

Expand Down
2 changes: 1 addition & 1 deletion packages/private-build-infra/src/debug-macros.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = function debugMacros(config) {
[
TransformDebugEnv,
{
source: '@glimmer/env',
source: '@ember-data/env',
flags: { DEBUG: true },
},
'@ember-data/debugging',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ module.exports = function (babel) {
// if (DEBUG)
// =>
// if (macroCondition(isDevelopingApp())
t.callExpression(state.importer.import(p, '@embroider/macros', 'macroCondition'), [
negateStatement ? t.unaryExpression('!', getConfig) : getConfig,
])
// t.callExpression(state.importer.import(p, '@embroider/macros', 'macroCondition'), [
negateStatement ? t.unaryExpression('!', getConfig) : getConfig
// ])
);
});
specifier.scope.removeOwnBinding(localBindingName);
Expand Down
3 changes: 2 additions & 1 deletion packages/serializer/src/json-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
import { assert, warn } from '@ember/debug';
import { dasherize } from '@ember/string';
import { isNone, typeOf } from '@ember/utils';
import { DEBUG } from '@glimmer/env';

import { pluralize, singularize } from 'ember-inflector';

import { DEBUG } from '@ember-data/env';

import JSONSerializer from './json';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/serializer/src/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import { assert, warn } from '@ember/debug';
import { camelize, dasherize } from '@ember/string';
import { isNone, typeOf } from '@ember/utils';
import { DEBUG } from '@glimmer/env';

import { singularize } from 'ember-inflector';

import { DEBUG } from '@ember-data/env';
import { coerceId } from '@ember-data/store/-private';

import JSONSerializer from './json';
Expand Down
2 changes: 1 addition & 1 deletion packages/store/src/-private/caches/identifier-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
@module @ember-data/store
*/
import { assert, warn } from '@ember/debug';
import { DEBUG } from '@glimmer/env';

import { getOwnConfig, macroCondition } from '@embroider/macros';

import { DEBUG } from '@ember-data/env';
import { LOG_IDENTIFIERS } from '@ember-data/private-build-infra/debugging';
import type { ExistingResourceObject, ResourceIdentifierObject } from '@ember-data/types/q/ember-data-json-api';
import type {
Expand Down
2 changes: 1 addition & 1 deletion packages/store/src/-private/caches/instance-cache.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { assert, deprecate, warn } from '@ember/debug';
import { DEBUG } from '@glimmer/env';

import { importSync } from '@embroider/macros';

import { DEBUG } from '@ember-data/env';
import type { Graph } from '@ember-data/graph/-private/graph/graph';
import type { peekGraph } from '@ember-data/graph/-private/graph/index';
import { HAS_GRAPH_PACKAGE, HAS_JSON_API_PACKAGE } from '@ember-data/private-build-infra';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @module @ember-data/store
*/
import { assert } from '@ember/debug';
import { DEBUG } from '@glimmer/env';

import { DEBUG } from '@ember-data/env';
import { LOG_NOTIFICATIONS } from '@ember-data/private-build-infra/debugging';
import type { Identifier, StableRecordIdentifier } from '@ember-data/types/q/identifier';

Expand Down
2 changes: 1 addition & 1 deletion packages/store/src/-private/proxies/promise-proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { deprecate } from '@ember/debug';
import { get } from '@ember/object';
import type ComputedProperty from '@ember/object/computed';
import { reads } from '@ember/object/computed';
import { DEBUG } from '@glimmer/env';

import { resolve } from 'rsvp';

import { DEBUG } from '@ember-data/env';
import type { Dict } from '@ember-data/types/q/utils';

import { PromiseArrayProxy, PromiseObjectProxy } from './promise-proxy-base';
Expand Down
Loading

0 comments on commit 6ae2d2f

Please sign in to comment.