Skip to content

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

Open

Description

@ef4

@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

Activity

  1. NullVoxPopuli commented on Jan 8, 2024

    @NullVoxPopuli
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions