Skip to content

ember-data: Fix ember-data:deprecate-array-like warning #10173

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

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

eth3lbert
Copy link
Contributor

Since the underlying implementation of @reads uses .get(), which introduces deprecation warnings deprecation id: ember-data:deprecate-array-like, this commit fixes the warning by rewriting the @reads('some.deep.path') to equivalent @cached get function ().

This should hopefully resolve some deprecation warnings similar to the following:

{"type":"warn","text":"DEPRECATION: The EmberObject get method on the class RecordArray is deprecated. Use dot-notation javascript get/set access instead. [deprecation id: ember-data:deprecate-array-like] This will be removed in ember-data 5.0.\n        at logDeprecationStackTrace (http://localhost:7357/assets/vendor.js:712:308)\n        at HANDLERS.<computed> (http://localhost:7357/assets/vendor.js:667:339)\n        at raiseOnDeprecation (http://localhost:7357/assets/vendor.js:715:210)\n        at HANDLERS.<computed> (http://localhost:7357/assets/vendor.js:667:339)\n        at eval (webpack://crates-io/../../.pnpm/@[email protected]_@[email protected][email protected]_@[email protected][email protected][email protected]_/node_modules/@ember/test-helpers/dist/setup-context-Cx9HkMuO.js?:560:8)\n        at HANDLERS.<computed> (http://localhost:7357/assets/vendor.js:667:339)\n        at invoke (http://localhost:7357/assets/vendor.js:667:501)\n        at deprecate (http://localhost:7357/assets/vendor.js:772:442)\n        at deprecate$1 (http://localhost:7357/assets/vendor.js:968:335)"}

Since the underlying implementation of `@reads` uses `.get()`, which
introduces deprecation warnings `deprecation id: ember-data:deprecate-array-like`,
this commit fixes the warning by rewriting the `@reads('some.deep.path')`
to equivalent `@cached get function ()`.
@Turbo87 Turbo87 added A-frontend 🐹 C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear labels Dec 10, 2024
@Turbo87 Turbo87 merged commit c93ef34 into rust-lang:main Dec 10, 2024
9 checks passed
@eth3lbert eth3lbert deleted the fix-deprecate-array-like-warning branch December 10, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend 🐹 C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants