This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-29
Channels
- # announcements (1)
- # babashka (83)
- # beginners (67)
- # chlorine-clover (22)
- # cider (11)
- # circleci (6)
- # clj-kondo (12)
- # cljs-dev (137)
- # cljsrn (15)
- # clojure (124)
- # clojure-europe (40)
- # clojure-italy (1)
- # clojure-nl (3)
- # clojure-norway (1)
- # clojure-serbia (3)
- # clojure-spec (19)
- # clojure-uk (14)
- # clojuredesign-podcast (5)
- # clojurescript (80)
- # conjure (49)
- # core-async (62)
- # cursive (18)
- # datascript (1)
- # datomic (64)
- # docker (28)
- # emacs (20)
- # figwheel-main (249)
- # fulcro (95)
- # graalvm (2)
- # jobs-discuss (11)
- # joker (2)
- # juxt (4)
- # lambdaisland (9)
- # leiningen (1)
- # meander (14)
- # mount (6)
- # off-topic (16)
- # pathom (46)
- # re-frame (35)
- # reagent (6)
- # reitit (5)
- # shadow-cljs (28)
- # spacemacs (6)
- # sql (18)
- # tools-deps (26)
- # vim (8)
- # xtdb (23)
- # yada (1)
@bhauman Quickly tested 0.2.7-SNAPSHOT. Beautiful stuff, our config is now down from
{:main our.main
:target :bundle
:parallel-build true
:output-to "our/output/to.js"
:closure-defines {cljs.core/*global* "window"}
:bundle-cmd {:none ["npx" "webpack" "--mode=development" :output-to "-o" :final-output-to]
:default ["npx" "webpack"]}}
to
{:main our.maain
:output-to "our/output/to.js"}
Quite a bit of boring and noisy details that went awayIām assuming you have plans for how advanced compilation should work. Right now we are using plain cljs.main to compile, but should be fine doing it in figwheel right?
Ok, this all looks amazing =)ā¦ Well looks like updating figwheel is next on the task list =)ā¦
I recently switched from shadow-cljs to figwheel-main to try out the new bundle stuff, but I canāt get jack-in to work in vscode with Calva. It just wont connectā¦ Anybody here using Calva and figwheel-main?
Not using Fighweel Main currently, but at my last job we did. Also I know Calva very well, so maybe I can help. š Can you describe the steps you take and how it doesnāt work?
Hey! Great to hear from you! I actually tried this example repo from you https://github.com/PEZ/fresh-figwheel-main. I choose jack-in and selected :fig and :build, but then calva just stays in ātrying to connectā mode.
There, README updated. You'll see what tripped you up, I hope. I'm sorry about the inconvenience!
I would love to understand more of the source code, maybe you can point me in the direction where this is handled? And I donāt quite understand what role nrepl and piggieback plays.
I'm not an expert on nrepl, nor piggieback. But anyway, nrepl is a protocol between a REPL client and the Clojure REPL. Calva is a REPL client, using this protocol. The nREPL needs to be started in the running Clojure application in order for Calva's nREPL client to have anything to connect to, The clojure
command has a main
argument that can start the nREPL server, if it exists in the dependencies. The command also has arguments to add dependencies that are not present in the deps.edn
file. This means that with the right command line Calva gets what it needs, This command line will do the trick in the case of that templated project:
clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.23.0"} clj-kondo {:mvn/version "2020.04.05"} cider/piggieback {:mvn/version "0.4.2"} com.bhauman/figwheel-main {:mvn/version "0.2.3"}}}' -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware cider.piggieback/wrap-cljs-repl]"
If you look in the VS Code terminal where the jack-in is launched you will see where I copied it from. š It's the -m nrepl.cmdline
that starts the nrepl server. The cider.nrepl/cider-middleware
middleware is for enriching the nrepl server with some ops that Calva uses. cider.piggieback/wrap-cljs-repl
provides the piggieback cljs-repl
.
It is used by Calva (by proxy of figwheel main) to start its repl. You can see the Clojure code used here: https://github.com/BetterThanTomorrow/calva/blob/master/src/nrepl/connectSequence.ts#L142
I've tried to explain a bit in depth about Calva Jack-in here: https://calva.io/jack-in-guide/
One more thing. The reason why the :fig
alias doesn't work with Calva is that Calva can't figure out if the alias has the dependencies and main
arguments needed. So in the presence of an alias used Calva builds the commandline using the alias, but doesn't add the -m nrepl.cmdline
and middleware. In that project the fig
alias looks like so:
:aliases {:fig {:extra-deps
{com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
com.bhauman/figwheel-main {:mvn/version "0.1.9"}}
:extra-paths ["target" "test"]}
And since -m nrepl.cmdline
is not there, it won't work. The things that Calva expects should happen doesn't happen and no connection for you.
I hope I answered at least some of your questions? At least maybe I gave you some starters for understanding this in more depth. š
Just tried your test repo again and it worked flawlessly following your new instructions š
3 years late to the party, but this thread helped me over a getting started hurdle.
Specifically, I used clj-new
with https://rigsomelight.com/figwheel-main-template/ and that keeps figwheel in the :fig
alias.
Adding it to deps finally got me there
Not certain when this was introduced?
[Config Error] When using the :bundle target the :output-to file needs to be inside
the directory specified by :output-dir
Was useful to be able to have all the compiled files going to an separate folder so it would only sync the actual app.js
.Really? That might be the case, but Iāve not noticed it at all up until now, Iām a little worried that Iāve been producing broken builds š
Iām assuming optimisations advanced isnāt working? Or if it is, itās ignoring :final-output-to
Thought Iād figured it out, but no luck, just giving me a list of npm modules to install and installing them doesnāt appear to create a valid buildā¦
^{:final-output-to "resources/public/js/compiled/app.js"
:open-url false
:watch-dirs ["test" "src"]
:css-dirs ["resources/public/css"]}
{:main example.core
:target :bundle
:bundle-cmd {:default ["npx" "webpack" "--mode=production" :output-to "-o" :final-output-to]}
:output-dir "resources/public/js/compiled/"
:asset-path "/js/compiled/"
:source-map-timestamp true
:closure-defines {goog.DEBUG false}}
Couldnāt get further than here, perhaps someone will be more successful than me šā¦Still seems to be failing on some things?
[Figwheel:SEVERE] Bundling command failed
Hash: f3ef2058a04f2aae0cef
Version: webpack 4.43.0
Time: 45456ms
Built at: 05/30/2020 10:37:27 AM
1 asset
Entrypoint main = app.js
[0] (webpack)/buildin/global.js 472 bytes {0} [built]
[31] ./resources/public/js/compiled/main.js 1.14 MiB {0} [built]
[49] (webpack)/buildin/module.js 497 bytes {0} [built]
[55] util (ignored) 15 bytes {0} [built]
[57] util (ignored) 15 bytes {0} [built]
+ 61 hidden modules
ERROR in ./node_modules/xmlhttprequest/lib/XMLHttpRequest.js
Module not found: Error: Can't resolve 'child_process' in '/<project-path>/node_modules/xmlhttprequest/lib'
@ ./node_modules/xmlhttprequest/lib/XMLHttpRequest.js 15:12-36
@ ./resources/public/js/compiled/main.js
ERROR in ./node_modules/xmlhttprequest/lib/XMLHttpRequest.js
Module not found: Error: Can't resolve 'fs' in '/<project-path>/node_modules/xmlhttprequest/lib'
@ ./node_modules/xmlhttprequest/lib/XMLHttpRequest.js 16:9-22
@ ./resources/public/js/compiled/main.js
Syntax error (ExceptionInfo) compiling at (/private/var/folders/xl/rkkw077j4xxf827wn82mcp_c0000gn/T/form-init5928516375636353650.clj:1:125).
Bundling command failed
Hash: f3ef2058a04f2aae0cef
Version: webpack 4.43.0
Time: 45456ms
Built at: 05/30/2020 10:37:27 AM
1 asset
Entrypoint main = app.js
[0] (webpack)/buildin/global.js 472 bytes {0} [built]
[31] ./resources/public/js/compiled/main.js 1.14 MiB {0} [built]
[49] (webpack)/buildin/module.js 497 bytes {0} [built]
[55] util (ignored) 15 bytes {0} [built]
[57] util (ignored) 15 bytes {0} [built]
+ 61 hidden modules
ERROR in ./node_modules/xmlhttprequest/lib/XMLHttpRequest.js
Module not found: Error: Can't resolve 'child_process' in '/<project-path>/node_modules/xmlhttprequest/lib'
@ ./node_modules/xmlhttprequest/lib/XMLHttpRequest.js 15:12-36
@ ./resources/public/js/compiled/main.js
ERROR in ./node_modules/xmlhttprequest/lib/XMLHttpRequest.js
Module not found: Error: Can't resolve 'fs' in '/<project-path>/node_modules/xmlhttprequest/lib'
@ ./node_modules/xmlhttprequest/lib/XMLHttpRequest.js 16:9-22
@ ./resources/public/js/compiled/main.js
^{:final-output-to "resources/public/js/compiled/app.js"
:open-url false
:watch-dirs ["test" "src"]
:css-dirs ["resources/public/css"]}
{:main example.core
:target :bundle
:bundle-cmd {:default ["npx" "webpack" "--mode=production" :output-to "-o" :final-output-to]}
:output-dir "resources/public/js/compiled/"
:asset-path "/js/compiled/"
:source-map-timestamp true
:devcards true
:closure-defines {cljs.core/*global* "window"
goog.DEBUG false}}
because the bundling isnāt working based on either the way you are requiring āfsā or āchild_processā, or some other reason it canāt resolve them
Somewhat? I got it working at one point, but then tried to get prod working and so now I suspect itās not in a great state.
I preferably want one consistent way to produce an output that given an index.html file produces:
in dev, a file (which in my case is app.js
) and a folder which I can just stick on s3.
in prod a single app.js
which I can also stick on s3 with itās index.htmlā¦
I previously achieved this with different dev.cljs.edn
and min.cljs.edn
to produce a consistent output =)ā¦
I donāt believe I require those libs at all, a library I use mightā¦
Iād try to get back to that state, you may need to blow away node_modules and start again
Iāve been fiddling with the cljs version to see if thatās the problem, not quite certain which version I needā¦ (currently on 1.10.764
)
Right, Iāll be able to try this again in about 30 mins, will let you know how I get on =)ā¦
Something came up, just got back and trying it now.
- ok, killed my node_modules, and deleted all the existing js stuff and now rebuilding dev.
- dev works it seems, trying min.
- nope min still failsā¦
@bhauman Not sure what you mean by :auto-bundle :webpack
? Do you mean setting :target :bundle
?
- Trying again with min, Iāll add all the deps it says are missing, but dev didnāt complain at allā¦
- Nope just fails with the same message as before.
@folcon for bundling a single artifact you need to use either advanced or simple :optimizations
Is there some special way I should be setting :optimizations :advanced
?
All I have is this:
my lein alias:
lein run -m figwheel.main -O advanced -bo min
min.cljs.edn
:
^{:final-output-to "resources/public/js/compiled/app.js"
:open-url false
:watch-dirs ["test" "src"]
:css-dirs ["resources/public/css"]}
{:main example.core
:target :bundle
:bundle-cmd {:default ["npx" "webpack" "--mode=production" :output-to "-o" :final-output-to]}
:output-dir "resources/public/js/compiled/"
:source-map-timestamp true
:devcards true
:closure-defines {cljs.core/*global* "window"
goog.DEBUG false}}
Right, flushed node_modules
and reinstalled, and building min.
Doesnāt work:
[Figwheel:SEVERE] Bundling command failed
Hash: b732264b26408a237e25
Version: webpack 4.43.0
Time: 39221ms
Built at: 05/31/2020 1:22:58 AM
1 asset
Entrypoint main = app.js
[7] ./resources/public/js/compiled/main.js 1.14 MiB {0} [built]
[8] (webpack)/buildin/global.js 472 bytes {0} [built]
+ 16 hidden modules
ERROR in ./resources/public/js/compiled/main.js
Module not found: Error: Can't resolve 'react' in '/<project folder>/resources/public/js/compiled'
@ ./resources/public/js/compiled/main.js 36:82-98 48:101-117 246:78-94
...
Just canāt resolve libs like react
, react-dom
againā¦
Now devs not working eitherā¦ Just trying to debug whyā¦You should make sure that you also delete the resources/public/js/compiled dir as well between runs
and then bundling from the command line and try to follow the source of the errors, it seems like there is a bad require path or something
also perhaps compile the advanced build to a completely different directory than the dev build
Nope, not setting any webpack.config.js
stuff, I didnāt want to mess around with any settings you might have createdā¦
Iām normally flushing the compiled folder and the node_modules
folder. Iāll try bundling from the command lineā¦
btw this bit is correct right?
:bundle-cmd {:default ["npx" "webpack" "--mode=production" :output-to "-o" :final-output-to]}
Ok Iām doing this in stages as requested, not really had to debug webpack before, but something interesting, this is the first webpack error:
ERROR in ./resources/public/js/compiled/main.js
Module not found: Error: Can't resolve 'react' in '/<project-folder>/resources/public/js/compiled'
@ ./resources/public/js/compiled/main.js 36:82-98 48:101-117 246:78-94
Itās caused by multiple places performing:
require("react")
which is as you suggested would be the problem, but the file itself has:
/** @license React v16.3.2
* react.production.min.js
...
;(function(p,h){"object"===typeof exports&&"undefined"!==typeof module?module.exports=h():"function"===typeof define&&define.amd?define(h):p.React=h()})
I read that as itās being exported as h
? I thought that at this point the externs are not supposed to be minified?Oh, sorry no. The first thing I saw was the npm guide that youād written, if thatās necessary info, perhaps link that?
With regards to overriding foreign libs, Iām not actually trying to use the npm react, Iām using another npm lib, but for some reason itās not using the reagent
react libā¦
but there may be a bug here or something we donāt understand so it might be worth maybe creating a small example of this behavior to verify it
but I definitely need to understand it because I want the NPM docs to cover this well
well that doesnāt answer what this is coming from?
Module not found: Error: Can't resolve 'xmlhttprequest'
I mean this system does seem to assume that the user is basically swapping cljs libs for npm ones, but tracking that is not trivial =)ā¦
Iām not sure thatās really true, Iām going to check that with reagent right now
Perhaps not, Iām very willing to believe Iāve configured something incorrectly, but I have no idea whatā¦
Found a clue on stackoverflow[0]:
The xmlhttprequest package is meant for server-side JavaScript.
Is there something specifying webpack is targeting server-side instead of the browser?
- [0] https://stackoverflow.com/a/53421896webpack.config.js
module.exports = {
target: 'web',
entry: './resources/public/js/compiled/out/main.js',
output: {
path: __dirname + "/out",
filename: 'app.js'
},
resolve: {
modules: ['./resources/public/js/compiled/out/', './node_modules']
}
}
One isnāt being created in min
, trying with dev
.
npm_deps.js
module.exports = {
npmDeps: {
"pako": require('pako') }
};
I just confirmed that the :bundle target does not utilize cljsjs libs but does include them so that they are available globally
Right, but does that mean that I should audit my cljs libs to work out what npm stuff theyāre doing and import them myself and exclude them in deps.edn
?
That seems like itās not really handling that? I mean from my reading of the clojurescript announcement we could mix and match this, unless thereās some new command that just tells us whatās being used? I mean library deps can get pretty complicatedā¦
Right, but in which case I donāt see the upside of using npm deps? It seems like the cost is taking on the burden of auditing all my libs to work out what they import and then explicitly excluding those and adding the imports myselfā¦ I mean at that point why not just write a cljsjs wrapper and skip all the hassle?
Well I can update, thatās not a blocker, I just wanted to keep the changes minimal while I was doing this =)ā¦
If you have no need to use webpack or a bunch of npm libraries then there is no need to use the bundle target.
Right, but I want to just use 1 npm lib, maybe a few more at some point in the future, thatās the target at least =)ā¦
Iām also not quite clear about why the xmlhttprequest error came up as that implies it was building a node target as opposed to a browser oneā¦
One thing Iām wondering is if the expectation is to perform in-depth auditing as you describe, a command to walk the deps and pull out the excludes / npm installs would be invaluable.
Thanks for the help, Iāll have to see if I can figure out some other way of managing this thenā¦
that will add the packages that cljs libraries like reagent need if they are specified
Hmm, so the intent is to use :install-deps
as a flag? Perhaps I can put that into my figwheel dev.cljs.edn?
reagent has this file https://github.com/reagent-project/reagent/blob/master/src/deps.cljs
Ok, so perhaps do that before I call figwheel dev or advanced? Iāll give that a go now
if a ClojureScript library uses a js lib by its global value like js/React
then node modules wont work with it
Itās 0.8.1, which isnāt too bad, but fine this is a way I can move forward =)ā¦ And thatās good to know, Iāll be needing to write interop libs at some point, so knowing this is really helpful!
unfortunately this is all implicit knowledge and really needs to be recorded somewhere in the docs
But as libraries improve and the eco-system adjusts this should all be pretty seemless
Iāll keep this updated if I figure out a fix, as in some sense this is probably a really useful thread for anyone looking at the logs in the futureā¦
Btw, not sure if anything can be done about this?
[Figwheel] Failed to compile build dev in 1.074 seconds.
[Figwheel:WARNING] Compile Exception: contains? not supported on type: java.lang.Boolean
[Figwheel:SEVERE] contains? not supported on type: java.lang.Boolean
IE: a filename / line number would be helpful =)ā¦install-deps has that error in the previous version of clojurescript not the current one
Ok, I just did the :install-deps
and the react errors went awayā¦
Thereās just this node module thing:
Module not found: Error: Can't resolve 'xmlhttprequest'
Time to figure out where thatās coming from >_<ā¦I think I found it? It looks like clojurescript itself is making it in xml_http_request.js
?
// Compiled by ClojureScript 1.10.773 {:target :nodejs}
goog.provide('ajax.xml_http_request')
Thanks for the heads up =)ā¦ Trying with simple
assuming Iām passing the flag correctly ;)ā¦
Well this is the offending line:
ajax.xml_http_request.xmlhttprequest=cljs.core._EQ_.call(null,cljs.core._STAR_target_STAR_,"nodejs")?function(){var a=require("xmlhttprequest").XMLHttpRequest;goog.object.set(global,"XMLHttpRequest",a);return a}():window.XMLHttpRequest;ajax.xml_http_request.xmlhttprequest.prototype.ajax$protocols$AjaxImpl$=cljs.core.PROTOCOL_SENTINEL;
So this I think?
ajax.xml-http-request
:
(def xmlhttprequest
(if (= cljs.core/*target* "nodejs")
(let [xmlhttprequest (.-XMLHttpRequest (js/require "xmlhttprequest"))]
(goog.object/set js/global "XMLHttpRequest" xmlhttprequest)
xmlhttprequest)
(.-XMLHttpRequest js/window)))
I donāt really understand why this is true?
(= cljs.core/*target* "nodejs")
Surely *target*
should be "bundle"
?hey where is that code?
(def xmlhttprequest
(if (= cljs.core/*target* "nodejs")
(let [xmlhttprequest (.-XMLHttpRequest (js/require "xmlhttprequest"))]
(goog.object/set js/global "XMLHttpRequest" xmlhttprequest)
xmlhttprequest)
(.-XMLHttpRequest js/window)))
https://github.com/JulianBirch/cljs-ajax/blob/master/src/ajax/xml_http_request.cljs#L29
Hmm, looks like itās being set:
cljs.core._STAR_target_STAR_="bundle"
yet:
ajax.xml_http_request.xmlhttprequest=cljs.core._EQ_.call(null,cljs.core._STAR_target_STAR_,"nodejs")?function(){var a=require("xmlhttprequest").XMLHttpRequest;goog.object.set(global,"XMLHttpRequest",a);return a}():XMLHttpRequest;ajax.xml_http_request.xmlhttprequest.prototype.ajax$protocols$AjaxImpl$=cljs.core.PROTOCOL_SENTINEL;
Still gives the errorā¦
Module not found: Error: Can't resolve 'xmlhttprequest'
oh yeah that wonāt fix it because the require is actually in the code and the bundler is trying to replace it
This is getting silly:
resolve: {
alias: {'xmlhttprequest': false},
...
}
error:
Bundling command failed
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.resolve.alias['xmlhttprequest'] should be a string.
-> New request
Iām going to reread these docs >_<ā¦Ok so the upside is that it compiles, the downside is that itās brokenā¦ Iām going to try and work out if updating the deps helpsā¦
Hereās what I have so far on what is required is:
webpack.config.js
:
module.exports = {
target: 'web',
entry: './resources/public/js/compiled/out/main.js',
output: {
path: __dirname + "/out",
filename: 'app.js'
},
resolve: {
alias: {'xmlhttprequest': false},
modules: ['./resources/public/js/compiled/out/', './node_modules']
}
}
dev.cljs.edn
:
^{:final-output-to "resources/public/js/compiled/app.js"
:open-url false
:watch-dirs ["test" "src"]
:css-dirs ["resources/public/css"]
#_#_
:auto-testing true}
{:main example.core
:target :bundle
:bundle-cmd {:none ["npx" "webpack" "--mode=development" :output-to "-o" :final-output-to]}
:output-dir "resources/public/js/compiled/out"
:install-deps true
:npm-deps {"react" "16.8.6"
"react-dom" "16.8.6"}
:source-map-timestamp true}
min.cljs.edn
:
^{:final-output-to "resources/public/js/compiled/app.js"
:open-url false
:watch-dirs ["test" "src"]
:css-dirs ["resources/public/css"]}
{:main example.core
:target :bundle
:bundle-cmd {:default ["npx" "webpack" "--mode=production" :output-to "-o" :final-output-to]}
:output-dir "resources/public/js/compiled/out"
:source-map-timestamp true
:devcards true
:install-deps true
:npm-deps {"react" "16.8.6"
"react-dom" "16.8.6"}
:closure-defines {cljs.core/*global* "window"
cljs.core/*target* "browser"
goog.DEBUG false}}
:
{
"name": "example",
"version": "1.0.0",
"description": "",
"main": "index.js",
"directories": {
"doc": "docs",
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"homepage": "",
"devDependencies": {
"webpack": "^5.0.0-beta.16",
"webpack-cli": "^3.3.11"
},
"dependencies": {
"pako": "^1.0.11"
}
}
Profile :dev deps:
[com.bhauman/figwheel-main "0.2.7-SNAPSHOT"]
[com.bhauman/rebel-readline-cljs "0.1.4"]
To build dev:
lein run -m figwheel.main -b dev -r --install-deps
To build min:
lein run -m figwheel.main -O advanced -bo min
Notes:
Use resolve.alias
module-name false in webpack.config.js
, ie:
resolve: {alias: {'xmlhttprequest': false}}
To elide a module from webpack thatās being mistakenly added.
If it should be added, but itās not in being added because itās a dep in a cljsjs lib for example use either :install-deps true
or add --install-deps
to the figwheel.main command as shown to add it.
Canāt seem to add --install-deps
to the min lein run command, but this can be worked around by adding it into min.cljs.edn
.One of the problems is coming from:
cljsjs/react-transition-group
Which is interesting, going to try what you mentioned earlier to pull it straight from npmok so react works as stated, but react-transition-group
does notā¦
cljs.user=> (require '[cljsjs.react-transition-group])
nil
cljs.user=> js/ReactTransitionGroup
#js {}
cljs.user=> (require '[react-transition-group])
nil
cljs.user=> react-transition-group
nil
cljs.user=> (js-keys react-transition-group)
#js []
this is with :npm-deps
:
"react-transition-group" "4.4.1"
and:
[cljsjs/react-transition-group "4.3.0-0"]
Also npm_deps.js
does not contain an entry for react-transition-group
.Iāve been spending the past few hours trying to debug where this is coming from:
Uncaught TypeError: Cannot read property 'unstable_cancelCallback' of undefined
As far as I can tell itās to do with react
and react-dom
versions, being incompatible, even though theyāre currently exactly the same.
This seems rather fiddly and exceedingly fragile. Iām also a little worried that the difficultly of this process is making me even more unwilling to update libs when it should be the other way around?
Iāll try and see if I can pick this up tomorrowā¦also added some infor to cljs-ajax here https://github.com/JulianBirch/cljs-ajax/issues/247
but until this https://clojure.atlassian.net/browse/CLJS-3258 is fixed its going to be hard to have cljsjs libs in :bundle
I use deps.edn
in new projects, but the code Iām currently in is an old one so itās all lein based, Iām trying to work out if thereās a lein equivalent to clj -m cljs.main --install-deps --open-url false
as calling that without a deps.edn
just crashesā¦
Although thinking about it perhaps itās best to establish that this works before porting everythingā¦
Iāve made some notes as I went, so far itās looking good, do you want them? If not Iāll probably put together a quick blog postā¦
Done! Looks a bit more complicated than before, but manageable I think, and hopefully when that bug gets fixed it will become simpler again =)ā¦
OK more news on this front, you can mix cljsjs libs and node libs, but you have to use :aot-cache false , because libraries like reagent
are getting compiled and cached depending on node_modules or cljsjs libs
Ok so with :aot-cache false
is that a general rule, or can I now eliminate other flags that are set? like:
:install-deps true
@folcon actually this is confusing because figwheel.main defaults aot-cache to false
you donāt have to set :install-deps true, you should just use the --install-deps command line
Cool, what about things like:
cljs.core/*global* "window"
Though I think this is probably going to stick around it seems :)ā¦