question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

need to documenting model-routing order?

See original GitHub issue

When bootstrapping an app in version 2.3.1 we did this:

app.router((route) => [route('/', Submission(app))])

…where Submission is a component that also made an app.model call. This no longer worked in v3, and had to be changed to

const root = Submission(app)
app.router((route) => [route('/', root)])

I’m guessing somehow the new architecture required the app.model calls to have been made before the routing. If this is really so, perhaps it should be documented?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
krawallercommented, Jul 6, 2016

Haha, I was just returning here to say much what @yoshuawuyts did: I think we’re missing the point when comparing to React. Yes, the React version of the confirm button component is stateful and breaks hot reloading and time travelling.

But! In the Choo version, even though isolate the definition of the relevant model parts to the component, the actual state is still stored centrally. If you were to inspect the app state at any point, the confButt stuff would be there. My smart component is still dumb!

In essence - Choo is stupidly smart. Put that on the box!

I agree that putting the model definition on the exported function is cleaner than passing app to the constructor, good call.

2reactions
dereklieucommented, Jul 6, 2016

Or perhaps the value of having a centralised model trumps the value of isolating concerns in a component? Not an ironic question, I’m genuinely equal parts intrigued and unsure! 😃

I worked on an app that kept component state such as a confirmed = true localized while storing what we thought of as application state, like api query data, in a central redux store.

We found that the bits and pieces we thought of as component state actually added up to a pretty good amount, and usually that component state would affect how other components render. It wasn’t terrible in the end, but we’re working on a new version with choo that will try to store all the bits and pieces in the central place.

This also gets you an easier path to start the app from a moment in time, as long as you’ve got a copy of that store handy, which was a requirement for us.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Specifying a Route's Model - Ember Guides
Routes without dynamic segments will always execute the model hook. Reusing Route Context. Sometimes you need to fetch a model, but your route...
Read more >
What is process documentation, and why do I need it? - Slack
First, identify the process you are documenting. Give it a clear name and objective. Document the start and end points of the process....
Read more >
MIRAGE - A Simple-Model Routing Program for the Hierarchical ...
A simple-model routing program -MIRAGE- which is used in the hierarchical layout design of large scale IC masks is described together with some...
Read more >
Process documentation: The ultimate how-to with examples
Process documentation is a description of how to execute a process. It works by outlining the exact steps needed to complete a task...
Read more >
Common Data Model: Routing Data | Download Scientific Diagram
The inspiring principles for defining the data model has been. ... in order to satisfy the transport needs and guarantee the satisfaction of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found