This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-08
Channels
- # asami (7)
- # aws (2)
- # babashka (21)
- # beginners (602)
- # calva (8)
- # cider (11)
- # clj-kondo (10)
- # cljfx (1)
- # clojure (177)
- # clojure-europe (43)
- # clojure-nl (3)
- # clojure-taiwan (2)
- # clojure-uk (45)
- # clojurescript (31)
- # depstar (8)
- # figwheel-main (2)
- # fulcro (12)
- # hugsql (2)
- # java (1)
- # jobs (2)
- # meander (1)
- # missionary (1)
- # off-topic (67)
- # other-languages (1)
- # pathom (212)
- # polylith (4)
- # rdf (1)
- # re-frame (10)
- # reagent (12)
- # reitit (28)
- # reveal (3)
- # shadow-cljs (21)
- # spacemacs (7)
- # sql (5)
- # tools-deps (12)
- # vim (1)
I’m trying to run a test in clojurescript, but the test isn’t running. I’ve this in the file:
(ns humboi.core
(:require [humboi.core :as sut]
["@testing-library/react-native" :refer [render fireEvent]]
[humboi.auth.core :refer [google-sign-in-comp]]
[cljs.test :as t :include-macros true]))
(defn mount! [component]
(render (r/as-element component)
#js {:container (testing-container)}))
(deftest google-login-test
(is (mount! [google-sign-in-comp])))
(cljs.test/run-tests)
After which I’m loading the cider buffer. But the test isn’t running. How to fix this?Are protocols only implemented at the js prototype level or is there something else going on? Just trying to better understand the performance of a protocol function call vs a "regular" function call
it might be helpful to explore it in http://app.klipse.tech/
it looks like (and this also matches my memory) calling a protocol method foo
does the following:
• looks up the method on the prototype and if found, executes that
• checks a global registry and if an implementation is found, executes that (this is useful for things like object
and nil
)
there's a third thing that it might do if you allow your protocol to be extended via metadata, which is look it up on the object's metadata and if found, executes the function found there
I created a new re-frame project use lein new re-frame my-app-name
. I'm using emacs so I'm able to start a shadow repl using :cider-jack-in-cljs
. However it blows up after I provider the app name to build.
Error: Execution error (ExceptionInfo) at shadow.cljs.devtools.server.runtime/get-instance! (runtime.clj:11) . missing instance
oh that template uses the awkward lein-shadow
plugin. if you run lein shadow compile
it will output the correct shadow-cljs.edn file and run npm install and such. After that, you can delete all the lein-shadow stuff and the nested shadow-cljs.edn inside of the project.clj and it will be a normal shadow project
that plugin is an attempt to keep everything inside of the project.clj file. the result is all your dependencies in one file and tooling and documentation no longer match up with the setup so to me its a poor tradeoff
I am using figwheel-main reagent template and having a lot of issues with my django backend. In my figwheel-main.edn i am specifying a target-dir which a relative path to the static folder of my django project. This creates the dev-main.js in the correct spot however the issue is dev-main.js is trying to load dependencies using the same target-dir + some stuff which simply will not do. Is there any way to change this?
I don’t use django, but use relative paths as well and am not experiencing this. I wonder if there’s some other piece to configure here to make sure those dependencies within your compiled script are resolved differently
@UGMAVSMUM if i look at my dev-mains.js its this:
window.CLOSURE_UNCOMPILED_DEFINES = {"figwheel.repl.connect_url":"ws:\/\/localhost:9500\/figwheel-connect?fwprocess=146268&fwbuild=dev"};
window.CLOSURE_NO_DEPS = true;
if(typeof goog == "undefined") document.write('<script src="/cljs-out/dev/goog/base.js"></script>');
document.write('<script src="/cljs-out/dev/goog/deps.js"></script>');
document.write('<script src="/cljs-out/dev/cljs_deps.js"></script>');
document.write('<script>if (typeof goog == "undefined") console.warn("ClojureScript could not load :main, did you forget to specify :asset-path?");</script>');
document.write('<script>goog.require("figwheel.core");</script>');
document.write('<script>goog.require("figwheel.main");</script>');
document.write('<script>goog.require("figwheel.repl.preload");</script>');
document.write('<script>goog.require("devtools.preload");</script>');
document.write('<script>goog.require("figwheel.main.system_exit");</script>');
document.write('<script>goog.require("figwheel.main.css_reload");</script>');
document.write('<script>goog.require("process.env");</script>');
document.write('<script>goog.require("livematch.core");</script>');
the script src here is literally just target-dir appended with some stuff. At this point i dont even care if i can get relative paths working i just want to be able to have this generate correct/different paths.
I am using the default project produced by lein new figwheel-main app -- --reagent
btwhang on i will try with the +npm-bundle option
meh, idk what to do
how do i just compose like a single js file i can throw into my static files
how are you using relative paths btw?
https://figwheel.org/docs/compile_config.html it doesnt even say where these options go
Looks can be deceiving. :) Library and tool authors and maintainers often pay much closer attention to their own channels than to this general one.
i dont even care about figwheel since i would be fine just producing a single js file for use
i dont understand why this has to be such a horrible confusing process