Skip to content

Commit

Permalink
module depends-on added
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed Apr 11, 2024
1 parent 1410451 commit dc7dce5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions demo-webly/resources/ext/hello.edn
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{:name "hello"
:lazy true
:depends-on #{:snippets}
:cljs-namespace [snippets.hello
snippets.bye]
}
12 changes: 9 additions & 3 deletions webly/src/webly/module/build.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns webly.module.build
(:require
[clojure.string :as str]
[clojure.set]
[taoensso.timbre :as timbre :refer [debug info warn error]]
[extension :refer [get-extensions write-service]]))

Expand Down Expand Up @@ -124,7 +125,9 @@
(let [modules (get-extensions exts {:name "unknown"
:lazy false
:cljs-namespace []
:cljs-ns-bindings {}})
:cljs-ns-bindings {}
:depends-on #{}
})
valid-modules (filter module? modules)
lazy-modules (filter lazy-module? valid-modules)
main-modules (remove lazy-module? valid-modules)]
Expand All @@ -142,9 +145,12 @@
(into []))]
[:webly {:entries entries}]))

(defn- lazy-shadow-module [{:keys [name cljs-namespace]}]
(defn- lazy-shadow-module [{:keys [name cljs-namespace depends-on]}]
(let [depends-on (clojure.set/union #{:webly} depends-on)]
(println "module: " name " depends-on: " depends-on)
[(keyword name) {:entries (vec cljs-namespace)
:depends-on #{:webly}}])
:depends-on depends-on}]
))

(defn shadow-module-config
"input: the state created by create-modules
Expand Down

0 comments on commit dc7dce5

Please sign in to comment.