Live data from Hacker News

A SoundCloud client in React and Redux

robinwieruch.de

1–10 of 74 posts

Re: A SoundCloud client in React and Redux

#3

At work I've started keeping the reducer in the actions file, anyone else do that? This way they can share the same const declarations, and you don't have to toggle between two files when most actions / reducers are pretty small.

I started doing that pretty soon after starting with Redux, with some other tweaks to make them even more tightly coupled. It worked well for me, but I assume there is a reason not do that. However, I never figured that one out.

Re: A SoundCloud client in React and Redux

#5

At work I've started keeping the reducer in the actions file, anyone else do that? This way they can share the same const declarations, and you don't have to toggle between two files when most actions / reducers are pretty small.

Of course: https://github.com/erikras/ducks-modular-redux

The potential reason not to do that is that more than a reducer may listen for a given action, even though I guess it's more an exception than the norm.

Re: A SoundCloud client in React and Redux

#6
Cool to see so much packed into one place. In my experience with React and Redux, there have been two major challenges in finding well-documented examples to follow. First is finding anything that describes more than a toy project that just demonstrates the most straightforward implementation of one-way data flow. This tutorial isn't bad, although it's comparable to the reddit-based tutorial in the Redux docs. The second challenge is finding documentation that is up-to-date with the latest versions of all the tools. This is even more challenging when the dependency versions aren't explicit - it would be very helpful to add this info up front in this tutorial, especially since Webpack 2 is just around the corner, and React Hot Loader 1 is deprecated in favor of the soon-to-be-release version 3 - dependencies in the Redux-React world are moving fast so all documentation needs to be 'pinned' to explicit versions.

It's also good to see a pretty complete description of the testing setup, although I have some concerns about the "inject everything into the `global` object in setup" approach, which is a relatively coarse technique for simulating a browser environment in Node, and means the unit tests are running in a "special" environment unlike the actual running application environment. No one has completely solved this problem, but it's an important part of the discussion for anyone wanting to do things "right" from the beginning. Injecting `React` as a global variable for convenience also makes me cringe a little bit, given the ease of writing explicit dependencies in modern javascript.

Nice step-by-step article though - I like that there are a growing number of accessible entry points like this and I look forward to the community growing and maturing to define best practices.

Re: A SoundCloud client in React and Redux

#7

Cool to see so much packed into one place. In my experience with React and Redux, there have been two major challenges in finding well-documented examples to follow. First is finding anything that describes more than a toy project that just demonstrates the most straightforward implementation of one-way data flow. This tutorial isn't bad, although it's comparable to the reddit-based tutorial in the Redux docs. The se…

Here's a recent and great React + Redux testing example using the AVA test runner, which doesn't allow globals:

http://silvenon.com/testing-react-and-redux/

Disclaimer: I am in the AVA team. It really is cool though.

Re: A SoundCloud client in React and Redux

#8
Solid article. In addition, I keep a list of high-quality React and Redux tutorials over at https://github.com/markerikson/react-redux-links (as well as a Redux addons catalog at https://github.com/markerikson/redux-ecosystem-links). Working on an update to the tutorials list today, and this article's going in.

Re: A SoundCloud client in React and Redux

#9

Cool to see so much packed into one place. In my experience with React and Redux, there have been two major challenges in finding well-documented examples to follow. First is finding anything that describes more than a toy project that just demonstrates the most straightforward implementation of one-way data flow. This tutorial isn't bad, although it's comparable to the reddit-based tutorial in the Redux docs. The se…

That's one of the reasons why I've been pulling together a list of full-blown open source Redux-based apps and larger-scale examples over at https://github.com/markerikson/redux-ecosystem-links/blob/ma.... Mozilla Firefox's debugger (current and future), the Wordpress Admin Panel, and the Jenkins UI all qualify as reasonably more than a Todo List or Reddit Viewer example.

Re: A SoundCloud client in React and Redux

#10

At work I've started keeping the reducer in the actions file, anyone else do that? This way they can share the same const declarations, and you don't have to toggle between two files when most actions / reducers are pretty small.

I originally tried this but then discovered combineReducers() this will allow you to organise your reducers into a single import. I found it a more sane way to organise all of my reducers, as the majority of them were small. Here's a link for API http://redux.js.org/docs/api/combineReducers.html
Post reply on HN