-
Notifications
You must be signed in to change notification settings - Fork 3
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
Multimethods #4
base: master
Are you sure you want to change the base?
Multimethods #4
Conversation
This trival change is to support holding on to the original krei file for passing to build components, so debugging information has access to the krei-file resource URL.
This is a backward compatible change that retains the existing functionality while preparing the way for new 'providers' of build functionality, such as shadow-cljs and JIT image resizing.
I forgot to mention that the result of the |
This was an oversight.
This is a new design whereby the build configuration is passed to krei/kick, for example, from an Aero configuration. ```clojure {:default {} :dev {:kick/builder {:kick.builder/target "target" :kick/sass {:sources ["public/app.scss"]} :kick/figwheel {:builds [{:id "main" :figwheel {:on-jsload "edge.main/init"} :compiler {:main edge.main :output-to "public/edge.js" :output-dir "public/edge.out" :asset-path "/public/edge.out"}}]}}}} ``` The watch and returning close function correspond directly to `integrant.core/init-key` and `integrant.core/halt-key!`, although there is no integrant dependency from krei/kick IMPORTANT: Since krei can _no longer build independently_ the production build (called by main) has been removed entirely and consuming projects now need to provide this functionality.
OK, this is now ready to review. There is more context and design rationale in the individual commit messages. I've gone for a BYOD (bring your own dependency) policy for the individual providers, and none are therefore privileged. I'm planning to add shadow-cljs in due course. The point of this BYOD policy is to avoid dependency bloat (avoid paying for the cost of dependencies you don't use). One strange thing is that Edge seems to 'work' (build the sass) without seeming to bring in deraen/sass4clj {:mvn/version "0.3.1"} (not sure what's going on there, but it doesn't affect this review). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor things. Overall looks good.
I don't see a way to perform a one-time build of clojurescript with this system, that would be a big gap.
src/io/dominic/krei/alpha/core.clj
Outdated
[io.dominic.krei.alpha.impl.debounce :as krei.debounce])) | ||
[clojure.java.classpath :as classpath] | ||
[clojure.string :as string] | ||
[clojure.tools.logging :as log] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tools.logging isn't a dependency of the project. So this commit only compiles by coincidence.
src/io/dominic/krei/alpha/core.clj
Outdated
(map #(update-in % [:compiler :output-to] (comp str target-relative)))) | ||
krei-files)})) | ||
(build-sass) | ||
;; @dmc what's this? still something we need? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which this? :p Presuming you mean (run! dirwatch/close-watcher krei-builders)
it takes care of shutting down the file watchers.
``` ---- Exception ---- No implementation of method: :-find-sources of protocol: #'cljs.closure/Compilable found for class: cljs.build.api$inputs$reify__6688 ---- Exception Stack Trace ---- java.lang.IllegalArgumentException: No implementation of method: :-find-sources of protocol: #'cljs.closure/Compilable found for class: cljs.build.api$inputs$reify__6688 at clojure.core$_cache_protocol_fn.invokeStatic (core_deftype.clj:583) clojure.core$_cache_protocol_fn.invoke (core_deftype.clj:575) cljs.closure$eval45293$fn__45307$G__45284__45314.invoke (cljs_closure.clj:475) cljs.closure$build.invokeStatic (cljs_closure.clj:2707) cljs.closure$build.invoke (cljs_closure.clj:2672) cljs.build.api$build.invokeStatic (api.clj:208) cljs.build.api$build.invoke (api.clj:189) figwheel_sidecar.components.cljs_autobuild$cljs_build.invokeStatic (cljs_autobuild.clj:28) ```
@@ -0,0 +1,36 @@ | |||
;; Suggested dependencies: | |||
;; thheller/shadow-cljs {:mvn/version "2.0.123"} | |||
;; As there's a bug in tools.deps.alpha (TDEPS-26), also add: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TDEPS-26 is fixed https://dev.clojure.org/jira/browse/TDEPS-26
This calls for configurability.
This is to ensure that unpacked production instances will build their own CSS prior to starting.
e71d0d6
to
b720686
Compare
b720686
to
158695f
Compare
Syntax has changed - see Edge
This makes developing with figwheel possible without loading kick in the context of a project.
This is a convention set by Asciidoctor.
This BINARY INCOMPATIBLE change is to allow finer control of the target filename. This is required by Edge to place generated CSS files into a directory named 'public'. Given the fast-moving alpha status of Kick, with the ease of fixing its (few) current dependants, simplicity has been chosen over binary compatibility.
This prevents a bug which happens as a combination of: - Kick being a git dependency - Kick allowing users to bring their own dependencies - tools.namespace loading all namespaces which are in directories This guard prevents the namespace from exploding when required without the required dependency present. This is not completely ideal, due to the confusion it will push down onto users when namespaces unexpectedly don't work.
This causes a compilation error when starting a clojurescript REPL, as figwheel-main attempts to compile the code in watch-dirs then.
You need the :output-dir to be produced when source maps are enabled.
clj no longer produces a clojure.libfile, and kick needs this to remove itself from the classpath when using figwheel-main. Newer versions of clj instead provide a clojure.basis, which is vaguely the same as the old basis. Supports both in order to handle the transition period of updates.
Update to clojure.basis
Tested against the JUXT website.