This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-14
Channels
- # aws-lambda (5)
- # beginners (38)
- # boot (197)
- # carry (7)
- # clara (3)
- # cljs-dev (7)
- # cljsjs (6)
- # cljsrn (24)
- # clojure (39)
- # clojure-art (10)
- # clojure-austin (7)
- # clojure-dusseldorf (1)
- # clojure-italy (8)
- # clojure-russia (89)
- # clojure-spec (119)
- # clojure-taiwan (1)
- # clojure-uk (19)
- # clojurescript (104)
- # community-development (2)
- # conf-proposals (22)
- # copenhagen-clojurians (8)
- # cursive (2)
- # datomic (35)
- # devcards (4)
- # dirac (79)
- # euroclojure (2)
- # immutant (35)
- # om (138)
- # om-next (2)
- # onyx (172)
- # proton (4)
- # protorepl (1)
- # re-frame (36)
- # reagent (34)
- # spacemacs (1)
- # specter (7)
- # untangled (89)
- # yada (2)
Hello all! I first created project with "lein new reagent myproject" but now I want to remove all server side code and just use figwheel to serve index.html that is located under resources/public folder. I am facing a problem where starting lein figwheel gives me following error: Could not locate mtg_cards/core__init.class or mtg_cards/core.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name. java.io.FileNotFoundException: Could not locate mtg_cards/core__init.class or mtg_cards/core.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name. I have tried multiple times to re-configure my project.clj file and still no luck. I have pushed current code to branch https://github.com/mtg-cards/mtg-cards-client/tree/remove-server Can someone familiar with figwheel let me know what am I doing wrong?
@artur: while I'm all for finding the source of errors and learning something in the process, I think that there are templates for frontend-only reagent projects.
lein new reagent-frontend myproject
@reefersleep yes there is and I already did create a new project with that and tried to apply the settings, but am still facing problems.
Well, that sucks 🙂
I've had similar problems several times, when I've been dependent on two different templates and wanted to merge them.
I've got an idea. I will create new frontend project and more the src folder to that and apply minor changes to env folder and project.clj :thumbsup:
That's how I've done it previously. Godspeed!
how do people deal with components which take an arbitrary number of children? i've been using (into [:whatever] children)
but this seems ill advised
i know typically when you want a sequence of children, you're supposed to use :key
, but what if the component doesn't know enough about the children to provide a :key
?
is it sane to use something like ^{:key (hash child)}
?
is that going to perform badly?
:key
is not needed when using (into [:whatever] children)
right, i'm trying to move away from into
, i believe it contributed to a bug i encountered
in these cases the number of children is used as key automatically
or is into
safe and i'm barking up the wrong tree?
Should be safe
Btw. https://github.com/reagent-project/reagent/issues/259 this bug is now part of stable release, please add thumbs up if you agree this is very important
In my opinion this is critical as it prevents building more complicated components using input or textarea elements
(0.6.0 was just released 10 minutes ago)
@eyelidlessness if your list of children is long and changes much into
might be bad for performance, but should otherwise be fine - if you need keys you could maybe use a multimethod to extract a key value from the child data (so the knowledge of how to extract the key from different child types resides with the child type) ?
@mccraigmccraig that's interesting. though i imagine a multimethod for that could be pretty complex
@eyelidlessness depends on the shape of your data i guess - in my app i don't even need a multimethod since data generally has :id
keys
the issue is where the children may be arbitrary.
example, i have a form component that takes fields which may be nested in paragraphs, labels, and so on
anyway i realized that the bug i ran into wasn't directly related to into
, it was an into
inside a conj
, and it was very easy to fix that particular bug without broadly addressing into
thanks for the help all
btw I’m always wondering if I should repeat the function arguments into the inner one, as advised on https://github.com/Day8/re-frame/wiki/Creating-Reagent-Components .
Just reread and realized I didn’t need the inner function after all. Inners are only accompany preliminary (one-time) setup of the component.