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

Reload only a build's dependencies #41

Open
pandeiro opened this issue Oct 9, 2015 · 0 comments
Open

Reload only a build's dependencies #41

pandeiro opened this issue Oct 9, 2015 · 0 comments

Comments

@pandeiro
Copy link
Contributor

pandeiro commented Oct 9, 2015

When :ids is specified, reload should only send changed files to the browser that are a part of that build's dependency graph (or are non-JS assets such as CSS, etc). Otherwise compiled namespaces from any other builds will get loaded, resulting in uncaught exceptions:

goog.require could not find: foo.tests @ base.js:619 ...
base.js:662 Uncaught Error: goog.require could not find: foo.tests
samroberton added a commit to samroberton/boot-reload that referenced this issue Apr 3, 2016
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 added a commit to samroberton/boot-reload that referenced this issue Jun 1, 2016
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)))
Deraen added a commit that referenced this issue Jun 13, 2016
Support multiple reloads in a pipeline; helps #41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants