reagent-project / reagent-template

A Leiningen template for projects using Reagent.
MIT License
394 stars 55 forks source link

lein new reagent foo doesn't work #1

Closed borkdude closed 9 years ago

borkdude commented 10 years ago

Borkdude@fina000 /tmp $ lein new reagent foo Failed to resolve version for reagent:lein-template:jar:RELEASE: Could not find metadata reagent:lein-template/maven-metadata.xml in local (/Users/Borkdude/.m2/repository) This could be due to a typo in :dependencies or network issues. If you are behind a proxy, try setting the 'http_proxy' environment variable. Could not find template reagent on the classpath.

borkdude commented 10 years ago

I suppose it's not yet on clojars.

yogthos commented 10 years ago

Oh didn't expect this to be used yet. :) I'm basing this on the chestnut template, so I got the initial code checked in, but don't have it quite working yet. I plan to hold off on pushing this to clojars until there's a reagent release from the org. If you don't mind helping troubleshoot the template though I would appreciate the help with it. :)

borkdude commented 10 years ago

@yogthos I was just going to suggest that Reagent needs something like Chestnut! Awesome!!!

jakecraige commented 10 years ago

Ahh I ran into this as well. Whoops. Maybe mention this in the readme? lol

yogthos commented 10 years ago

@jakecraige ah good call, really didn't expect people to be looking at it so soon :)

jakecraige commented 10 years ago

@yogthos I was going to use https://github.com/gadfly361/reagent-seed but this project seemed simpler for me to start with. I'm so new and don't understand anything yet, lol.

Instructions on how to use this until it's released would also be good :) thanks

yogthos commented 10 years ago

@jakecraige @borkdude forgot to mention, luminus provides a decent reagent setup when you use +cljs flag. It doesn't setup figwheel or austin, but it does have a cljs-build config for dev/prod and a small template app.

borkdude commented 10 years ago

Just FYI, I'm am using my own template modelled more or less after Chesnut for creating Reagent + Liberator projects: https://github.com/borkdude/lein-new-liberagent for now, but I'm following this template with interest :)

yogthos commented 10 years ago

I have somewhat mixed feelings about liberator myself. I'm more inclined to include compojure-api instead.

yogthos commented 10 years ago

template should be building correctly now, I haven't had a chance to test the cljs repl though

jakecraige commented 10 years ago

@yogthos Does figwheel work for you in the current version? Like when you change something does the browser update? I'm having to refresh mine

yogthos commented 10 years ago

I haven't got around to playing with it yet, it should work the same as the chestnut tempalte in theory

jakecraige commented 10 years ago

@yogthos Yeah that's what I was thinking. I'm sitting here comparing them and I don't see much of a difference except that it's not reloading for me :/ I'll keep playing with it I suppose.

Currently my process for running the server is

lein ring server
lein repl
(start-figwheel)

Then I go and I can view it. I make changes and it says it's sending changes in the repl but I have to hard refresh to see them

yogthos commented 10 years ago

that seems like it should work, let me know if you make headway on it

jakecraige commented 10 years ago

@yogthos I wonder if this part has anything to do with it https://github.com/plexus/chestnut/blob/master/src/leiningen/new/chestnut/src/clj/chestnut/server.clj#L21

yogthos commented 10 years ago

lein-ring should be handling reloads

jakecraige commented 10 years ago

@yogthos Looks like the stuff in env/dev/cljs isn't being injected. When I manually add it into the core file it works

yogthos commented 10 years ago

ah so I probably just need to load it in the html template then

yogthos commented 10 years ago

does it work when you add

<script type="text/javascript">goog.require("myapp.dev");</script>

in resources/templates/index.html?

jakecraige commented 10 years ago

Sec I'll try edit: @yogthos It can't find that namespace actually

yogthos commented 10 years ago

hmm, found some typos in the env cljs, but for some reason dev doesn't seem to be loaded for me

yogthos commented 10 years ago

oh nm I see I changed the name for the build config, sec

yogthos commented 10 years ago

ok just pushed an update, looks to be working

jakecraige commented 10 years ago

@yogthos Won't that break for a prod build? Since you're still requiring .dev in the index.html?

yogthos commented 10 years ago

only if the dev flag is set though :)

jakecraige commented 10 years ago

Ahh that's right

jakecraige commented 10 years ago

Sweet, live reload is working now.

Also, for anyone wanting to work with this while it's being developed. This is how you get it running locally.

git clone https://github.com/reagent-project/reagent-template.git
cd reagent-template
lein install
lein new reagent <app-name>
cd <app-name>

You can use ring to run the server. So in one terminal run lein ring server and in the other start up a repl with lein repl. Inside of there you can run (start-figwheel) and (browser-repl) to start those up. Go to http://localhost:3000 and enjoy

yogthos commented 10 years ago

looks like lein ring uberjar won't compile cljs correctly though. The cljs-build seems to be getting invoked since it says Compiling ClojureScript. but doesn't actually produce a js file. :(

yogthos commented 10 years ago

So best I've got right now is to explicitly set the profile for release, which doesn't seem too horrible:

lein with-profile release ring uberjar
Whoops commented 10 years ago

IIRC you need to include :jar true in the cljsbuild configuration for it to actually get included.

yogthos commented 10 years ago

ah yes looks like that did the trick! :)

also looks like the reagent group is taken on Cojars, so might have to rename the template to something, maybe reagent-site or does anybody have better suggestions?

jakecraige commented 10 years ago

@yogthos What about just reagent-project like the org name?

yogthos commented 10 years ago

hmm apparently that already exists on Clojars https://clojars.org/reagent-project/lein-template so we might need a new group id...

Whoops commented 10 years ago

I'm pretty sure @holmsand has the reagent group. He should be able to add us to it.

yogthos commented 10 years ago

that would be ideal, worst case we could reach out to the guy who own the reagent-project on Clojars (https://twitter.com/HansJSchmid) see if he might be willing to give it to us. :)

Whoops commented 10 years ago

Yeah he does: https://clojars.org/groups/reagent, so we should probably use that. reagent/lein-template is nicer anyway.

yogthos commented 10 years ago

agreed, less typing too :)

Frozenlock commented 10 years ago

Ran into this issue as well. :-)

Whoops commented 10 years ago

@holmsand any chance we could get @yogthos added to the reagent group on Clojars so he can publish this under reagent/lein-template?

holmsand commented 10 years ago

Sure. Just tell me what I need to do to make that happen.

Whoops commented 10 years ago

@holmsand If you hit https://clojars.org/groups/reagent while logged in, you should see an add member option. Anyone you add there will share control of the group and be able to push new projects. I'm also whoops on Clojars and I'm pretty sure @yogthos is yogthos. I don't know about @seancorfield.

Caveat: I'm pretty sure that gives us full control of the group, so hopefully your comfortable with that. If not we'll have to figure something else out.

holmsand commented 10 years ago

Ok, that was easy. I've added yogthos and whoops to the reagent group.

Whoops commented 10 years ago

Perfect thanks!

yogthos commented 10 years ago

@holmsand @Whoops fantastic thanks, we should probably push out the current reagent from the org and then I'll update the template and reagent-forms to reference the current project.

seancorfield commented 10 years ago

Surprisingly, I’m seancorfield :)

On Oct 28, 2014, at 9:02 AM, Walton Hoops notifications@github.com wrote: I don't know about @seancorfield https://github.com/seancorfield.

holmsand commented 10 years ago

@seancorfield You don't say... Welcome to the reagent group on clojars, then.

seancorfield commented 10 years ago

:+1:

Frozenlock commented 9 years ago

Well then... I guess this issue can be closed.

whatacold commented 3 years ago

Hi,

I also ran into this today when I was trying to play with reagent, but failed (lein version 2.9.6):

$ lein new reagent-frontend play-reagent-frontent
Failed to resolve version for reagent-frontend:lein-template:jar:RELEASE: Could not find metadata reagent-frontend:lein-template/maven-metadata.xml in local (/home/whatacold/.m2/repository)
Failed to read artifact descriptor for reagent-frontend:lein-template:jar:RELEASE
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
Could not find template reagent-frontend on the classpath.

But lein new reagent foo works, what could be the problem?

yogthos commented 3 years ago

Hi,

I'm not able to reproduce the issue locally. One thing to try might be to clear out ~/.m2/repository/reagent-frontend/lein-template folder to see if there's a cached template causing an issue.