Skip to content
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

Don't tell people to use @ember/render-modifiers #1990

Open
ef4 opened this issue Jan 5, 2024 · 1 comment
Open

Don't tell people to use @ember/render-modifiers #1990

ef4 opened this issue Jan 5, 2024 · 1 comment

Comments

@ef4
Copy link
Contributor

ef4 commented Jan 5, 2024

@ember/render-modifiers was created as a legacy upgrade utility for people who had a large amount of classic Ember components. It is never appropriate for new code. It should not be recommended in the guides. https://guides.emberjs.com/release/components/template-lifecycle-dom-and-modifiers/#toc_calling-methods-on-first-render

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Jan 8, 2024

Additionally, the docs should not be recommending mutating tracked data in getters. This is a great way to cause infinite revalidation errors.

import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';

export default class TextComponent extends Component {
  @tracked _value;

  get value() {
    if (this.args.disabled) {
      return (this._value = '');
    }

    return this._value;
  }

it seems that page is overly focused on keeping pre-octane idioms, rather than "given what you're used to, this is how you do X is a new app".

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

No branches or pull requests

2 participants