Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Sort JavaScript files in dependency order once, just before advanced …

…compilation
  • Loading branch information...
commit 2e5eee630b353df791c8fb6ced40d99fb9536bb5 1 parent e615f4c
Brenton Ashworth brentonashworth authored

Showing 1 changed file with 14 additions and 14 deletions. Show diff stats Hide diff stats

  1. +14 14 src/clj/cljs/closure.clj
28 src/clj/cljs/closure.clj
@@ -347,12 +347,11 @@
347 347
348 348 (defn compile-dir
349 349 "Recursively compile all cljs files under the given source
350   - directory. Return a list of JavaScriptFiles in dependency order."
  350 + directory. Return a list of JavaScriptFiles."
351 351 [^File src-dir opts]
352 352 (let [out-dir (output-directory opts)]
353   - (dependency-order
354   - (map compiled-file
355   - (comp/compile-root src-dir out-dir)))))
  353 + (map compiled-file
  354 + (comp/compile-root src-dir out-dir))))
356 355
357 356 (defn path-from-jarfile
358 357 "Given the URL of a file within a jar, return the path of the file
@@ -514,8 +513,8 @@
514 513
515 514 (defn js-dependencies
516 515 "Given a sequence of Closure namespace strings, return the list of
517   - all dependencies in dependency order. The returned list includes all
518   - Google and third-party library dependencies.
  516 + all dependencies. The returned list includes all Google and
  517 + third-party library dependencies.
519 518
520 519 Third-party libraries are configured using the :libs option where
521 520 the value is a list of directories containing third-party
@@ -531,7 +530,7 @@
531 530 (recur (into (rest requires) new-req)
532 531 (into visited new-req)
533 532 (conj deps node)))
534   - (cons (get index "goog/base.js") (dependency-order deps))))))
  533 + (remove nil? deps)))))
535 534
536 535 (comment
537 536 ;; find dependencies
@@ -549,11 +548,10 @@
549 548
550 549 (defn cljs-dependencies
551 550 "Given a list of all required namespaces, return a list of
552   - IJavaScripts which are the cljs dependencies in dependency
553   - order. The returned list will not only include the explicitly
554   - required files but any transitive depedencies as well. JavaScript
555   - files will be compiled to the working directory if they do not
556   - already exist.
  551 + IJavaScripts which are the cljs dependencies. The returned list will
  552 + not only include the explicitly required files but any transitive
  553 + depedencies as well. JavaScript files will be compiled to the
  554 + working directory if they do not already exist.
557 555
558 556 Only load dependencies from the classpath."
559 557 [opts requires]
@@ -574,7 +572,7 @@
574 572 (recur (into (rest required-files) new-req)
575 573 (into visited new-req)
576 574 (conj js-deps js)))
577   - (dependency-order js-deps))))))
  575 + (remove nil? js-deps))))))
578 576
579 577 (comment
580 578 ;; only get cljs deps
@@ -863,7 +861,9 @@
863 861 [(-compile (io/resource "cljs/nodejscli.cljs") all-opts)]))
864 862 js-sources (if (coll? compiled)
865 863 (apply add-dependencies all-opts compiled)
866   - (add-dependencies all-opts compiled))]
  864 + (add-dependencies all-opts compiled))
  865 + js-sources (cons (javascript-file nil (io/resource "goog/base.js") ["goog"] nil)
  866 + (dependency-order js-sources))]
867 867 (if (:optimizations all-opts)
868 868 (->> js-sources
869 869 (apply optimize all-opts)

0 comments on commit 2e5eee6

Please sign in to comment.
Something went wrong with that request. Please try again.