如何自动重新加载Clojure代码? [英] How to automatically reload Clojure code?
本文介绍了如何自动重新加载Clojure代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何自动重新加载 Clojure
代码?
How to automatically reload Clojure
code?
我看过演示。在那里,他们使用一些热插拔Clojure技术,每当更改为源文件时重新加载代码。我可以运行代码,但是我看不到自动重新加载的效果。如何重新加载代码?
I have watched the presentation. And in there they use some hot swap Clojure technology that reloads code whenever changes are made into source files. I can run the code, but I can not observe the effect of auto reload. How is it possible to reload the code?
推荐答案
根据情况,有很多方法来重新加载代码:
There are many ways to reload code, depending on the situation:
- Emacs / CIDER 重新加载文件的快捷方式。可能Rich正在做类似的事情。另请参阅:如何重新加载REPL中的clojure文件
- 查看文件和重新加载代码( figwheel 进行前端开发,测试插件以及专门用于运行测试的CIDER快捷方式,引导有一个
手表
任务...) - 一个中间件对于您使用的Web服务器( ring 具有
ring.middleware.reload / wrap-reload for this
,底座附带一个以及,其他网络服务器如yada
与组件一起玩得很好) - 组件工作流程也可以,例如的自动重新加载系统,其中包含圣杯
- Emacs/CIDER shortcuts to reload a file. Probably Rich is doing something similar. Also see this: How to reload a clojure file in REPL
- watch files and reload the code (figwheel for frontend development does that, test plugins as well as CIDER shortcuts specifically for running tests, boot has a
watch
task...) - a middleware for the web server you use (ring has
ring.middleware.reload/wrap-reload for this
, pedestal comes with one as well, other webservers likeyada
play well with component) - a component workflow works also, there is an example of an auto-reloadable system with holy-grail
这篇关于如何自动重新加载Clojure代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文