Skip to content
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

Natal only reloads core namespace #46

Open
scttnlsn opened this issue Dec 4, 2015 · 9 comments
Open

Natal only reloads core namespace #46

scttnlsn opened this issue Dec 4, 2015 · 9 comments

Comments

@scttnlsn
Copy link

scttnlsn commented Dec 4, 2015

Is this by design? Ideally I'd like to be able to make a change in any namespace and have it hot reloaded in my simulator. Is that possible?

@mfikes
Copy link
Collaborator

mfikes commented Dec 4, 2015

FWIW, it is modeled after this blog post which exhibits that limitation. http://blog.fikesfarm.com/posts/2015-05-30-poor-mans-figwheel-for-ambly.html

@scttnlsn
Copy link
Author

scttnlsn commented Dec 4, 2015

OK, thanks.

At this point I'm not sure about the best approach for developing a multi-namespace app w/ Natal + Ambly. Since Cmd-R reloads the JavaScript it seems my only option at the moment is to re-launch the app on every change (which is far too slow to be effective). I'll need to explore Ambly further to better understand what's possible in terms of reloading. Any advice/pointers you have would be great.

@mfikes
Copy link
Collaborator

mfikes commented Dec 4, 2015

You can always use the REPL and issue a (require 'foo.core :reload) to reload a namespace. That will cause Om and React to re-render.

@mfikes
Copy link
Collaborator

mfikes commented Dec 4, 2015

Interestingly, I tried a simple experiment where the main namespace simply delegates to another namespace to get, say, a UI string to put in the button in the sample app that gets automatically generated. If I then do (require 'future-app.core :reload-all) (the main namespace), it doesn't seem to reload my additional namespace. (I have to manually require it first.) I'm wondering if this :reload-all behavior is an Ambly issue, or a ClojureScript issue, or a misunderstanding on my part.

@scttnlsn
Copy link
Author

scttnlsn commented Dec 4, 2015

@mfikes Yeah, I'm experiencing the same issue.

I'm also having trouble getting the Ambly REPL working through Emacs. Works great in a terminal but I have to manually evaluate (require 'future-app.core :reload-all). I'd love to be able to reload the namespace via Emacs key bindings.

After running cider-jack-in I evaluate:

(require
  '[cljs.repl :as repl]
  '[ambly.core :as ambly])

(repl/repl (ambly/repl-env))

Which successfully starts the CLJS REPL. Trying to evaluate any expressions after that just hangs.

@mfikes
Copy link
Collaborator

mfikes commented Dec 4, 2015

See the :choose-first-discovered true stuff in https://github.com/omcljs/ambly/wiki/REPL-in-Cursive. I think it applies to your Emacs case. If that doesn't work, perhaps Piggyback is also needed as described there.

@mfikes
Copy link
Collaborator

mfikes commented Dec 4, 2015

@scttnlsn For :reload-all, I spun off mfikes/ambly#113

@scttnlsn
Copy link
Author

scttnlsn commented Dec 4, 2015

@mfikes Thanks, working well in Emacs using Piggieback. Still need to reload both the changed namespace and core before I see the changes loaded in the app. I'll follow along in mfikes/ambly#113

@jobez
Copy link

jobez commented Dec 7, 2015

doesnt address the core namespace issue, but heres the setup i have to trigger a reload on save from an cider piggiebacked repl

https://gist.github.com/jobez/2f72588240b0df754452

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants