These are chat archives for jdubray/sam

5th
Apr 2018
Daniel Neveux
@dagatsoin
Apr 05 2018 07:09
I can't get the point too. Does he compare SPA route system to the only-care-what-it-is-visible-to-the-camera system (frustum culling) ?
Victor Noël
@victornoel
Apr 05 2018 14:55
I think it means that the state is one thing, and the view (and the navigation that brings you to various views) are another thing. the state shouldn't be directly dependent on navigation. navigation is changing views.
Riccardo
@riccardoferretti
Apr 05 2018 15:28
I agree navigation should be dependent on model/state, not the other way around. there are still a few ways to achieve that though (e.g. via actions, which from what I understand manage most of the side effects, or in some sort of "middleware", ..) and I am curious to understand how SAM views it
separately, the "view unwrap / layer reposition" is a concept I am not familiar with and I agree it would be interesting to know how it applies to SPA
devin ivy
@devinivy
Apr 05 2018 15:30

I agree navigation should be dependent on model/state

as i see it, the most important thing is that there's a single source of truth for nav state, not that it lives in a specific model object (for example).

in my apps i do tie navigation into my application's state/actions, but that's primarily to interop with time travel.
Michael Terry
@formido
Apr 05 2018 16:14
To me navigation might mean moving to another URL and in some cases moving to another URL might require a totally different model and thus state
So navigating is not necessarily just a different look at the same state, at least not from an SPA perspective
Riccardo
@riccardoferretti
Apr 05 2018 16:17
is that still the case for an SPA? if you have a list of projects, click on a project and "navigate" to the details of the project, would you say you have 2 different models?
the way I think about it, navigation in an SPA has two purposes: 1. deep linking support 2. "backward compatibility" with the way browsers think about things
basically, if the url bar were hidden, and I didn't care about the user having to quickly reach a certain state of the app, I would do without navigation
am I missing something?
Michael Terry
@formido
Apr 05 2018 16:22
Depends on the details
To me, an SPA's model is the shape of the data currently loaded
Some apps I own could not load the entire shape of project data in a single view
it wouldn't make sense
The projects and report system is too complex
Victor Noël
@victornoel
Apr 05 2018 16:26
when you play WoW, the whole state of the world is not loaded in your computer either
Michael Terry
@formido
Apr 05 2018 16:28
Great, so what are game devs doing better than mobile web devs?
Victor Noël
@victornoel
Apr 05 2018 16:28
I don't think the tweet above in being disruptive in the paradigm it favours: it is already in the idea of SAM (and of many other approaches) to clearly separate the view from state of the application and to use navigation just as a way to change the view on the current state of the app
well, I should say a view on the model (via the state representation that is generated, depending on where you are in terms of navigation)
so game dev are not better than all mobile devs, but many mobile devs are making really crappy architectural design, while game dev often don't have this luxury and also game dev is a much better understood field
Michael Terry
@formido
Apr 05 2018 16:43
Yeah, that's a good point
Michael Terry
@formido
Apr 05 2018 16:51
That is, I was taking the tweet from the perspective of "this is something new that all or most web devs are missing", but in reality it's just reinforcing what is already a big movement in web development
UI code sucks because of the ad-hoc navigation implementation. It lacks UI state to "view unwrap / layer reposition" logic
I take this to mean "bad web devs have some state implied by the navigation, but you should make that state explicit in the app state"
Other interpretations?
Web devs will benefit a lot writing a 3D game to understand that navigation is just camera movements and objects activations.
And then I'm not sure what to make of this exactly, what's the analogy to an SPA
?
Michael Terry
@formido
Apr 05 2018 17:03
Moving to a new url is navigation
is it "just camera movements and objects activations"?
I think @jdubray has said a URL is an action, and actions can mutate state of course
Michael Terry
@formido
Apr 05 2018 17:19
well, not mutate state, but suggest that we mutate state ;)