This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-24
Channels
- # beginners (15)
- # boot (4)
- # cider (1)
- # cljs-dev (2)
- # cljsrn (5)
- # clojure (124)
- # clojure-france (2)
- # clojure-russia (22)
- # clojure-uk (10)
- # clojurescript (50)
- # core-async (5)
- # cursive (3)
- # datomic (8)
- # emacs (2)
- # fulcro (10)
- # hoplon (8)
- # jobs (4)
- # luminus (2)
- # lumo (7)
- # off-topic (14)
- # portkey (7)
- # re-frame (22)
- # reagent (2)
- # shadow-cljs (3)
- # spacemacs (1)
- # yada (26)
Hello, has anyone used twbs via :npm-deps
? I thought I'd give [email protected]
a try but I've run into a couple of issues...
So, I have this cljsbuild compiler option
:npm-deps {:jquery "3.2.1"
:popper.js "1.12.5"
:bootstrap "4.0.0-beta"
:bootstrap-table "1.11.1"}
but I've that the main
prop in bootstrap's package.json doesn't have the file extension and cljsbuild fails to find the package...If I manually tweak node_modules/bootstrap/package.json
so that it reads "main": "dist/js/bootstrap.js"
cljsbuild appears to be satisfied... Is there anyway to override the main
prop of an npm package with a cljsbuild option?
@au-phiware that’s fixed in ClojureScript master
so perhaps easier to use your own built version?
oh, ok, cool, no override necessary then (when it's released)?
exactly
I have another issue...
13:34:01.777 Error: Undefined nameToPath for bootstrap 1 base.js:1357:21
visitNode
visitNode
visitNode
goog.writeScripts_
goog.require
<anonymous>
can you help?
@au-phiware please try master
happy to look at a repro from master
otherwise your issue might be solved and we’d both be wasting time
^ here are instructions to build CLJS from master
righto, so... sorry, is it possible to get lein-cljsbuild to use master?
build master, note down the version number that has been built and use that in your project.clj
ok, great I'll follow the link and give it a try, thanks
ok, managed to build from master and it fixes my first issue but I'm still running into Undefined nameToPath for bootstrap
... looks like a google closure thing... not sure how to proceed...
@au-phiware make a minimal repro I can look at please
preferably a single source file + a single build script
should be enough to repro your issue
ok, I have a small repo: https://github.com/au-phiware/lein-new/tree/bootstrap
but I shall work on the minimal case for you
actually, I skipped a step whilst building cljsbuild... I will try again 🙂
sorry @anmonteiro, I haven't used cljs.build.api directly before, I feel like I'm missing some very basic here: https://github.com/au-phiware/cljsbuild-bootstrap4
:bootstrap
ok, I feel that this exhibits the problem, but I need to create a html page to be sure...
I can't reproduce the error, but I can't get it to work either! I'm probably missing simple again but I don't have time atm, will have to get back to it later...
the last line of main.js doesn't look right
goog.addDependency("../cljsbuild_bootstrap4/core.js", ['cljsbuild_bootstrap4.core'], ['cljs.core', 'bootstrap', 'module$home$corin$Projects$GitHub$cljsbuild_bootstrap4$node_modules$jquery$dist$jquery']);
shouldn't bootstrap be from node_modules? does it collide with something else?@anmonteiro, I realised what I was doing wrong (forgot to add the :main
option) and this now reproduces the error... I'll file a JIRA bug
Does anyone have some recommendation on service workers? Is there any suggested library?
sorry if this is a silly question, I've been looking around but haven't been able to find an answer:
is it possible to start using clojurescript in an existing node project? e.g. some way to add clojurescript as a dependency in the package.json
of an existing npm/yarn project? I have a relatively large project that I'd like to start introducing clojurescript into, but don't want to throw away the js that already exists.
hmm, not sure if it is the best option, but maybe via Lumo ? https://github.com/anmonteiro/lumo
this might be relevant: https://github.com/thheller/shadow-cljs/wiki/ClojureScript-for-JS-Devs
@krauser I don't think lumo is what you're after. Shadow-cljs is more likely. Lumo is a special compilation of node that runs cljs instead (but you can require js from it.) but if you want to augment a js project with some js "modules", you're after shadow-cljs
I think you may be right. I've hacked around for the last little bit with lumo, and am able to compile cljs code in a node project, but haven't been able to integrate the js and cljs code, yet
anyone using core.async in cljs, do we still have to (:require-macros [cljs.core.async.macros :as async])
separately?
I guess refer-macros won't work either?
no, because it’s a different namespace