kenwheeler / mcfly

Flux architecture made easy
BSD 3-Clause "New" or "Revised" License
762 stars 46 forks source link

Rethrown errors difficult to debug #36

Open tomatau opened 9 years ago

tomatau commented 9 years ago

I'm finding that a lot of times the reThrown errors from Action.js are quite ambiguous and hard to trace down.

Often the stack trace is not visible as it is rethrown from inside the Action.js and masks the origin of the actual error - combined with source maps this has even more inconsistencies.

Attempting to recreate an error seems to not be working right now but this is definitely happening - will post more details when it happens again.

kenwheeler commented 9 years ago

I've been exploring removing Promises from McFly. Internally, Facebook seems to be handling async in the stores rather than the actions:

http://ianobermiller.com/blog/2014/09/15/react-and-flux-interview/

Thoughts? Promises feel like more trouble than they are worth.

tomatau commented 9 years ago

I recently found this panel discussion https://www.youtube.com/watch?v=LTj4O7WJJ98 regarding flux - at a point they compare the two approaches used internally in Facebook by two teams. Seems like one team fetches (async) in stores and the other fetches in Action creators. The panel lead seems to prefer the ActionCreator async approach as it's easier to share logic and also not tie data to a specific endpoint.

I've been scaling fairly well with promises in action creators but I just lose some errors every now and then into a pyramid of promises.