如何在草书中为Clojurescript设置配置? [英] How to set up the configuration in Cursive for Clojurescript?

查看:92
本文介绍了如何在草书中为Clojurescript设置配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是如何启动一个新项目?如何编译,测试和运行?

由于草书用户指南没有提及cljs.

解决方案

从命令行使用boot或leiningen(也称为lein)来设置您的项目,然后在IntelliJ中进入目录的File->Open应用程序并编辑将为您收集在项目中的源文件.要查看的一个重要文件是project.clj-这是lein的项目文件,IntelliJ会选择该文件.

尝试Figwheel 中从头开始建立lein cljs项目进行了说明. rel ="nofollow noreferrer">此处.

最适合使用Chrome浏览器.使用Figwheel保存正在编辑的源文件时,您已打开的浏览器窗口(或可能在浏览器开发人员的控制台中-可以打开它)中显示了可见的更改.

因此,您可以仅使用IntelliJ作为编辑器.在后台,Figwheel将看到您所做的更改,如果有错误,它将显示在浏览器的抬头"显示(即浏览器窗口)中,或者显示在您打开的控制台REPL中.在REPL中,您可以执行诸如显示在浏览器中的警报之类的操作.所有这些都在Figwheel页面上进行了说明...

有很多活动部件(总共四个-两个控制台,一个编辑器和浏览器Window).需要注意的一件有趣的事是,您的FigWheel REPL控制台(您的"dos box")将告诉您打开浏览器的位置,最有可能在http://localhost:3449/.

修改
这是执行Figwheel cljs项目的替代方式设置.比"Try Figwheel"的描述更新,也更手动".完成后,如果不需要,请删除Om-Next依赖项.

修改
想要分享的是,Cursive本身现在很有可能具有REPL,因此可以确认有一种比"dos box"更好的方法.请参见此处中的 运行 ./p>

修改
栗子初学者友好的Web应用程序Leiningen模板"已经与当前的 最先进的技术.

编辑(26/04/2017)
从头开始使用Clojurescript

Just how to init a new project? How to compile, test and run?

Since the cursive user guide says nothing about cljs.

解决方案

From the command line use boot or leiningen (also known as lein) to set up your project, then from within IntelliJ go File->Open on the directory for your application and edit the source files that will be collected up in a project for you. An important file to look at is project.clj - that's lein's project file, that IntelliJ will have picked up.

Setting up a lein cljs project from scratch is explained at Try Figwheel in here.

Best to use the Chrome browser. With Figwheel as you save the source files you are editing, your viewable changes show up in the browser window (or perhaps in the browser developer's console - good to have that open) you have open.

So you can just use IntelliJ as an editor. In the background Figwheel will see the changes you have made and if there's an error it will either show up in the 'heads up' display of the browser (i.e. the browser window), or in the console REPL which you have open. From the REPL you can do things like alerts that show up in the browser. All this explained on the Figwheel page...

There's quite a few moving parts (four altogether - two consoles, an editor and the browser Window). An interesting thing to note is that your FigWheel REPL console (your 'dos box') will be telling you where to open the browser, most likely at http://localhost:3449/.

Edit
Here's an alternative way of doing the Figwheel cljs project setup. More recent, and a bit more 'manual' than the 'Try Figwheel' description. Once finished just remove the Om-Next dependency if you don't want it.

Edit
Wanted to share that it is now quite possible to have a REPL in Cursive itself, so can confirm there is a better way than the 'dos box'. See Running it in here

Edit
Chestnut "beginner friendly Leiningen template for web applications" has just been made up-to-date with the current state of the art.

Edit (26/04/2017)
Starting from scratch with Clojurescript

这篇关于如何在草书中为Clojurescript设置配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆