This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-01
Channels
- # bangalore-clj (1)
- # beginners (16)
- # bigdata (1)
- # boot (16)
- # cljs-dev (79)
- # cljsjs (37)
- # cljsrn (62)
- # clojars (1)
- # clojure (260)
- # clojure-austin (3)
- # clojure-dev (3)
- # clojure-dusseldorf (3)
- # clojure-italy (1)
- # clojure-russia (32)
- # clojure-serbia (2)
- # clojure-spec (8)
- # clojure-uk (146)
- # clojure-ukraine (16)
- # clojurescript (66)
- # cursive (27)
- # datomic (57)
- # dirac (124)
- # emacs (10)
- # hoplon (12)
- # juxt (6)
- # keechma (6)
- # lein-figwheel (18)
- # leiningen (6)
- # lumo (51)
- # off-topic (1)
- # om (66)
- # onyx (41)
- # perun (1)
- # play-clj (1)
- # protorepl (9)
- # re-frame (20)
- # reagent (11)
- # ring (4)
- # ring-swagger (10)
- # rum (22)
- # specter (8)
- # sql (2)
- # test-check (5)
- # untangled (27)
- # yada (29)
@anmonteiro I couldn’t compile a project with :npm-deps
using your patch. Getting this error
Exception in thread "main" java.io.FileNotFoundException: resources/public/js/compiled/out-min/cljs$node_modules.js (No such file or directory)
@roman01la thanks, I'll have a look later
I’m surprised no one has reported this before, but Node.js support seems broken in 1.9.494
with :none
smallest repro:
(ns example.core
(:require [cljs.nodejs :as node]))
(node/enable-util-print!)
(println "hi")
just compile that with :target :nodejs
uhm, I am using lumo
for node that is why I haven't notice it
let me try with replumb
hrm still broken in 1.9.473
hrm, broken for me going back to 1.9.229, at which point I’m starting to believe it’s a problem with my Node version
so probably false alarm
yes it works here 🙂
OK false alarm, I forgot to add :main
to my compiler options
so PEBCAK
@dnolen still shouldn’t we require :main
to be present if :target :nodejs
?
probably worth validating that since it can lead to unexpected errors like this ^
tripped me up and I’m not properly a beginner
^ patch attached
@anmonteiro ok, makes sense
I’ve changed the compiler so we return nil if for some reason we can’t examine the contents of a JAR https://github.com/clojure/clojurescript/commit/86f26bf267f1c729313320c38e53e64450c0e68d
since the JAR inputs are sourced from the JVM anyhow I don’t see how this could be a problem
just replaced the patch in http://dev.clojure.org/jira/browse/CLJS-1960 with an updated version that fixes some annoying stuff
^ so ready for the next round of feedback 🙂
@anmonteiro I have no errors now but your example with react does not really apply to aws-sdk
does it?
why wouldn’t it apply?
I mean can I do (:require [aws-sdk :as AWS])
?
how to trigger the resolution and how to verify that it actually happens
so you need to add aws-sdk
to the :npm-deps
entry in the compiler options
in normal bootstrap I do (def AWS (js/require "aws-sdk"))
yep the above is done
then you can just require it in your namespace
if it doesn’t work you’ll know because the compiler will throw an error saying it can’t find the namespace
ok I see a nice new message: No such namespace: aws-sdk, could not locate aws_sdk.cljs, aws_sdk.cljc, or Closure namespace "aws-sdk" in file src/web/rest_resources_viz/core.cljs
so at least the error message works 😄
is there a aws-sdk
folder in node_modules
?
checking
uhm, trying again, maybe I am doing something wrong on my side, will get back to you
@anmonteiro this might be a stupid question, but with this feature, could I use node deps in browser builds? since, afaik, node uses commonjs modules, and closure can convert them to closure modules
Yes, this is not limited to Node.js target
@moxaj it goes without saying the module must also target the browser
there might also exist some hiccups e.g. when using React for the browser
saying for example that process.env
is not defined
but you can easily work around that with a goog-define
set my eyes on a nice js lib, not packaged yet with cljsjs, but available as a node lib, so this would help immensely
@moxaj you can already use it today, my patch just makes it easier
I figured out enough to test http://dev.clojure.org/jira/browse/CLJS-1868 and it looks good to me - it was my first time diving into CLJS itself (to experiment with the patch), applying a git patch and compiling it. Altogether a pretty fun experience! Does anyone think it would be worth trying to add a test for this as well?
@anmonteiro oh I never knew, cool!
@anmonteiro I think I am getting the old version of the patch because it still returns: EOF while reading
, can you try posting a -1
version?
or maybe this is a new error I am getting
that doesn’t make sense
just looks like unbalanced parens in your code?
right, there was an empty src/web/deps.cljs
left there 😞
Is there a preferred way to highlight tickets that can probably be declined in Jira? For example, http://dev.clojure.org/jira/browse/CLJS-1962 is only related to the docs on http://clojurescript.org and probably doesn't belong in Jira. Just add a comment? How about tickets that are duplicates (http://dev.clojure.org/jira/browse/CLJS-1693 looks like the same as http://dev.clojure.org/jira/browse/CLJS-1868)?
@richiardiandrea the $
being present in the filename is not the cause of what you’re seeing, that’s just how the $
character works in the shell
can you produce a repro I can try?
@anmonteiro nope don't have one, I guess it is working with build.clj
right? I am trying with boot-cljs
, the problem might be there...
the path is incorrect
Don't want to waste your time on that, I had a couple of minutes only and decided to try on an existing prj
@richiardiandrea since you have a CLJS source locally, can you try and remove the path.resolve
call here? https://github.com/anmonteiro/clojurescript/blob/node-modules/src/main/cljs/cljs/module_deps.js#L6
Sure I can, let me do that
hrm, that might not be what’s wrong though, but it’ll be good to rule something out
@anmonteiro with var filename="";
gives all sorts of other weird error
probably a string is not the expected thing here
I just said to remove the path.resolve
call
not the others 🙂
ah ah ok 😄
so that the line becomes var filename = path.join(__dirname, 'JS_FILE');
trying
@anmonteiro Error: Cannot find module 'home/arichiardi/.boot/cache/tmp/ifl/-d8mh6z/main.out/cljs$node_modules.js' from '/home/arichiardi/git/rest-resources-viz'
hrm just looks like Boot hates absolute paths 🙂