These are chat archives for jdubray/sam-examples

25th
Feb 2016
Stardrive Engineering
@HighOnDrive
Feb 25 2016 01:41

@brusand Just wanted to chime in and say that the right reactive loop pattern and then modularization are most important. Everyone hypes components yet they are only there to make up the real estate of the UI with widgets. These widgets can be simple DIVs or stateless functions done with any DSL of your liking, however using them as a place to put all logic functionality is not smart.

What I think works best is to first have a good idea about what you want (not just blindly follow the hype) and then extract all logic, UI partials and control state out into separate modules. Then use components (and even Cycle.js drivers) ONLY as adapters (just essential intermediares between the external world or the vDOM, etc).

What that lets you do is pin your modularized functions to the components and drivers in the most decoupled way possible. That way the technology backing the components can be swapped out and all your modules (the meat of your app) are not in a hostage situation (at the mercy of the next great late framework).

This strategy IMHO is also important if we are going to supersede frameworks. So in a SAM solution I would have modules for each stage of SAM, then wire them together in the adapter shell components in the most transparent way possible.

Actually, even the not-terminal wiring functions that wire up the terminal functions should be in modules. Components should remain as empty as possible.

Jean-Jacques Dubray
@jdubray
Feb 25 2016 01:46
+1M

yes, exactly:

use components (and even Cycle.js drivers) ONLY as adapters (just essential intermediares between the external world or the vDOM, etc).

Components should remain as empty as possible.

It's also you are more free to move that logic where it makes the most sense. React is client heavy, but it does not have to be that way at all. I favor a lot more balance with the server, though I can appreciate why Facebook is trying to use as many CPU cycles on the client. That kind of architecture does not work for everyone.
If you have tried to write some isomorphic code with React, that is a complete nightmare, when with SAM it is a complete piece of cake (at least the SAM implementation I build which is not Framework based)
Stardrive Engineering
@HighOnDrive
Feb 25 2016 01:57
@jdubray Strategy is important if we are to survive the framewars! Have been away but following the exciting developments with SAM. I think getting SAM into the Flux-challenge is a great way forward :+1:
Jean-Jacques Dubray
@jdubray
Feb 25 2016 03:06
agreed
Jean-Jacques Dubray
@jdubray
Feb 25 2016 05:21
@HighOnDrive I would like to quote your previous comment on the view in the SAM tutorial. Would it be ok. Could we connect on linkedin?
brusand
@brusand
Feb 25 2016 09:00
@HighOnDrive yes totally agréé with you, actualy with type script ans angular 1 ans qui router we czn organise code like login.module.ts , login.route.ts, login.view.tpl, login.contrôler.ts. .... with sam, we could have login.modèle.ts, login.state.ts, login.action.ts, all bases on. Dépendance injection. I ll post a link on a simple projection
Project
Stardrive Engineering
@HighOnDrive
Feb 25 2016 13:00
@jdubray Sure, use the quote, cheers!
Stardrive Engineering
@HighOnDrive
Feb 25 2016 13:13
If possible give me a preview, thanks.
Jean-Jacques Dubray
@jdubray
Feb 25 2016 17:30

@HighOnDrive I was thinking something along the lines of:

A good Front-End Architecture should allow you to pin your modularized functions to the UI components in the most decoupled way possible. That way the technology backing the components can be swapped out and all your business logic are not in a hostage situation (at the mercy of the next great late framework).

would that be representative of what you were saying?

Stardrive Engineering
@HighOnDrive
Feb 25 2016 22:28
@jdubray Just in from my day, like what you have distilled from the point I was making :+1:
Maybe change "your business logic are not" to "your business logic is not"
Jean-Jacques Dubray
@jdubray
Feb 25 2016 22:36
sure, thank you. Do you want to be quoted as HighOnDrive or with your real name?
Stardrive Engineering
@HighOnDrive
Feb 25 2016 22:58
Use my real name, "High On Drive" is the title of a song I wrote for my prog rock band Stardrive Engineering :smile:
All the bands songs have the "Rocket Launcher" theme :rocket:
Jean-Jacques Dubray
@jdubray
Feb 25 2016 23:09
Ah ah... you can't dislike SAM then. What it your real name?
Stardrive Engineering
@HighOnDrive
Feb 25 2016 23:20
Thomas J. Buhr, did you get the linkedin connection from me?
Jean-Jacques Dubray
@jdubray
Feb 25 2016 23:20
Yes, I did thank you!!