DavideCarvalho / demolay-event-management

System to help on managing demolay's events on São Vicente
1 stars 0 forks source link

Technical debts #1

Open DavideCarvalho opened 6 years ago

DavideCarvalho commented 6 years ago

Okay, now that I'm not beeing pushed to deploy it ASAP, I can start to take care of the things i've done. I'll try to make a more react-ish approach:

And if everything is alright, I can think in something to test the components, something like Cypress

DavideCarvalho commented 6 years ago

Well, redux bindings are more react-ish now and waaaaay more elegant, there is a but in it, tho... I couldn't put the reducers I wanted inside props properties. Seems like Hybrids only accepts a flat tree of properties, so for now, I'm using only getState() inside of the props, so the props has all the reducers inside of it (It works, but I dislike it). Talking to Hybrids owner, seems like I can do something like this:

const Component = {
  props: connect(store, ({ myReducer, myOtherThing } ) => ({ myReducer, myOtherThing })),
  mergedThings: ({ props }) => props.myReducer + props.myOtherThing, 
}

Maybe put this "mergedThings" logic inside my redux binding for Hybrids. I hope it works

DavideCarvalho commented 6 years ago

E2E tests are out of league of now. Cypress can't access shadowDom for now. Maybe Selenium or WebDriver could do the trick, but I wanted something to make E2E tests easier, and Cypress definitely is the main choice. There is an issue on Cypress about it, maybe i'll wait for it a little longer and see how this goes before trying Selenium or WebDriver

DavideCarvalho commented 6 years ago

"Route components MUST NOT be containers, they are just High Order Components, and their object is just to compose the view." This is true, but routes like Entrada ("www.system.com/") has only one form, this would make it only call tag, doesn't make much sense for me. So i'm making this rule less strict FOR NOW, since the routes are basically one component. I'm changing this for: "Route components MUST NOT be containers if they have a bunch of stuff to do inside of it. If the route is only one component (or it has a only one responsability), I can let the route be a container"

DavideCarvalho commented 6 years ago

So, stuff got a little different, some of the business logic are being changed