Giter VIP home page Giter VIP logo

Comments (11)

martinklepsch avatar martinklepsch commented on May 27, 2024

@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.

laforge49 avatar laforge49 commented on May 27, 2024

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.

alandipert avatar alandipert commented on May 27, 2024

@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.

tiye avatar tiye commented on May 27, 2024

@alandipert sounds good. Have you used that with boot-reload yet, does it work well?

from boot-reload.

tiye avatar tiye commented on May 27, 2024

@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.

laforge49 avatar laforge49 commented on May 27, 2024

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.

laforge49 avatar laforge49 commented on May 27, 2024

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. :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.

tiye avatar tiye commented on May 27, 2024

@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.

laforge49 avatar laforge49 commented on May 27, 2024

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.

martinklepsch avatar martinklepsch commented on May 27, 2024

@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.

tiye avatar tiye commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.