Comments (3)
That's two different places in the guides where the semantics are referenced, on top of the API documentation. Suggest specific improvements to the Guides repo, as that is easier for us to keep track of and give feedback.
I don't agree with the modelHook
attribute, especially if it'll override the current semantics leading to more unexpected behaviour. Another question that might necessitate some more discussion is what happens when the model
hook isn't just, say, a store call, but a hash of several of them?
from rfcs.
Thanks for the input locks. I'll definitely make any specific suggestions re: improving the guides over in that repo.
I know that skipping the model hook via a passed in object is legacy API that has been around for quite sometime (and there are definitely cases where the behavior is warranted) but I believe a more declarative syntax would be beneficial in reasoning about an application behavior. I also believe this behavior was much more desirable when Ember Data lacked the semantics and facilities to do determination about when to reload models (via {reload: true} in queries, shouldBackgroundReload properties, etc.). Because this functionality now exists, the ability to pass in a model to avoid an API call is much less necessary.
Also, given JS's dynamic typing, there isn't anyway to guarantee what's being passed in to the helper, which leads to potential nondeterministic behavior in route initialization. Ultimately, there is no way to specify the desired behavior, either in the helper or the route...it is all determined at run time based on the type of object passed in. In general, this would not be good practice and potentially leads to challenges in reasoning about and debugging parts of an application.
For examples of the confusion caused, see discussions here and here.
IMHO (for whatever that may be worth...), I think having a clear interface to define whether a route should fire the model hook is a win across the board. The existing behavior could continue to remain the same, so as not to be a breaking change, but a higher degree of specificity could be achieved where a developer desires.
Finally, regarding your last point about more complex model hook behaviors...I think that's something that could warrant discussion, but is really outside the scope of what I'm proposing.
Thanks for taking the time to consider this change!
from rfcs.
I'm closing this due to inactivity. This doesn't mean that the issue is invalid, but that, unfortunately, nobody has taken the effort to spearhead it and bring it to completion. Please feel free to advocate for it if you believe that this is still worth pursuing. Thanks!
from rfcs.
Related Issues (20)
- V2 addons' build-time integration HOT 4
- Deprecate all of Ember Classic HOT 16
- Build-time configuration of index.html HOT 3
- Deprecate support for Travis CI HOT 6
- Deprecate `ember-mocha`? HOT 2
- Deprecate `ember-export-application-global` addon? HOT 4
- Run Prettier separately in `app` blueprint HOT 9
- Deprecate `app.import`
- Thoughts on this more ergonomic way to wire up the owner + destroyable association? HOT 2
- Explore "official" pod deprecation HOT 19
- {{else}} should render a value rather than be a control-flow keyword. HOT 5
- new primitive: transition, similar to modifiers, except they block certain render events HOT 2
- Numbers in PR titles affect automation
- Asset import spec RFC HOT 2
- Implement import spec RFC HOT 1
- Replacing `moduleName` in template meta HOT 11
- Simplified imports for common built-in modules HOT 2
- Pre-RFC: Add `aria-current` attribute to Ember's `LinkTo` component HOT 1
- Whitespace handling for `<template>` tag HOT 4
- Add LICENSE
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rfcs.