Skip to content

Conversation

wagenet
Copy link
Contributor

@wagenet wagenet commented Jun 20, 2025

Copy link

netlify bot commented Jun 20, 2025

Deploy Preview for ember-deprecations ready!

Name Link
🔨 Latest commit d70ce5d
🔍 Latest deploy log https://app.netlify.com/projects/ember-deprecations/deploys/689b8be0b2be1200075f31fb
😎 Deploy Preview https://deploy-preview-1405--ember-deprecations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

After:

```javascript
const person = { firstName: 'Tom', lastName: 'Dale' };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const person = { firstName: 'Tom', lastName: 'Dale' };
const person = {
firstName: 'Tom',
lastName: 'Dale',
get fullName() {
// or person.firstName person.lastName
return `${this.firstName} ${this.lastName}`
}
};

why proxy at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good point. I guess we don't really need to proxy for this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, on further consideration, this would be for the case where you didn't want to modify the underlying content, hence a proxy.

{{/let}}
```

For simpler cases where you don't need the full power of a library like `ember-concurrency`, you can manage the state manually with `@tracked` properties:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is also getRequestState from warp-drive, which is probably worth mentioning

{{/if}}
```

Using a library like [ember-concurrency](https://ember-concurrency.com/docs/introduction) is highly recommended for managing asynchronous tasks in Ember applications, as it provides robust solutions for handling loading/error states, cancellation, and more.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Using a library like [ember-concurrency](https://ember-concurrency.com/docs/introduction) is highly recommended for managing asynchronous tasks in Ember applications, as it provides robust solutions for handling loading/error states, cancellation, and more.
Using a library like [ember-concurrency](https://ember-concurrency.com/docs/introduction) is highly recommended for managing concurrent asynchronous user-initiated tasks in Ember applications, as it provides robust solutions for handling loading/error states, cancellation, and more.

@ef4
Copy link
Contributor

ef4 commented Jun 27, 2025

I suspect the biggest hazard when trying to clear this deprecation is that computeds elsewhere in your app that depend on an ArrayProxy aren't going to react the same when you switch to TrackedArray. Maybe we should make a recommendation about removing computeds first before tackling this one?

@wagenet
Copy link
Contributor Author

wagenet commented Jun 27, 2025

I also want to deprecate computeds 😆

proxy.get('firstObject'); // 'amoeba'
```

After:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to add two approaches for "After" in <details> for:

  • exact technical replacement (change no consuming code) (what is shown here already)
  • recommended migration path for canonical array using

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description on this section reads:

If you were using ArrayProxy to easily swap out the underlying array while keeping a stable reference, you can achieve a similar, transparent effect using a native Proxy backed by a class with a @tracked property. Again, prefer tracked arrays and properties if you can refactor your code to use them.

So I think it's clear that this is the "exact technical" replacement.

@wagenet
Copy link
Contributor Author

wagenet commented Aug 12, 2025

I've added a note about ComputedProperties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants