简体   繁体   English

在Emacs中的Cider中,是否可以重新启动Figwheel以检测新的依赖关系?

[英]From Cider, in Emacs, is there a way to restart Figwheel to detect new dependencies?

I added a new dependency to my Clojurescript app, and I want to know if I can run a function, maybe something like (restart-figwheel) to restart Figwheel. 我在Clojurescript应用程序中添加了新的依赖项,我想知道我是否可以运行一个函数,也许可以使用诸如(restart-figwheel)来重启Figwheel。 I read you have to restart Figwheel to detect new dependencies. 我读到您必须重新启动Figwheel才能检测到新的依赖项。

At this time, I don't think you can do this. 目前,我认为您无法执行此操作。 You need to quit your current figwheel session and restart in order to pick up new dependencies added to your :dependencies in your project.clj file. 您需要退出当前的figwheel会话并重新启动,以便在project.clj文件中获取添加到:dependencies的新依赖项。 In fact, the figwheel docs also recommend running lein clean before you restart figwheel to be sure you don't end up with some old code. 实际上,figwheel文档还建议您在重新启动figwheel之前先运行lein clean,以确保不会以一些旧代码结尾。

I think this functionality is on the roadmap, but is not a high priority. 我认为此功能已在路线图上,但并不是很重要。 There is considerable complexity in being able to have this functionality work reliably - especially if you add in the complexity of different repl environments (such as using piggyback, and cider with figwheel). 要使此功能可靠地工作,会存在相当大的复杂性-尤其是当您增加了不同的repl环境的复杂性时(例如,使用背fig式移动设备以及带figwheel的苹果酒)。

Note that this limitaiton is just with :dependency items in the project.clj. 请注意,此限制仅与project.clj中的:dependency项目有关。 You can add :require lines in your cljs files dynamically and have them picked up (asusming the library is already in the dependencies list of course). 您可以在cljs文件中动态添加:require行,并选择它们(假设该库已经在依赖列表中了)。

I suspect part of the compicaiton is ensuring the classpath is updated and that all processes already running which use the classpath are somehow updated and making sure all loaded classes are reloaded in case the dependency changes the dependencies of those loaded classes to keep things consistent. 我怀疑这种复杂性的一部分是确保类路径已更新,并且已使用该类路径的所有正在运行的进程都以某种方式进行了更新,并确保所有加载的类都已重新加载,以防依赖关系更改了这些加载的类的依赖关系以保持一致。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM