Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple reloads in a pipeline; helps #41 #70

Merged
merged 1 commit into from
Jun 13, 2016

Conversation

samroberton
Copy link
Contributor

This commit does two things:

  1. Use a gensym'd name for the (former) adzerk.boot_reload ns, so that
    different reload tasks in a single pipeline can operate independently
    without collisions.
  2. Introduce an optional :only-by-re option, and when it's set, only
    send reloads of files in the fileset which match the given patterns.
    This presents a solution to the problem in Reload only a build's dependencies #41, in that reloads can be
    limited to the artefacts from a single build's compilation artefacts,
    avoiding the need for the reload task to do dependency tracking.

For example:

(deftask dev []
  (comp (watch)
        (reload :ids #{"react-www"}
                :only-by-re [#"^react-www\.out/.*"]
                :on-jsload 'my.react-www.app/reload)
        (reload :ids #{"react-native"}
                :only-by-re [#"^react-native\.out/.*"]
                :on-jsload 'my.react-native.app/reload)
        (cljs :ids #{"react-www" "react-native"}
              :optimizations :none)))

@ejlo
Copy link

ejlo commented May 30, 2016

This looks really useful!

Any plans to get it merged?

@samroberton
Copy link
Contributor Author

To the extent that it might be useful to anyone even without having been merged, you can use the following dependency to test it out: [org.clojars.samroberton/boot-reload "0.4.7-SNAPSHOT"].

@Deraen
Copy link
Contributor

Deraen commented Jun 1, 2016

Hmm, I guess we could merge this. I have other plans to eventually fix #41 without need for users to set any options etc. But I guess we can add the option for now and remove it when I finally have time to look into refactoring the implementation.

@Deraen
Copy link
Contributor

Deraen commented Jun 1, 2016

@samroberton Could you rebase this against the latest commit?

This commit does two things:

1. Use a gensym'd name for the (former) `adzerk.boot_reload` ns, so that
different `reload` tasks in a single pipeline can operate independently
without collisions.

2. Introduce an optional `:only-by-re` option, and when it's set, only
send reloads of files in the fileset which match the given patterns.
This presents a solution to the problem in adzerk-oss#41, in that reloads can be
limited to the artefacts from a single build's compilation artefacts,
avoiding the need for the `reload` task to do dependency tracking.

For example:

    (deftask dev []
      (comp (watch)
            (reload :ids #{"react-www"}
                    :only-by-re [#"^react-www\.out/.*"]
                    :on-jsload 'my.react-www.app/reload)
            (reload :ids #{"react-native"}
                    :only-by-re [#"^react-native\.out/.*"]
                    :on-jsload 'my.react-native.app/reload)
            (cljs :ids #{"react-www" "react-native"}
                  :optimizations :none)))
@samroberton
Copy link
Contributor Author

No problems: I've just pushed a rebased commit (which I've also put up on Clojars as [org.clojars.samroberton/boot-reload "0.4.9-SNAPSHOT"], in case that happens to be useful to anyone other than myself).

@Deraen Deraen merged commit bb26bda into adzerk-oss:master Jun 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants