-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Official FAQ #1312
Comments
This would make a great top-level doc entry. |
Here is a resource which starts out a bit negative but has practical advice (for example, use that insight to improve your site’s content) and links to more. http://alistapart.com/article/infrequently-asked-questions-of-faqs |
@pedrottimark , thanks for the pointer. Throwing together a scratch list of initial possible questions / topics as I skim through the issues list and SO questions:
Related "docs"-tagged issues and assorted discussions:
That's a quick first cut. @gaearon , you've obviously been answering a lot more questions about Redux for longer than anyone else. Any suggestions for topics you'd like to have some centralized answers covered? |
In general, a lot of questions seem to be about structuring reducers and areas of responsibility (Redux state vs component state, logic in actions vs logic in reducers). Also storing non-primitives/objects in the state. I know that the "combineReducers" doc page talks about structuring reducers, but perhaps there ought to be a more comprehensive page on that topic? |
Lots of questions are answered in the docs but I guess it's still good to have a short question--short answer section with links to articles/sections of the docs/discussions. Structuring
Performance
Other
|
Some other things that we can transform into questions if necessary:
|
More ideas:
|
This is a great idea. Other points you might consider:
I'm only just starting out with redux, but if I can be of any help putting these together, even if it's only answering "are these answers non-expert friendly", then I'll be happy to help. |
Thanks for the links. I'm hoping to have some time to throw together a first draft sometime this week. |
Here's an initial draft outline for the FAQ page:
The intent would be to give a reasonably short answer to each question, along with links to further reading. I would also want to write up a full page on structuring reducers, since that seems to be a topic worth a lot more detail. Would appreciate suggestions, comments, critiques on this list. |
Wow awesome list 👍 Tiny note from me:
I think the whole action objects should be serializable, not just "type". And there is one more question: if a middleware requires "name", not "type", what should I do? I have this in mind: https://github.com/gajus/redux-convention |
Great stuff 👍 |
I will take a thumbs-up from @gaearon as the signal to go ahead :) |
Okay, semi-related issue. Cloned my fork,
Looking at it, it's a code sample that's doing inline styles, and thus has a Any particular reason why this hasn't noticed and fixed already by someone else? I'd expect it to actually have blocked major edits to the docs. |
Argh. Um. One more question: the CONTRIBUTING page says to use typography stuff like smart quotes. I'm trying to follow suit and do so, but the result isn't coming out well. The resulting HTML is coming out as everyone's favorite Unicode diamond question mark characters instead. I've tried copying and pasting the smart quote characters from CONTRIBUTING.md, typing them in manually (I'm on Windows, so ALT+0147/0148), etc. They actually seem to render okay over at http://jbt.github.io/markdown-editor , but not in Gitbook's output. Is there some trick I'm missing to this? |
Interesting. Maybe a regression in Gitbook?
Can’t reproduce it.
Do you have the same problem on the current docs website? |
Yeah, NPM installed Gitbook 2.4.3 here as well. Looking at redux.js.org, smart quotes render okay in my browser. Looking at the fresh build on my local box, smart quotes render okay in pages such as "Prior Art", but not in the FAQ page I was creating myself. Clearly there's something different about how I'm trying to use them. |
For now, just do as you find convenient (i.e. you can work on FAQ from Github interface, not use smart qoutes, etc). We’ll prettify before merging. |
@markerikson this is a great list 👏
In the answer we might want to note that an action could be unserializable initially, but should be serializable eventually after it's gone through a middleware chain. More questions to consider:
|
Got my initial progress over at https://github.com/markerikson/redux/blob/create-faq-page/docs/FAQ.md . Actual feedback on the content so far would be appreciated :) @Dattaya : yeah, a couple of items on middleware might be useful also. As for the reducers, that stuff would go into the "Structuring Reducers" page I'm hoping to add as part of this rather than directly into the FAQ list itself. |
Been busy the last couple nights, so the pace has slowed down to one or two answers written up per evening. But, making progress - 11 questions down, 14 to go at the moment. |
How to reset the state of a Redux store: |
@gaearon , I'd kinda skimmed past your "action in timeout" and "multiple dispatch" answers previously, but just had a chance to look at them again. No kidding, those deserve to be a new docs page right there. |
Just bringing it up because I see it asked alot and this is a FAQ 😅 |
Agreed. |
Sure, valid point, and I have asked for feedback :) I'm not entirely against putting that into the FAQ, but at the moment I would say it's less of a priority because it's not concerned with core Redux behavior. It's also a topic I'm not nearly as familiar with myself. If you or someone else had time to write it up, though, I'd totally take it as a PR against the branch I'm working on in my fork. |
I would love to help out and do that. Can you make the initial FAQ so I can structure what I put so that it matches with what you are going to write up? |
Yep. Re-pasting the link, the current WIP is at https://github.com/markerikson/redux/blob/create-faq-page/docs/FAQ.md . Basic format is a couple paragraphs explaining the answer in general, followed by 3-4 links to relevant Redux docs, issues, SO questions, or other relevant articles. |
Okay I'll get to it. |
@markerikson Made some changes you should have received a notification. |
Difference between Backbone and Redux: https://news.ycombinator.com/item?id=11187727 |
Yeah, could maybe toss that in along with a "When should I use Redux?" question. Doing some traveling tomorrow. Will see if I can crank out a few more answers during the trip. |
I read that as “doing some time traveling tomorrow”. 😂 |
Well, given that I'm crossing a couple time zones, that's not entirely inaccurate... :) |
This is probably already in the FAQ but I wrote again about |
How to dispatch different actions depending on the route? http://stackoverflow.com/questions/35665724/with-react-redux-router-how-should-i-access-the-state-of-the-route/35674710#35674710 |
Still cranking away on this. Got to 14 of 26 questions answered as of this evening, but then added two more to be answered ("When should I use Redux?" and "How many components should I connect?"). If anyone else would like to chip in, PRs still totally welcome :) |
Getting there. Spent most of the day on this, and I'm up to 23 of 29 questions complete. Might actually get the initial writeup completed within the next day or two. |
And there we go - all current 29 questions in the outline have answers written up. Can I get some feedback on the current writeup before I submit a PR? |
PR is an easier way to get feedback 😉 |
Sure. In the interest of keeping the history a bit cleaner, I'll try creating a second branch that has the content, but only one commit (unless you'd rather I just submit the PR as-is) |
No big deal about it, do anyhow you like. We barely make any source changes at this point so we don’t care much about clean history. |
Heh. Well, it's up - #1489. |
Related observation: it'd be nice to be able to link directly to certain questions once this is published in the docs. I know you can link to headings in Github Markdown, and Github provides those nice on-hover anchor icons to be able to copy the relative links. I see that Gitbook does add ID tags to headers, such as "#is-there-always-a-1-1-mapping-between-reducers-and-actions", but there's no easy way to copy that. Would adding something like https://github.com/rlmv/gitbook-plugin-anchors to Redux's Gitbook setup be a good idea? |
@markerikson, you are doing a great job! I've found a lot of answers and useful links in your FAQ. |
So. The core FAQ page is finally published. Per my last comment, it'd be nice if we could get easily-copyable anchors or shortcuts or something. Also up for discussion of further edits and improvements, like adding a ToC or splitting it up into sub-pages. Thoughts/suggestions? |
The FAQ is great. I think I already see less people asking the same questions. Let’s keep it up as it is for a while. You’re a collaborator so you should be able to reorganize it freely as you see fit. I made some minor stylistic edits in #1567 so if you can maintain those while changing things, it would be rad, but if not, not a big deal 😄 . I very much appreciate your work on this! |
Sure. I'm putting together a Table of Contents right now, with shortened anchors to making linking to each question easier. One question: per my earlier comments, I had trouble getting smart quotes and other typographical niceties to render properly for some reason. How are you going about entering those? |
Hmm. I’m usually editing markdown right in my editor and only view the result before publishing. |
Right, but how are you actually typing them in? I'm on a Windows box, and tried both copying and pasting smart quotes from other docs files into this one, and also using ALT+somenumber to enter them. The values looked okay in Markdown, but not in the output. Maybe I had my text editor set to a bad codepage or something? |
I’m on OS X which has different shortcuts. Could it be that you only had problems locally? I think I’ve seen this happen occasionally. Maybe you could try testing them in GitHub Preview. (or in this comment field :-) |
I've noticed a LOT of FAQs appearing in Reactiflux, SO, the issues list, etc. Stuff like "sharing state between reducer branches", and "any good-sized Redux examples?", and so on. Is there a good place to create an FAQ list for Redux? Should there be a new page in the docs folder? Add a wiki to this repo? Create a separate repo? I can always go create my own FAQ repo, but figure it's probably worth coordinating with everyone else on this.
The text was updated successfully, but these errors were encountered: