Comments (11)
@jiyinyiyong you can make a cirru
task that compiles your files to .cljs
and those will be picked up by the cljs
task and later in the pipeline by the reload task. Definitely sounds doable. I suggest asking in the Slack channel if you're looking for further advice on how to implement this.
from boot-reload.
Martin is right. All you need to do is write a task to do your compile.
When you compose your external task, the order of your sub-tasks will be
something like serve, watch, speak, reload, custom, cljs. (I'm assuming
boot-jetty here. For boot-http, I think serve goes at the end.)
On Thu, Mar 24, 2016 at 1:04 PM, Martin Klepsch [email protected]
wrote:
@jiyinyiyong https://github.com/jiyinyiyong you can make a cirru task
that compiles your files to .cljs and those will be picked up by the cljs
task and later in the pipeline by the reload task. Definitely sounds
doable. I suggest asking in the Slack channel if you're looking for further
advice on how to implement this.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#66 (comment)
from boot-reload.
@jiyinyiyong compiling to ClojureScript is awesome! Boot was originally motivated to make exactly this easy. https://github.com/hoplon/boot-hoplon might be a useful reference. It's the task for http://hoplon.io that compiles .cljs.hl
into .cljs
files and is compatible with all other boot-cljs tooling.
from boot-reload.
@alandipert sounds good. Have you used that with boot-reload yet, does it work well?
from boot-reload.
@martinklepsch I will ask in Slack next morning. Actually these lines of code made me worried. I tried to look into fileset
emitted from watch, and it seemed to be a full list of files, and in boot-reload it compares all the files in order to find changes, which means I have to compile all my files. That is unlike incremental compiling:
https://github.com/adzerk-oss/boot-reload/blob/master/src/adzerk/boot_reload.clj#L18-L24
(defn- changed [before after static-files]
(when before
(->> (fileset-diff before after :hash)
output-files
(sort-by :dependency-order)
(map tmp-path)
(remove static-files))))
I'll try to dig deeper...
from boot-reload.
I believe this is the cost of easy composition. All the sub-steps are fully
decoupled. Efficiency in the form of incremental compilation goes out the
window. Your cljs converter shouldn't even need to know that it is being
invoked multiple times.
It is the KISS approach that can accomplish a great deal in a
straight-forward way. Without much in the way of preconceptions about what
needs to be done, which is what you often need but rarely get from a build
tool. And while it may seem inefficient, remember that the most valuable
resource is qualified developers and that such an approach lends itself to
use within a cluster. :D
Iron being really cheap these days.
On Thu, Mar 24, 2016 at 3:27 PM, 题叶 [email protected] wrote:
@martinklepsch https://github.com/martinklepsch I will ask in Slack
next morning. Actually these lines of code made me worried. I tried to look
into fileset emitted from watch, and it seemed to be a full list of
files, and in boot-reload it compares all the files in order to find
changes, which means I have to compile all my files. That is unlike
incremental compiling:https://github.com/adzerk-oss/boot-reload/blob/master/src/adzerk/boot_reload.clj#L18-L24
(defn- changed [before after static-files](when before
%28->> %28fileset-diff before after :hash%29
output-files
%28sort-by :dependency-order%29
%28map tmp-path%29
%28remove static-files%29%29))I'll try to dig deeper...
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#66 (comment)
from boot-reload.
In my estimation, boot is pure genius. You just need to think cloud.
On Thu, Mar 24, 2016 at 6:32 PM, William la Forge [email protected]
wrote:
I believe this is the cost of easy composition. All the sub-steps are
fully decoupled. Efficiency in the form of incremental compilation goes out
the window. Your cljs converter shouldn't even need to know that it is
being invoked multiple times.It is the KISS approach that can accomplish a great deal in a
straight-forward way. Without much in the way of preconceptions about what
needs to be done, which is what you often need but rarely get from a build
tool. And while it may seem inefficient, remember that the most valuable
resource is qualified developers and that such an approach lends itself to
use within a cluster. :DIron being really cheap these days.
On Thu, Mar 24, 2016 at 3:27 PM, 题叶 [email protected] wrote:
@martinklepsch https://github.com/martinklepsch I will ask in Slack
next morning. Actually these lines of code made me worried. I tried to look
into fileset emitted from watch, and it seemed to be a full list of
files, and in boot-reload it compares all the files in order to find
changes, which means I have to compile all my files. That is unlike
incremental compiling:https://github.com/adzerk-oss/boot-reload/blob/master/src/adzerk/boot_reload.clj#L18-L24
(defn- changed [before after static-files](when before
%28->> %28fileset-diff before after :hash%29
output-files
%28sort-by :dependency-order%29
%28map tmp-path%29
%28remove static-files%29%29))I'll try to dig deeper...
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#66 (comment)
from boot-reload.
@laforge49 I came from JavaScript community and Webpack already did a very good job on such cases. I mean files are compiled incrementally in develop mode. I believe there's a solution for Clojure too, but with the help of boot-reload supporting it.
from boot-reload.
I find myself repeatedly in awe of the clojure community at large.
On Thu, Mar 24, 2016 at 10:16 PM, 题叶 [email protected] wrote:
@laforge49 https://github.com/laforge49 I came from JavaScript
community and Webpack already did a very good job on such cases. I mean
files are compiled incrementally in develop mode. I believe there's a
solution for Clojure too, but with the help of boot-reload supporting it.—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#66 (comment)
from boot-reload.
@jiyinyiyong boot-cljs
handles incremental compilation of cljs sources. And similarly you can implement your cirru
compiler to do some sort of incremental compilation. boot-reload
solely provides a mechanism to reload files in a browser, it has nothing to do with compilation, you can use it for CLJS and CSS and other types of files
from boot-reload.
Thanks. I finished the plugin days back. Closing.
(deftask dev []
(set-env!
:source-paths #{"cirru/src"})
(comp
(html-file :data {:build? false})
(watch)
(transform-cirru)
(reload :on-jsload 'boot-workflow.core/on-jsload)
(cljs)
(target)))
https://github.com/mvc-works/boot-workflow/blob/master/build.boot#L82
from boot-reload.
Related Issues (20)
- Warn if :asset-path is specified but does not start with /
- ERROR: Invalid token: ws://localhost:40781 (possible regression) HOT 1
- Reload files where resource path doesn't match web url path HOT 3
- Some confusion on `defrecord` on reloading HOT 1
- Reloading behaviour changes on migration to 2.7 HOT 3
- Web-worker support HOT 1
- 0.5.0 todo HOT 2
- Use of reserved Javascript keyword in adzerk.boot-reload HOT 2
- Not harmful exception at shutdown HOT 4
- Try to optimize page load time with Boot-reload
- Assert on-jsload option from .cljs.edn is a symbol HOT 1
- Closure Library deleted goog.net.jsloader.loadMany HOT 1
- document.write warnings HOT 1
- Reloads before boot-cljs has written resource HOT 27
- Closure library deleted goog.net.jsloader.load HOT 8
- java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter (Clojure 1.9 on openjdk 10.0.1 2018-04-17) HOT 5
- Update http-kit for Java 9+ support
- Reload websocket is related to assets? HOT 8
- Cljs-asset-path should end up in js file? HOT 2
- Rename :asset-path HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boot-reload.