[Proposal] Give the Reagent examples some TLC
mchughs opened this issue · 1 comments
mchughs commented
I was going through some of the examples, in particular the react-context
and the functional-components-and-hooks
examples.
I noticed a lot of little issues.
Problems with both:
- Builds are based on
lein-figwheel
, a deprecated build tool. With examples you want to just start them up as quickly as possible to play around with the underlying example. You don't want to fiddle with a build. I'd propose usingdeps.edn
andshadow-cljs
as I believe they are more standard nowadays, but if there is a particular affinity for lein and figwheel we could atleast move it tofigwheel-main
. - The versions for some of the dependencies are out-of-date which actually causes problems if you try to play around with new features in the example. I can bring everything up to date.
- Should explicitly pull in react and react-dom latest versions.
Just in react-context
:
- No README.md present despite the index.html indicating there should be.
- It's pulling in
[cljsjs/react-sortable-hoc "1.11.0-0"]
as a depency ostensibly to just pull in react and react-dom? - I think it makes sense to add a bit about
react/useContext
. This would require using the:>f
tag too.
Just in functional-components-and-hooks
:
- The build process is more complicated than it needs to be. Am I going to be going to prod with example code?
- The build compains it can't find react-dom if you don't include it as a dependency. (I don't see where it's being used though so it's kinda of weird. Any ideas?)
I'm happy to make an MR for these two and I can also take a look at the other ones as well. Is there anything I proposed which you disagree with?
Deraen commented
Sounds good.
Some of the examples are missing cljsjs react and react-dom dependencies as those were included in Reagent before 1.1.0.