This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-20
Channels
- # announcements (10)
- # architecture (7)
- # babashka (49)
- # beginners (125)
- # calva (2)
- # chlorine-clover (33)
- # clj-kondo (15)
- # cljs-dev (18)
- # cljsrn (28)
- # clojure (91)
- # clojure-argentina (37)
- # clojure-austin (4)
- # clojure-dusseldorf (1)
- # clojure-europe (3)
- # clojure-france (2)
- # clojure-germany (2)
- # clojure-nl (4)
- # clojure-portugal (4)
- # clojure-spec (26)
- # clojure-uk (19)
- # clojuredesign-podcast (5)
- # clojurescript (19)
- # conjure (20)
- # core-async (4)
- # cursive (60)
- # data-science (4)
- # datomic (1)
- # duct (9)
- # emacs (11)
- # events (1)
- # fulcro (9)
- # graalvm (17)
- # jobs-discuss (7)
- # luminus (19)
- # malli (36)
- # meander (2)
- # off-topic (23)
- # pathom (2)
- # quil (1)
- # rdf (4)
- # re-frame (16)
- # reitit (10)
- # ring (21)
- # ring-swagger (1)
- # shadow-cljs (137)
- # spacemacs (10)
- # sql (27)
hello, I've a project that I'm getting a lot of debug logs like
19:40:50.929 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider
19:40:51.646 [main] INFO io.undertow - starting server: Undertow - 2.0.30.Final
19:40:51.655 [main] INFO org.xnio - XNIO version 3.8.0.Final
19:40:51.664 [main] INFO org.xnio.nio - XNIO NIO Implementation Version 3.8.0.Final
19:40:51.728 [main] INFO org.jboss.threads - JBoss Threads version 3.1.0.Final
19:40:51.737 [XNIO-1 I/O-2] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-2', selector .KQueueSelectorImpl@5629534f
19:40:51.737 [XNIO-1 I/O-3] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-3', selector .KQueueSelectorImpl@16c6fc08
19:40:51.737 [XNIO-1 I/O-4] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-4', selector .KQueueSelectorImpl@36eb2669
19:40:51.737 [XNIO-1 I/O-6] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-6', selector .KQueueSelectorImpl@e6ef0ab
19:40:51.737 [XNIO-1 I/O-1] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-1', selector .KQueueSelectorImpl@7624cb9a
19:40:51.737 [XNIO-1 I/O-7] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-7', selector .KQueueSelectorImpl@3ccd03ca
19:40:51.737 [XNIO-1 I/O-5] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-5', selector .KQueueSelectorImpl@d9f96cd
19:40:51.738 [XNIO-1 I/O-8] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-8', selector .KQueueSelectorImpl@5b9f145d
is there a way for me to debug why I'm getting the verbose, and how to tune it down?
Q: I like the “hacking libraries” capability. Should this also work for hacking npm dep sources?
@wilkerlucio if you are running the embedded version logging is subject to your logging config. so you configure it and can just disable it if you want.
Good to know. Thanks. I can still do the local clone/patch with my npm deps. that’s working well.
@thheller do you have an example of that config?
nothing, I'm guessing some dependency is doing it
it seems to happen on my deps projects, on lein ones it seems normal
not just on shadow really, I see the same issue in other projects with just deeps
gonna dig down
@wilkerlucio log4j.properties
in one classpath root with
log4j.rootLogger=INFO, console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=[%d{HH:mm:ss,SSS}] %m%n
I have an hybrid project, where I use some JSX files. I’m able to convert them with babel in standard JS and consume them from ClojureScript in a re-frame app.
my problem arises when I try to import a local Js file in another JS file
for example:
import { ProTip } from ‘./ProTip’;
the closure compiler says that it can’t understand import from directories
please post actual code with actual messages. makes it much harder to follow if you shorten things.
yes sorry I’m trying to replicate the problem, now I have other errors that happens before the one I described
I don't really recommend including too many .js
files. the system isn't really tuned for that and has a lot of issues I haven't had time to work on.
Hey everyone! Setting up a new template for projects and shadow keeps alerting me "Stale Client". Not sure why it keeps doing so, even on a page refresh
common cause is changing the output directory or names but not adjusting your html accordingly
checking over my html, everything seems to be in place
output dir is set correctly as well it seems
could also be that you have 2 separate shadow-cljs instances running competing with each other
what if they are running on different ports?
i have two dev instances running on different tmux boxes but on separate ports
okay, that makes sense but that doesn't seem to be whats going on. mind if i throw you a github link?
committing now, one sec. sorry for the delay
in the meantime, @thheller you did an absolutely stellar job with shadow, my guy. CLJS has been an incredible journey and shadow has drastically improved my ux!
did a clean and im running npm install again. i'll go through the whole set up and if it works
okay! that was my initial guess as to why it wasn't giving me a non-stale build
{:source-paths ["src"]
:dependencies [[nrepl "0.7.0"]
[cider/cider-nrepl "0.25.0-alpha1"]
[proto-repl "0.3.1"]
[binaryage/devtools "1.0.0"]
[reagent "0.10.0"]
[re-frame "0.12.0"]
[day8.re-frame/re-frame-10x "0.6.2"]
[bidi "2.1.6"]
[kibu/pushy "0.3.8"]]
:nrepl {:port 3334}
:dev-http {8080 "public"}
:builds
{:app
{:target :browser
:output-dir "public/js"
:asset-path "/js"
:modules
{:main
{:init-fn app.core/init
:preloads [day8.re-frame-10x.preload]}}
:dev
{:compiler-options
{:closure-defines {re-frame.trace/trace-enabled? true
day8.re-frame.tracing/trace-enabled? true}}}}}}
no complaint, and says build completed
i'm sorry i don't understand, i've never had someone else edit my code with git
no I mean I fixed it in shadow-cljs. with the next release {init-fn ...}
will fail properly and show an error
wow. my level of tiredness is showing
@thheller I've gone through every setting I can think of to no avail. It's still giving me a stale client warning
I am going through Jacek Schae's tutorial on re-frame, this is basically his template, just with updated deps. everything is fine running his template, but as soon as i update deps, things get wonky with the stale client warning
@mbbailey96 verify that you are actually loading what you are think you are loading
you get a stale client warning when the .js
you are loading was not produced by the running watch
main.js is supplied by watch afaik, which is being compiled. it is stored in my js/ folder, which is definitely linked in my index.html.
I haven't been getting any build errors, main is compiled and in the right directory, i just don't know what I am missing
when I try to run (js/alert) it's giving me an error "No such namespace: js". Can't interact with the site at all through repl. Might this be a cause or a help determining what is going wrong?
you are looking all over the place if all you need to check if file you think you are loading are the actual files you are looking at
@thheller i was still getting connection from elsewhere.
thank you for all the help!!
I can’t believe that yesterday this import (and others) worked:
(ns dias-web.common-ui (:require [re-frame.core :as re-frame] [dias-web.subs :as subs] [“@material-ui/core/styles/MuiThemeProvider” :default ThemeProvider] [“@material-ui/core/styles” :refer [createMuiTheme withStyles]] [“@material-ui/core/colors” :as mui-colors] [“@material-ui/core/CssBaseline” :default CssBaseline] [“@material-ui/core/Typography” :default Typography] ; [“@material-ui/core/Avatar” :default mui-avatar] ; [“@material-ui/icons/Android” :default AndroidIcon] [“@material-ui/core/AppBar” :default AppBar] [“@material-ui/core/Toolbar” :default ToolBar] [“@material-ui/core/IconButton” :default IconButton] [“@material-ui/icons/Menu” :default MenuIcon] [“@material-ui/core/Button” :default Button]))
and today everything compiles but at runtime it says:
Failed to load dias_web/common_ui.cljs Module not provided: module$node_modules$$material_ui$core$styles$index
It’s very strange, everything the same as yesterday
I would like to ask for some orientation (I am already reading the docs but I have some questions that are more basic than what the docs assumes). Basically, I am not even sure if it's possible, or rather I assume it's possible but I am not sure if I should do what I want to do : ) I would like to have specs added next to my devcards build that would complain during development if I mess up some argument to functions (or let bindings in components) or the output of some functions. Is there some guide regarding this that I could read to get up to speed?
@andrea.russo looks fine as far as I can tell. "Failed to load" sort of creates a chain reaction. One thing fails to load and then a whole bunch of others that depend on that also fail so you gotta fine the actual failing thing
@ashnur clarify "specs added"? shadow-cljs only compiles stuff for you. you are responsible for adding stuff to the build and requiring it. I typically recommend adding specs to extra namespaces. so for (ns app.foo)
you also have (ns app.foo-spec)
and then load that ns via :preloads
or some other means
adding the files and writing in the namespace and the tests is what is the most clear thing in this process
the preloads stuff, I have no idea why it is preload, compared to what, I am guessing there is a lot of history here where these names and approaches are coming from. I only know javascript, if I want something like this, I have to bundle in with the rest of the app
:preloads
is badly named yes but it is what it is. It is for namespaces that should only be added to the build in development.
they are added "before" the other code so they are sometimes loaded before the other code
but they can depend on other code in which they that code will be loaded before them
I hate when I am stupid, I added the file, wrote in the namespaces, specified the file/namespace in the vector of preloads for the build that I am running, if I change the file I can see shadowcljs picking the change up and rebuilding, but a simple (prn 'foo) has no output
@ashnur you are not stupid. you are learning, it is ok to make mistakes. it is ok to ask questions ... that is how we learn.
namespace and filename are really the same thing. there are just a few basic rules for namespaces and which filename they should have
the names go onto the classpath, meaning you pick one of your source-paths and put them there
hey thheller, I am getting a bunch of $jscomp
errors when using dependencies that ship es6+ code, unless I bump :output-feature-set
to match the level required not to compile them
a not-completely-minimal-example is this project: https://github.com/geraldodev/react-form-hook-test
when i boot this up, I see a couple errors about $jscomp.makeIterator
changing the :output-feature-set
to :es6
makes these go away.
then I try and type something in a field, which throws an error about $jscomp
with the stacktrace pointing at an async
function.
bumping the :output-feature-set
to :es8
makes this go away.
@thheller I’ve found that if I delete the .shadow-cljs/ and rebuild everything works. As soon as I stop the build and the start another without deleting the .shadow-cljs directory, I have the module loading problem
I can share with you the repo I’m working on, if you are interested seeing this behaviour
by deleting everytime the .shadow-cljs I’m able to work, which means I’m stuck again with another problem, maybe this one is something related to the closure compiler, which does not accept directory paths in javascript files when importing other files:
losure compilation failed with 1 errors
--- App.js:6
Cannot import Closure files by path. Use either import goog:namespace or goog.require(namespace)
These are imports from the App.js file:
import * as React from ‘react’; import Container from ‘@material-ui/core/Container’; import Typography from ‘@material-ui/core/Typography’; import Box from ‘@material-ui/core/Box’; import Link from ‘@material-ui/core/Link’; import * as ProTip from ‘./ProTip’;
and the problem is importing a local file called ProTip.js
which is in the same directory of App.js
oh sorry, and this is my shadow-cljs.edn
{:lein true :nrepl {:port 8777} :builds {:app {:target :browser :output-dir “resources/public/js/compiled” :asset-path “/js/compiled” :modules {:app {:init-fn dias-web.core/init :preloads [devtools.preload day8.re-frame-10x.preload]}} :dev {:compiler-options {:closure-defines {re-frame.trace.trace-enabled? true day8.re-frame.tracing.trace-enabled? true}}} :devtools {:http-root “resources/public” :http-port 8280 }}}}
oh now I read that you are discouraging having more than a bunch of js files in a shadow-cljs project
sorry
any suggestion on how to coordinate me, using cljs, and my other cooworkers, using js? Maybe a magic live changing local node module in node_modules?
Seeing those sometimes now after a version upgrade I think.
[:dev] Build failure:
------ ERROR -------------------------------------------------------------------
File: /Users/spacegangster/clj/lightpad/client/src/flow/views/tasks/microtasks.cljs:6:1
--------------------------------------------------------------------------------
3 | [space-ui.style.constants :as sc]
4 | [space-ui.style.constants :as sc]))
5 |
6 | (def ^:const dim-item-side-px (sc/px sc/dim-step))
-------^------------------------------------------------------------------------
Error in phase :compilation
Can't redefine a constant at line 6 flow/views/tasks/microtasks.cljs
--------------------------------------------------------------------------------
7 | (def ^:const dim-fs ".9rem")
8 |
9 | (def rules1
10 | [:.microtasks
Version output
=== Version
jar: 2.8.97
cli: 2.8.97
deps: 1.3.2
config-version: 2.8.97
Previously was on: ^2.8.91Will add an issue on demand
@ognivo just don't use ^:const
. it doesn't do what you think it does. do not use it. there is no point. also why is [space-ui.style.constants :as sc]
imported twice? line 3/4?
ok, thanks! I think I saw it somewhere in Mike Fikes twits
@andrea.russo I can't help much with this. I need something reproducible to figure out what is happening. deleting the cache shouldn't be necessary so that sounds like a bug.
I always thought bash
was bad but the syntax of powershell is ridiculous .. who comes up with this shit ...
@thheller I can give you access to the repo if you want to reproduce the behaviour. I’m really sorry, I’m in a hurry with a project at work and I don’t have time to contribute with a minimal project that exposes this behaviour.