This is a tracking issue to cover all tasks related to rewriting our existing example projects.
todos vs todomvc vs todos-flow)@markerikson I think I could help to rewrite some examples, but I need to know how fast they must be rewritten.
@markerikson Hi, quick question: for the first task of deciding which examples can be removed, you wanna decide between all the examples or just between the three you mentioned or between the similar ones?
Anyway:
Ultimately, I think that all the other examples are ok to keep!
As of now I'm about to refactor the counter example, count me on 馃槂
@giacomocerquone I think it's worth reviewing _all_ the examples, deciding what the _original_ intended purpose was, and then deciding what the overlap is and what should be removed.
I do actually think the tree-view example is useful - this was a big question early on in the life of Redux about "do I just connect the top component, or multiple components?", and it shows components extracting items from the store based on ID as well as recursive rendering. Someone over in Reactiflux was actually trying to port that to hooks as a learning exercise yesterday, which is what prompted me to file this issue.
todomvc is a slightly larger version of todos. This was more relevant when the TodoMVC project was being widely used as a comparison between varying UI frameworks, and it at least _looks_ nicer than the barebones todos project, but tbh it can probably be removed.
Haven't looked at async lately, but yes, it can probably be removed.
I would honestly just go replace counter with the contents of our Redux+JS template for Create-React-App:
https://github.com/reduxjs/cra-template-redux
Flow is dead, effectively. I would delete that one.
On the other hand, I would _consider_ having a counter-ts example that copy-pastes the Redux+TS template for CRA. We ought to at have least one TS-based example in there somewhere.
The other thing to consider is that I've built out a larger real-world-ish app as the example for the "Essentials" tutorial, here:
https://github.com/reduxjs/redux-essentials-example-app
and this TodoMVC-based app for the "Fundamentals" tutorial:
https://github.com/reduxjs/redux-fundamentals-example-app
We're going to keep those repos because I want them to be independently cloneable so people can try out the projects themselves, but we should probably either link to them on the "Examples" docs page, or copy-paste the final versions of the code into projects in the /examples folder.
@zpwebbear : No particular timeline for this. It's just something that crossed my mind yesterday as a thing that needs to be done at some point.
@markerikson
All clear, tbh don't like the idea of copying stuff though. For the counter example it's ok I suppose, but for everything else that might have even just a few changes in time, I'd leave a link so that they don't have to be synced every time.
So I'm about to prepare a PR for:
todomvc and the async examplesActually instead of linking the stuff, we could also copy the redux-fundamentals-example-app repo inside the example repo, but I've never experimented with this kind of configuration
yes, or even simpler, symlinks: https://stackoverflow.com/a/4660048/2809729
I don't think you can symlink across repositories, unless you require users always clone both repositories in the same place relatively, but they that would probably break on GitHub. GitHub supports submodules, though I'm not sure about subtrees as they're newer.
@nickmccurdy clear enough for me. Let's just link them in the README, once some contributor, or directly mark, will have tested this solution (if he likes it) we will change it!
I'm working on real-world
This is made redundant by #3565. I would still like to move the examples out of this repo, as they add a ton of weight to the test process and a lot of noise to the git history.
I'd forgotten that that PR existed.
Biggest issue is that there are external links pointing to those folders. At a bare minimum, we would need to replace all of those folders' contents with a README that points to the new location.
We can submodule it.
@markerikson I would prefer to rewrite the shopping-cart. Do I need to use typescript to show the whole might of RTK?
Do I need to create the PR at the very beginning of work to be able to see the process of rewriting, or we just will replace the example folder with the single commit from PR when work will be done?
I didn't write it, but apart from the #3919 which is reorganizing the whole examples folder (and I still don't know if it will have to be closed), I'd like to refactor the "todos"
Most helpful comment
@giacomocerquone I think it's worth reviewing _all_ the examples, deciding what the _original_ intended purpose was, and then deciding what the overlap is and what should be removed.
I do actually think the
tree-viewexample is useful - this was a big question early on in the life of Redux about "do I just connect the top component, or multiple components?", and it shows components extracting items from the store based on ID as well as recursive rendering. Someone over in Reactiflux was actually trying to port that to hooks as a learning exercise yesterday, which is what prompted me to file this issue.todomvcis a slightly larger version oftodos. This was more relevant when the TodoMVC project was being widely used as a comparison between varying UI frameworks, and it at least _looks_ nicer than the barebonestodosproject, but tbh it can probably be removed.Haven't looked at
asynclately, but yes, it can probably be removed.I would honestly just go replace
counterwith the contents of our Redux+JS template for Create-React-App:https://github.com/reduxjs/cra-template-redux
Flow is dead, effectively. I would delete that one.
On the other hand, I would _consider_ having a
counter-tsexample that copy-pastes the Redux+TS template for CRA. We ought to at have least one TS-based example in there somewhere.The other thing to consider is that I've built out a larger real-world-ish app as the example for the "Essentials" tutorial, here:
https://github.com/reduxjs/redux-essentials-example-app
and this TodoMVC-based app for the "Fundamentals" tutorial:
https://github.com/reduxjs/redux-fundamentals-example-app
We're going to keep those repos because I want them to be independently cloneable so people can try out the projects themselves, but we should probably either link to them on the "Examples" docs page, or copy-paste the final versions of the code into projects in the
/examplesfolder.@zpwebbear : No particular timeline for this. It's just something that crossed my mind yesterday as a thing that needs to be done at some point.