This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-02
Channels
- # beginners (118)
- # boot (73)
- # cider (2)
- # cljs-dev (65)
- # cljsrn (18)
- # clojure (49)
- # clojure-argentina (4)
- # clojure-italy (19)
- # clojure-portugal (1)
- # clojure-russia (1)
- # clojure-spec (34)
- # clojure-uk (102)
- # clojurescript (202)
- # code-reviews (3)
- # core-async (5)
- # cursive (11)
- # datomic (25)
- # emacs (1)
- # graphql (22)
- # hoplon (6)
- # keechma (59)
- # leiningen (10)
- # luminus (31)
- # lumo (78)
- # off-topic (141)
- # om (32)
- # om-next (2)
- # onyx (6)
- # parinfer (55)
- # pedestal (3)
- # protorepl (3)
- # re-frame (8)
- # reagent (8)
- # ring-swagger (1)
- # rum (20)
- # specter (1)
- # sql (5)
- # test-check (11)
- # vim (13)
- # yada (7)
FWIW I think CLJS-2288 is still wrong
I’m setting up Windows CI and I think I can provide fixes to all things windows that supersede those in the tickets
diff here https://github.com/clojure/clojurescript/compare/master...anmonteiro:appveyor?expand=1
(including relative-name, which is now well tested in both Windows / non-Windows)
^ actually attached what I have to https://dev.clojure.org/jira/browse/CLJS-2291
so that people can use in their own forks (cc @mfikes ) and make it better
there are like 5 failures in lein test
and 3 failures in script/test
I got that down from 20 in lein test
🙂
Good stuff
A question, is there a way to access the current cljs.env/*compiler*
from a cljs REPL ? I was working on supporting cljs completions in inf-clojure
@thheller thanks! Right a macro would not work I guess for completions if I end up in a vanilla cljs repl. There is a server starting there so maybe I can use that? How do you solve it in shadow-cljs?
But the vanilla Repl drops you in a cljs repl immediately
Are we talking present repls or future repls?
You could also multiplex
(sorry off topic here)
weird because when I try to nc localhost port-of-a-vanilla-repl
I receive a single ready
as answer, how do you folks use it?
Maybe found a problem, I have this node_repl.clj
:
(require 'cljs.repl)
(require 'cljs.build.api)
(require 'cljs.repl.node)
(cljs.build.api/build "src" {:main "logpoc.core"
:target :nodejs
:output-to "out/logpoc.js"
:verbose true})
(cljs.repl/repl (cljs.repl.node/repl-env)
:watch "src"
:output-dir "out")
but in my out/watch.log
:
$ cat out/watch.log
Building ...
java.lang.AssertionError: Assert failed: :nodejs target with :none optimizations requires a :main entry
(not (and (= target :nodejs) (= optimizations :none) (not (contains? opts :main))))
at cljs.closure$check_node_target.invokeStatic(closure.clj:1954)
at cljs.closure$check_node_target.invoke(closure.clj:1951)
at cljs.closure$build.invokeStatic(closure.clj:2475)
at cljs.closure$build.invoke(closure.clj:2444)
at cljs.closure$watch$buildf__6992.invoke(closure.clj:2647)
at cljs.closure$watch.invokeStatic(closure.clj:2679)
at cljs.closure$watch.invoke(closure.clj:2623)
at cljs.repl$repl_STAR_$fn__7543$fn__7548.invoke(repl.cljc:902)
at clojure.core$binding_conveyor_fn$fn__4676.invoke(core.clj:1938)
at clojure.lang.AFn.run(AFn.java:22)
at java.lang.Thread.run(Thread.java:748)
Watching paths: /home/arichiardi/git/logpoc/src
Hmm, check-source-map
will give error if :source-map true
is provided but no :optimizations
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/closure.clj#L1886
There are a few other check-*
functions that seem to presume :optimizations
is always set, but most of them are being called with the original opts, not opts with implicit opts added
Maybe mine above is the same problem actually, I don't have any :optimizations
https://github.com/clojure/clojurescript/commit/79509651e16bf2b2fdc60a39de8671ef96206055 looks like check-preloads
was fixed a while ago
I added the option to my node_repl.clj
but no luck
There are two test cases which use :target :nodejs
, without :optimizations
and no :main
, which breaks assertion at check-node-targets
so I guess these tests are broken as well? in my case the options are there unless I am doing something wrong. I am going to try to take them away...It is very weird that in my case the repl starts but out/watch.log
contains the error
tried 1.9.660
with no luck as well
Just adding the :main
option fixed the tests
not here but thanks, I'll make a repro case I think (as a side note, sometimes you don't want a :main
, but I guess cljs compiler does not have the notion of a node library yet)
uhm so mies
does not have the build step as per the Getting Started for the repl
ok repository attached, I am going to wait before opening a ticket cause maybe it is expected: https://github.com/arichiardi/node-repl-main-error
@juhoteperi going to try Closure master + that patch with our tests
^ fixes it
@anmonteiro What did you use to run Closure tests? mvn
, Idea?
@juhoteperi mvn -pl pom-main-unshaded.xml test -Dtest=RewriteJsonToModuleTest
that’ll run only 1 test
I tried using -Dtest
yesterday but it didn't run anything
you probably need to add the pom-main
what does that -pl pom-main-unshaded.xml
part do? I didn't use that
it makes maven aware of that pom
otherwise I think it only picks up pom.xml
Okay.
-pl,--projects <arg> Comma-delimited list of specified
reactor projects to build instead
of all projects. A project can be
specified by [groupId]:artifactId
or by its relative path
I'll have a quick look at those UMD wrappers
@juhoteperi I started looking at the package.json browser field but got sidetracked with the Windows CI stuff yesterday
@juhoteperi https://github.com/google/closure-compiler/commit/afecc106ff2b7682cd3cb35c8c4b4f50d032552b
it’s a commit 🎉
might be in the next release, I don’t think they have cut a branch yet
I made some very small progress with wrappers, one problem was that if Immediately-invoked function expression was wrapped with !
it wasn't removed
But there are other probems, like function foo () { return 'export' }; module.exports = foo();
which are more complicated to fix
or function foo(exports) { exports.foo = 'hello'; }; foo(module.exports);
Got the ternary UMD wrapper working with Leaflet
Some wrapper could have code like this 😄
void !!-+-+!~! void !~!!~~~~!! function() { console.log("hello world") }()
But I hope no real library does that
hahaha
1 && function () { /* ... */ }();
0, function () { /* ... */ }();
might be reasonable, but these will be easy to fix is encountered laterprobably these are not used as they take more chars than parenthesis or one of those operators
I started a Cljsjs wiki page to document which packages work with module processing, and to track the problems: https://github.com/cljsjs/packages/wiki/Closure-npm-Module-processing-status