Skip to content

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/@ember+test-helpers@4.0.4_@babel+core@7.26.0_ember-source@6.0.1_@glimmer+component@2.0.0_rsvp@4.8.5_webpack@5.97.1_/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