From d915a376c0691cd71b614b94f5e0aef5c79988d5 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Fri, 5 Jan 2024 18:05:16 -0500 Subject: [PATCH 1/4] Begin deprecations --- ember-resources/src/util/keep-latest.ts | 38 +++++++++++++++++-------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/ember-resources/src/util/keep-latest.ts b/ember-resources/src/util/keep-latest.ts index b0729ee69..6a586b181 100644 --- a/ember-resources/src/util/keep-latest.ts +++ b/ember-resources/src/util/keep-latest.ts @@ -1,5 +1,19 @@ +import { deprecate } from '@ember/debug'; + import { resource, resourceFactory } from '../core/function-based'; +deprecate( + `importing from 'ember-resources/util/keep-latest' is deprecated and will be removed in ember-resources@v7. ` + + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + + `\`pnpm add reactiveweb\` and then \` import { keepLatest } from 'reactiveweb/keep-latest';\`. ` + + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, { + id: `ember-resources.util.keepLatest`, + until: `7.0.0`, + for: `ember-resources`, + url: `https://reactive.nullvoxpopuli.com/functions/keep_latest.keepLatest.html`, + since: 'enabled', +}); + const isEmpty = (x: undefined | unknown | unknown[]) => { if (Array.isArray(x)) { return x.length === 0; @@ -76,22 +90,22 @@ export function keepLatest({ when, value: valueFn }: Options Date: Fri, 5 Jan 2024 18:27:25 -0500 Subject: [PATCH 2/4] deprecate the utils --- ember-resources/src/util/debounce.ts | 16 ++++++++++++++ ember-resources/src/util/ember-concurrency.ts | 18 ++++++++++++++- ember-resources/src/util/fps.ts | 18 +++++++++++++++ ember-resources/src/util/function.ts | 16 ++++++++++++++ ember-resources/src/util/helper.ts | 16 ++++++++++++++ ember-resources/src/util/keep-latest.ts | 7 ++++-- ember-resources/src/util/map.ts | 22 ++++++++++++++++--- ember-resources/src/util/remote-data.ts | 16 ++++++++++++++ 8 files changed, 123 insertions(+), 6 deletions(-) diff --git a/ember-resources/src/util/debounce.ts b/ember-resources/src/util/debounce.ts index d14a72133..ff9f3c6fb 100644 --- a/ember-resources/src/util/debounce.ts +++ b/ember-resources/src/util/debounce.ts @@ -1,7 +1,23 @@ import { tracked } from '@glimmer/tracking'; +import { deprecate } from '@ember/debug'; import { resource } from '../core'; +deprecate( + `importing from 'ember-resources/util/debounce' is deprecated and will be removed in ember-resources@v7. ` + + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + + `\`pnpm add reactiveweb\` and then \` import { debounce } from 'reactiveweb/debounce';\`. ` + + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, true, { + id: `ember-resources.util.debounce`, + until: `7.0.0`, + for: `ember-resources`, + url: `https://reactive.nullvoxpopuli.com/functions/debounce.debounce.html`, + since: { + available: '6.4.4', + enabled: '6.4.4', + } +}); + class TrackedValue { @tracked value: T | undefined; } diff --git a/ember-resources/src/util/ember-concurrency.ts b/ember-resources/src/util/ember-concurrency.ts index 05d0a9ba2..2d3a5505b 100644 --- a/ember-resources/src/util/ember-concurrency.ts +++ b/ember-resources/src/util/ember-concurrency.ts @@ -1,11 +1,11 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/ban-types */ /* eslint-disable ember/no-get */ - // typed-ember has not publihsed types for this yet // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import { getValue } from '@glimmer/tracking/primitives/cache'; +import { deprecate } from '@ember/debug'; import { assert } from '@ember/debug'; // typed-ember has not publihsed types for this yet // eslint-disable-next-line @typescript-eslint/ban-ts-comment @@ -18,6 +18,22 @@ import { DEFAULT_THUNK, normalizeThunk } from '../core/utils'; import type { Cache } from '../core/types'; + +deprecate( + `importing from 'ember-resources/util/ember-concurrency' is deprecated and will be removed in ember-resources@v7. ` + + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + + `\`pnpm add reactiveweb\` and then \` import { task, trackedTask } from 'reactiveweb/ember-concurrency';\`. ` + + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, true, { + id: `ember-resources.util.trackedTask`, + until: `7.0.0`, + for: `ember-resources`, + url: `https://reactive.nullvoxpopuli.com/functions/ember_concurrency.task.html`, + since: { + available: '6.4.4', + enabled: '6.4.4', + } +}); + /** *
* diff --git a/ember-resources/src/util/fps.ts b/ember-resources/src/util/fps.ts index 839262e8f..bea0ee705 100644 --- a/ember-resources/src/util/fps.ts +++ b/ember-resources/src/util/fps.ts @@ -1,5 +1,23 @@ +import { deprecate } from '@ember/debug'; + import { cell, resource, resourceFactory } from '../index'; +deprecate( + `importing from 'ember-resources/util/fps' is deprecated and will be removed in ember-resources@v7. ` + + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + + `\`pnpm add reactiveweb\` and then \` import { FrameRate, UpdateFrequency } from 'reactiveweb/fps';\`. ` + + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, true, { + id: `ember-resources.util.fps`, + until: `7.0.0`, + for: `ember-resources`, + url: `https://reactive.nullvoxpopuli.com/modules/fps.html`, + since: { + available: '6.4.4', + enabled: '6.4.4', + } +}); + + /** *
* diff --git a/ember-resources/src/util/function.ts b/ember-resources/src/util/function.ts index 897b35536..65cf41620 100644 --- a/ember-resources/src/util/function.ts +++ b/ember-resources/src/util/function.ts @@ -1,4 +1,5 @@ import { tracked } from '@glimmer/tracking'; +import { deprecate } from '@ember/debug'; import { assert } from '@ember/debug'; import { associateDestroyableChild, destroy, isDestroyed, isDestroying } from '@ember/destroyable'; @@ -6,6 +7,21 @@ import { TrackedAsyncData } from 'ember-async-data'; import { resource } from '../core/function-based'; +deprecate( + `importing from 'ember-resources/util/function' is deprecated and will be removed in ember-resources@v7. ` + + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + + `\`pnpm add reactiveweb\` and then \` import { trackedFunction } from 'reactiveweb/function';\`. ` + + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, true, { + id: `ember-resources.util.function`, + until: `7.0.0`, + for: `ember-resources`, + url: `https://reactive.nullvoxpopuli.com/functions/function.trackedFunction.html`, + since: { + available: '6.4.4', + enabled: '6.4.4', + } +}); + /** *
* diff --git a/ember-resources/src/util/helper.ts b/ember-resources/src/util/helper.ts index bb957330a..b51dab6d2 100644 --- a/ember-resources/src/util/helper.ts +++ b/ember-resources/src/util/helper.ts @@ -1,5 +1,6 @@ // @ts-ignore import { getValue } from '@glimmer/tracking/primitives/cache'; +import { deprecate } from '@ember/debug'; // @ts-ignore import { invokeHelper } from '@ember/helper'; @@ -10,6 +11,21 @@ import type ClassBasedHelper from '@ember/component/helper'; import type { FunctionBasedHelper } from '@ember/component/helper'; import type { HelperLike } from '@glint/template'; +deprecate( + `importing from 'ember-resources/util/helper' is deprecated and will be removed in ember-resources@v7. ` + + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + + `\`pnpm add reactiveweb\` and then \` import { helper } from 'reactiveweb/helper';\`. ` + + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, true, { + id: `ember-resources.util.fps`, + until: `7.0.0`, + for: `ember-resources`, + url: `https://reactive.nullvoxpopuli.com/functions/helper.helper.html`, + since: { + available: '6.4.4', + enabled: '6.4.4', + } +}); + type Get = K extends keyof T ? T[K] : Otherwise; /** diff --git a/ember-resources/src/util/keep-latest.ts b/ember-resources/src/util/keep-latest.ts index 6a586b181..c1dc8ec94 100644 --- a/ember-resources/src/util/keep-latest.ts +++ b/ember-resources/src/util/keep-latest.ts @@ -6,12 +6,15 @@ deprecate( `importing from 'ember-resources/util/keep-latest' is deprecated and will be removed in ember-resources@v7. ` + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + `\`pnpm add reactiveweb\` and then \` import { keepLatest } from 'reactiveweb/keep-latest';\`. ` - + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, { + + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, true, { id: `ember-resources.util.keepLatest`, until: `7.0.0`, for: `ember-resources`, url: `https://reactive.nullvoxpopuli.com/functions/keep_latest.keepLatest.html`, - since: 'enabled', + since: { + available: '6.4.4', + enabled: '6.4.4', + } }); const isEmpty = (x: undefined | unknown | unknown[]) => { diff --git a/ember-resources/src/util/map.ts b/ember-resources/src/util/map.ts index 4d6710cb5..20209c5dc 100644 --- a/ember-resources/src/util/map.ts +++ b/ember-resources/src/util/map.ts @@ -1,10 +1,26 @@ import { tracked } from '@glimmer/tracking'; +import { deprecate } from '@ember/debug'; import { assert } from '@ember/debug'; import { Resource } from '../core/class-based'; import type { Named, Positional } from '../core/types'; +deprecate( + `importing from 'ember-resources/util/map' is deprecated and will be removed in ember-resources@v7. ` + + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + + `\`pnpm add reactiveweb\` and then \` import { map } from 'reactiveweb/map';\`. ` + + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, true, { + id: `ember-resources.util.map`, + until: `7.0.0`, + for: `ember-resources`, + url: `https://reactive.nullvoxpopuli.com/functions/map.map.html`, + since: { + available: '6.4.4', + enabled: '6.4.4', + } +}); + /** * Public API of the return value of the [[map]] resource. */ @@ -291,9 +307,9 @@ export class TrackedArrayMap assert( `Expected record to exist at index ${i}, but it did not. ` + - `The array item is expected to exist, because the map utility resource lazily iterates along the indices of the original array passed as data. ` + - `This error could happen if the data array passed to map has been mutated while iterating. ` + - `To resolve this error, do not mutate arrays while iteration occurs.`, + `The array item is expected to exist, because the map utility resource lazily iterates along the indices of the original array passed as data. ` + + `This error could happen if the data array passed to map has been mutated while iterating. ` + + `To resolve this error, do not mutate arrays while iteration occurs.`, record, ); diff --git a/ember-resources/src/util/remote-data.ts b/ember-resources/src/util/remote-data.ts index 60ecfb0f9..67470c48a 100644 --- a/ember-resources/src/util/remote-data.ts +++ b/ember-resources/src/util/remote-data.ts @@ -1,4 +1,5 @@ import { tracked } from '@glimmer/tracking'; +import { deprecate } from '@ember/debug'; import { waitForPromise } from '@ember/test-waiters'; import { resource, resourceFactory } from '../core/function-based'; @@ -7,6 +8,21 @@ import type { ResourceAPI } from '../core/function-based'; type FetchOptions = Parameters[1]; +deprecate( + `importing from 'ember-resources/util/remote-data' is deprecated and will be removed in ember-resources@v7. ` + + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + + `\`pnpm add reactiveweb\` and then \` import { RemoteData } from 'reactiveweb/remote-data';\`. ` + + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, true, { + id: `ember-resources.util.remoteData`, + until: `7.0.0`, + for: `ember-resources`, + url: `https://reactive.nullvoxpopuli.com/functions/remote_data.remoteData-1.html`, + since: { + available: '6.4.4', + enabled: '6.4.4', + } +}); + /** * @protected */ From 032da1070482314a4103f8e12a3fb97cf141e7a9 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Fri, 5 Jan 2024 18:31:52 -0500 Subject: [PATCH 3/4] lint:fix --- ember-resources/src/util/debounce.ts | 29 ++++++++------- ember-resources/src/util/ember-concurrency.ts | 30 ++++++++------- ember-resources/src/util/fps.ts | 30 ++++++++------- ember-resources/src/util/function.ts | 29 ++++++++------- ember-resources/src/util/helper.ts | 29 ++++++++------- ember-resources/src/util/keep-latest.ts | 37 ++++++++++--------- ember-resources/src/util/map.ts | 35 ++++++++++-------- ember-resources/src/util/remote-data.ts | 29 ++++++++------- 8 files changed, 135 insertions(+), 113 deletions(-) diff --git a/ember-resources/src/util/debounce.ts b/ember-resources/src/util/debounce.ts index ff9f3c6fb..2fc818060 100644 --- a/ember-resources/src/util/debounce.ts +++ b/ember-resources/src/util/debounce.ts @@ -4,19 +4,22 @@ import { deprecate } from '@ember/debug'; import { resource } from '../core'; deprecate( - `importing from 'ember-resources/util/debounce' is deprecated and will be removed in ember-resources@v7. ` - + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` - + `\`pnpm add reactiveweb\` and then \` import { debounce } from 'reactiveweb/debounce';\`. ` - + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, true, { - id: `ember-resources.util.debounce`, - until: `7.0.0`, - for: `ember-resources`, - url: `https://reactive.nullvoxpopuli.com/functions/debounce.debounce.html`, - since: { - available: '6.4.4', - enabled: '6.4.4', - } -}); + `importing from 'ember-resources/util/debounce' is deprecated and will be removed in ember-resources@v7. ` + + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + + `\`pnpm add reactiveweb\` and then \` import { debounce } from 'reactiveweb/debounce';\`. ` + + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, + true, + { + id: `ember-resources.util.debounce`, + until: `7.0.0`, + for: `ember-resources`, + url: `https://reactive.nullvoxpopuli.com/functions/debounce.debounce.html`, + since: { + available: '6.4.4', + enabled: '6.4.4', + }, + }, +); class TrackedValue { @tracked value: T | undefined; diff --git a/ember-resources/src/util/ember-concurrency.ts b/ember-resources/src/util/ember-concurrency.ts index 2d3a5505b..67fca2591 100644 --- a/ember-resources/src/util/ember-concurrency.ts +++ b/ember-resources/src/util/ember-concurrency.ts @@ -18,21 +18,23 @@ import { DEFAULT_THUNK, normalizeThunk } from '../core/utils'; import type { Cache } from '../core/types'; - deprecate( - `importing from 'ember-resources/util/ember-concurrency' is deprecated and will be removed in ember-resources@v7. ` - + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` - + `\`pnpm add reactiveweb\` and then \` import { task, trackedTask } from 'reactiveweb/ember-concurrency';\`. ` - + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, true, { - id: `ember-resources.util.trackedTask`, - until: `7.0.0`, - for: `ember-resources`, - url: `https://reactive.nullvoxpopuli.com/functions/ember_concurrency.task.html`, - since: { - available: '6.4.4', - enabled: '6.4.4', - } -}); + `importing from 'ember-resources/util/ember-concurrency' is deprecated and will be removed in ember-resources@v7. ` + + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + + `\`pnpm add reactiveweb\` and then \` import { task, trackedTask } from 'reactiveweb/ember-concurrency';\`. ` + + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, + true, + { + id: `ember-resources.util.trackedTask`, + until: `7.0.0`, + for: `ember-resources`, + url: `https://reactive.nullvoxpopuli.com/functions/ember_concurrency.task.html`, + since: { + available: '6.4.4', + enabled: '6.4.4', + }, + }, +); /** *
diff --git a/ember-resources/src/util/fps.ts b/ember-resources/src/util/fps.ts index bea0ee705..ab3e56a57 100644 --- a/ember-resources/src/util/fps.ts +++ b/ember-resources/src/util/fps.ts @@ -3,20 +3,22 @@ import { deprecate } from '@ember/debug'; import { cell, resource, resourceFactory } from '../index'; deprecate( - `importing from 'ember-resources/util/fps' is deprecated and will be removed in ember-resources@v7. ` - + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` - + `\`pnpm add reactiveweb\` and then \` import { FrameRate, UpdateFrequency } from 'reactiveweb/fps';\`. ` - + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, true, { - id: `ember-resources.util.fps`, - until: `7.0.0`, - for: `ember-resources`, - url: `https://reactive.nullvoxpopuli.com/modules/fps.html`, - since: { - available: '6.4.4', - enabled: '6.4.4', - } -}); - + `importing from 'ember-resources/util/fps' is deprecated and will be removed in ember-resources@v7. ` + + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + + `\`pnpm add reactiveweb\` and then \` import { FrameRate, UpdateFrequency } from 'reactiveweb/fps';\`. ` + + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, + true, + { + id: `ember-resources.util.fps`, + until: `7.0.0`, + for: `ember-resources`, + url: `https://reactive.nullvoxpopuli.com/modules/fps.html`, + since: { + available: '6.4.4', + enabled: '6.4.4', + }, + }, +); /** *
diff --git a/ember-resources/src/util/function.ts b/ember-resources/src/util/function.ts index 65cf41620..855aaf9d5 100644 --- a/ember-resources/src/util/function.ts +++ b/ember-resources/src/util/function.ts @@ -8,19 +8,22 @@ import { TrackedAsyncData } from 'ember-async-data'; import { resource } from '../core/function-based'; deprecate( - `importing from 'ember-resources/util/function' is deprecated and will be removed in ember-resources@v7. ` - + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` - + `\`pnpm add reactiveweb\` and then \` import { trackedFunction } from 'reactiveweb/function';\`. ` - + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, true, { - id: `ember-resources.util.function`, - until: `7.0.0`, - for: `ember-resources`, - url: `https://reactive.nullvoxpopuli.com/functions/function.trackedFunction.html`, - since: { - available: '6.4.4', - enabled: '6.4.4', - } -}); + `importing from 'ember-resources/util/function' is deprecated and will be removed in ember-resources@v7. ` + + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + + `\`pnpm add reactiveweb\` and then \` import { trackedFunction } from 'reactiveweb/function';\`. ` + + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, + true, + { + id: `ember-resources.util.function`, + until: `7.0.0`, + for: `ember-resources`, + url: `https://reactive.nullvoxpopuli.com/functions/function.trackedFunction.html`, + since: { + available: '6.4.4', + enabled: '6.4.4', + }, + }, +); /** *
diff --git a/ember-resources/src/util/helper.ts b/ember-resources/src/util/helper.ts index b51dab6d2..700acfa28 100644 --- a/ember-resources/src/util/helper.ts +++ b/ember-resources/src/util/helper.ts @@ -12,19 +12,22 @@ import type { FunctionBasedHelper } from '@ember/component/helper'; import type { HelperLike } from '@glint/template'; deprecate( - `importing from 'ember-resources/util/helper' is deprecated and will be removed in ember-resources@v7. ` - + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` - + `\`pnpm add reactiveweb\` and then \` import { helper } from 'reactiveweb/helper';\`. ` - + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, true, { - id: `ember-resources.util.fps`, - until: `7.0.0`, - for: `ember-resources`, - url: `https://reactive.nullvoxpopuli.com/functions/helper.helper.html`, - since: { - available: '6.4.4', - enabled: '6.4.4', - } -}); + `importing from 'ember-resources/util/helper' is deprecated and will be removed in ember-resources@v7. ` + + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + + `\`pnpm add reactiveweb\` and then \` import { helper } from 'reactiveweb/helper';\`. ` + + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, + true, + { + id: `ember-resources.util.fps`, + until: `7.0.0`, + for: `ember-resources`, + url: `https://reactive.nullvoxpopuli.com/functions/helper.helper.html`, + since: { + available: '6.4.4', + enabled: '6.4.4', + }, + }, +); type Get = K extends keyof T ? T[K] : Otherwise; diff --git a/ember-resources/src/util/keep-latest.ts b/ember-resources/src/util/keep-latest.ts index c1dc8ec94..e681c7e35 100644 --- a/ember-resources/src/util/keep-latest.ts +++ b/ember-resources/src/util/keep-latest.ts @@ -3,19 +3,22 @@ import { deprecate } from '@ember/debug'; import { resource, resourceFactory } from '../core/function-based'; deprecate( - `importing from 'ember-resources/util/keep-latest' is deprecated and will be removed in ember-resources@v7. ` - + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` - + `\`pnpm add reactiveweb\` and then \` import { keepLatest } from 'reactiveweb/keep-latest';\`. ` - + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, true, { - id: `ember-resources.util.keepLatest`, - until: `7.0.0`, - for: `ember-resources`, - url: `https://reactive.nullvoxpopuli.com/functions/keep_latest.keepLatest.html`, - since: { - available: '6.4.4', - enabled: '6.4.4', - } -}); + `importing from 'ember-resources/util/keep-latest' is deprecated and will be removed in ember-resources@v7. ` + + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + + `\`pnpm add reactiveweb\` and then \` import { keepLatest } from 'reactiveweb/keep-latest';\`. ` + + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, + true, + { + id: `ember-resources.util.keepLatest`, + until: `7.0.0`, + for: `ember-resources`, + url: `https://reactive.nullvoxpopuli.com/functions/keep_latest.keepLatest.html`, + since: { + available: '6.4.4', + enabled: '6.4.4', + }, + }, +); const isEmpty = (x: undefined | unknown | unknown[]) => { if (Array.isArray(x)) { @@ -93,7 +96,7 @@ export function keepLatest({ when, value: valueFn }: Options({ when, value: valueFn }: Options assert( `Expected record to exist at index ${i}, but it did not. ` + - `The array item is expected to exist, because the map utility resource lazily iterates along the indices of the original array passed as data. ` + - `This error could happen if the data array passed to map has been mutated while iterating. ` + - `To resolve this error, do not mutate arrays while iteration occurs.`, + `The array item is expected to exist, because the map utility resource lazily iterates along the indices of the original array passed as data. ` + + `This error could happen if the data array passed to map has been mutated while iterating. ` + + `To resolve this error, do not mutate arrays while iteration occurs.`, record, ); diff --git a/ember-resources/src/util/remote-data.ts b/ember-resources/src/util/remote-data.ts index 67470c48a..a63b534ba 100644 --- a/ember-resources/src/util/remote-data.ts +++ b/ember-resources/src/util/remote-data.ts @@ -9,19 +9,22 @@ import type { ResourceAPI } from '../core/function-based'; type FetchOptions = Parameters[1]; deprecate( - `importing from 'ember-resources/util/remote-data' is deprecated and will be removed in ember-resources@v7. ` - + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` - + `\`pnpm add reactiveweb\` and then \` import { RemoteData } from 'reactiveweb/remote-data';\`. ` - + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, true, { - id: `ember-resources.util.remoteData`, - until: `7.0.0`, - for: `ember-resources`, - url: `https://reactive.nullvoxpopuli.com/functions/remote_data.remoteData-1.html`, - since: { - available: '6.4.4', - enabled: '6.4.4', - } -}); + `importing from 'ember-resources/util/remote-data' is deprecated and will be removed in ember-resources@v7. ` + + `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + + `\`pnpm add reactiveweb\` and then \` import { RemoteData } from 'reactiveweb/remote-data';\`. ` + + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, + true, + { + id: `ember-resources.util.remoteData`, + until: `7.0.0`, + for: `ember-resources`, + url: `https://reactive.nullvoxpopuli.com/functions/remote_data.remoteData-1.html`, + since: { + available: '6.4.4', + enabled: '6.4.4', + }, + }, +); /** * @protected From 5a12c1710ebbab656e447cfc28bff20c2dcd6a29 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Fri, 5 Jan 2024 18:48:00 -0500 Subject: [PATCH 4/4] Middle arg needs to be false --- ember-resources/src/util/debounce.ts | 2 +- ember-resources/src/util/ember-concurrency.ts | 2 +- ember-resources/src/util/fps.ts | 2 +- ember-resources/src/util/function.ts | 2 +- ember-resources/src/util/helper.ts | 2 +- ember-resources/src/util/keep-latest.ts | 2 +- ember-resources/src/util/map.ts | 2 +- ember-resources/src/util/remote-data.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ember-resources/src/util/debounce.ts b/ember-resources/src/util/debounce.ts index 2fc818060..5ddd0b315 100644 --- a/ember-resources/src/util/debounce.ts +++ b/ember-resources/src/util/debounce.ts @@ -8,7 +8,7 @@ deprecate( `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + `\`pnpm add reactiveweb\` and then \` import { debounce } from 'reactiveweb/debounce';\`. ` + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, - true, + false, { id: `ember-resources.util.debounce`, until: `7.0.0`, diff --git a/ember-resources/src/util/ember-concurrency.ts b/ember-resources/src/util/ember-concurrency.ts index 67fca2591..7eba2b384 100644 --- a/ember-resources/src/util/ember-concurrency.ts +++ b/ember-resources/src/util/ember-concurrency.ts @@ -23,7 +23,7 @@ deprecate( `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + `\`pnpm add reactiveweb\` and then \` import { task, trackedTask } from 'reactiveweb/ember-concurrency';\`. ` + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, - true, + false, { id: `ember-resources.util.trackedTask`, until: `7.0.0`, diff --git a/ember-resources/src/util/fps.ts b/ember-resources/src/util/fps.ts index ab3e56a57..42c2d123c 100644 --- a/ember-resources/src/util/fps.ts +++ b/ember-resources/src/util/fps.ts @@ -7,7 +7,7 @@ deprecate( `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + `\`pnpm add reactiveweb\` and then \` import { FrameRate, UpdateFrequency } from 'reactiveweb/fps';\`. ` + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, - true, + false, { id: `ember-resources.util.fps`, until: `7.0.0`, diff --git a/ember-resources/src/util/function.ts b/ember-resources/src/util/function.ts index 855aaf9d5..8bf8b2eaa 100644 --- a/ember-resources/src/util/function.ts +++ b/ember-resources/src/util/function.ts @@ -12,7 +12,7 @@ deprecate( `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + `\`pnpm add reactiveweb\` and then \` import { trackedFunction } from 'reactiveweb/function';\`. ` + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, - true, + false, { id: `ember-resources.util.function`, until: `7.0.0`, diff --git a/ember-resources/src/util/helper.ts b/ember-resources/src/util/helper.ts index 700acfa28..73135798b 100644 --- a/ember-resources/src/util/helper.ts +++ b/ember-resources/src/util/helper.ts @@ -16,7 +16,7 @@ deprecate( `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + `\`pnpm add reactiveweb\` and then \` import { helper } from 'reactiveweb/helper';\`. ` + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, - true, + false, { id: `ember-resources.util.fps`, until: `7.0.0`, diff --git a/ember-resources/src/util/keep-latest.ts b/ember-resources/src/util/keep-latest.ts index e681c7e35..4130c583c 100644 --- a/ember-resources/src/util/keep-latest.ts +++ b/ember-resources/src/util/keep-latest.ts @@ -7,7 +7,7 @@ deprecate( `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + `\`pnpm add reactiveweb\` and then \` import { keepLatest } from 'reactiveweb/keep-latest';\`. ` + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, - true, + false, { id: `ember-resources.util.keepLatest`, until: `7.0.0`, diff --git a/ember-resources/src/util/map.ts b/ember-resources/src/util/map.ts index 8a44f3f96..96665c2de 100644 --- a/ember-resources/src/util/map.ts +++ b/ember-resources/src/util/map.ts @@ -11,7 +11,7 @@ deprecate( `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + `\`pnpm add reactiveweb\` and then \` import { map } from 'reactiveweb/map';\`. ` + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, - true, + false, { id: `ember-resources.util.map`, until: `7.0.0`, diff --git a/ember-resources/src/util/remote-data.ts b/ember-resources/src/util/remote-data.ts index a63b534ba..ccb39f55b 100644 --- a/ember-resources/src/util/remote-data.ts +++ b/ember-resources/src/util/remote-data.ts @@ -13,7 +13,7 @@ deprecate( `The exact same code and support is available at https://github.com/universal-ember/reactiveweb. ` + `\`pnpm add reactiveweb\` and then \` import { RemoteData } from 'reactiveweb/remote-data';\`. ` + `See also: https://github.com/NullVoxPopuli/ember-resources/issues/1061`, - true, + false, { id: `ember-resources.util.remoteData`, until: `7.0.0`,