Skip to content
This repository has been archived by the owner on May 26, 2019. It is now read-only.

Encourage decorator-style Ember.computed/Ember.observer #457

Merged
merged 1 commit into from
Jul 23, 2015

Conversation

HeroicEric
Copy link
Member

  • Use Ember.computed over property()
  • Use Ember.observer over .observes()

fixes #455

```

This is possible because Ember extends the `function` prototype. This is no
longer the recommended syntax.
Copy link
Member Author

Choose a reason for hiding this comment

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

Wasn't sure whether or not to just completely remove this and the other one like it for .observes()

Copy link
Contributor

Choose a reason for hiding this comment

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

@stefanpenner @mixonic @tomdale do any of you have any thoughts about this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ooh, I have an idea. We could take this out of here and move https://github.com/emberjs/guides/blob/master/source/configuring-ember/disabling-prototype-extensions.md into this Object Model section. We'll just need to change the wording a bit to make it flow right. Does that seem okay?

Copy link
Member

Choose a reason for hiding this comment

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

I am very much not in favor of integrating caveats about prototype extensions into the main flow.

I'd like to see us pick a happy path and talk only about that happy path in the primary documentation. Anything that deviates from the happy path can be moved to an auxiliary guide. If we make non-proto-extension syntax the default, let's update to that everywhere and create a legacy appendix describing how that syntax works for folks who need to work on code bases that use prototype extension.

Copy link
Contributor

Choose a reason for hiding this comment

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

I second removing proto-extensions references from the guides, especially since we have versioning. If people think they were removed and can't use them, well we're halfway to our goal ;)

@michaelrkn
Copy link
Contributor

Awesome!!! Let's get some feedback on your question and then get this merged in!

@HeroicEric
Copy link
Member Author

Updated and removed the inline references to the old syntax in the guides for computed properties and observers.

michaelrkn added a commit that referenced this pull request Jul 23, 2015
Encourage decorator-style Ember.computed/Ember.observer
@michaelrkn michaelrkn merged commit b18d4d7 into emberjs:master Jul 23, 2015
@HeroicEric HeroicEric deleted the ghosts-be-gone branch July 23, 2015 22:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Encourage decorator-style Ember.computed/Ember.observer
4 participants