This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-16
Channels
- # aws-lambda (10)
- # beginners (52)
- # boot (42)
- # cider (2)
- # cljs-dev (8)
- # cljsjs (4)
- # cljsrn (10)
- # clojars (3)
- # clojure (48)
- # clojure-conj (4)
- # clojure-dev (19)
- # clojure-italy (7)
- # clojure-norway (4)
- # clojure-russia (44)
- # clojure-spec (70)
- # clojure-uk (34)
- # clojurescript (39)
- # cursive (35)
- # data-science (11)
- # datomic (7)
- # emacs (6)
- # fulcro (2)
- # hoplon (12)
- # jobs (1)
- # juxt (18)
- # lein-figwheel (2)
- # leiningen (4)
- # luminus (9)
- # off-topic (29)
- # om (46)
- # onyx (131)
- # other-languages (24)
- # parinfer (84)
- # pedestal (10)
- # portkey (45)
- # protorepl (1)
- # re-frame (15)
- # reagent (43)
- # ring-swagger (41)
- # schema (6)
- # shadow-cljs (293)
- # slack-help (2)
- # specter (42)
Hi, when referring node modules on clojurescript with npm-deps
what is the syntax for scoped modules, i.e., @xxx/yyy
? Thanks
@tiagoantao (:require ["@xxx/yyy" :as y])
, :npm-deps {"@xxx/yyy" version}
Are there any resources for learning "modern" JavaScript for those who have used Clojure/Script for far too long?
Bit of a more esoteric question, I am trying to work with Web Workers right now and have been trying to pull together https://github.com/jtkDvlp/cljs-workers and the guide at https://github.com/bhauman/lein-figwheel/wiki/Using-Figwheel-with-Web-Workers and I have it almost working but when I (:require [cljs-workers.core :as main])
and load the page I get back goog.require could not find: goog.dom.HtmlElement
. Is there anyway to tell clojurescript to exclude that goog package?
Any recommendations on automated headless testing? I was thinking Puppeteer + clojurescript, but other recommendations welcome.
in the same vein, https://github.com/tatut/clj-chrome-devtools
I'm testing out npm module integration with the latest version of clojurescript (1.9.946). I added :install-deps true
and :npm-deps {:react "15.6.1" :react-dom "15.6.1"}
to my dev build profile:
https://github.com/joshkh/sharts/blob/master/project.clj#L34-L36
And then tried to include the modules in my namespace:
https://github.com/joshkh/sharts/blob/master/src/cljs/sharts/views.cljs#L3-L4
But I get the following compilation error from figwheel:
Compiling "resources/public/js/compiled/app.js" from ["src/cljs"]...
[eval]:1
let fs = require('fs');
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at Object.exports.runInThisContext (vm.js:53:16)
at Object.<anonymous> ([eval]-wrapper:6:22)
at Module._compile (module.js:409:26)
at node.js:579:27
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)
Failed to compile "resources/public/js/compiled/app.js" in 24.061 seconds.
---- Exception ----
Assert failed: cljs.analyzer/foreign-dep? expected symbol got "react-dom/server"
(symbol? dep)
---- Exception Stack Trace ----
java.lang.AssertionError: Assert failed: cljs.analyzer/foreign-dep? expected symbol got "react-dom/server"
(symbol? dep)
at cljs.analyzer$foreign_dep_QMARK_.invokeStatic (analyzer.cljc:2095)
I basically just copied this example:
https://clojurescript.org/news/2017-07-12-clojurescript-is-not-an-island-integrating-node-modules
Any idea what I'm doing wrong? 🙂i tested with underscore and i can import functions correctly. great! however, d3 v4 doesn't seem to get past compilation. i know npm support is really alpha at this point, but has anyone had success importing d3?
Figwheel: Cleaning build - dev
Compiling "resources/public/js/compiled/app.js" from ["src/cljs"]...
ERROR: JSC_PARSE_ERROR. Parse error. 'as' expected at /whatever/src/testproject/node_modules/d3-transition/src/transition/attr.js line 2 : 17
Hello. In actual Clojure + ClojureScript full-stack applications/websites in general JSON is dominating as exchange format. Is there any reason (or downside) to send EDN on the wire?
I think the downside is the performance of native EDN. However, I believe using transit delivers the alike performance
@hkjels cool, thanks!
@andrewboltachev @hkjels you can get better performance plus full usage of clojure data structures if you use transit instead of edn or json
oh right, you mentioned transit 😄
@noisesmith yeah, with current sitaution I simply think that while even mobile has switched to CLJS with React Native, there's no particular reason to stay on JSON as it is
What is the simplest way to include semantic UI into a reagent project? I'm having a bear of a time trying to get anything working. I resorted to including a package.json
file in my cljs project, and am using gulp
as my build tool to compile the semantic CSS to my resources/public directory. Then figwheel picks those changes up and updates the UI. The issue is that every change takes like 7+ seconds to compile...
I know there are packages on cljsjs for semantic, but I'm failing to see how any less variables get customized with that approach...
Has anyone set this up before?
Did anyone successfully set up working modules with boot? or better to ask in #boot ?
@metametadata Thanks, do you use it?
@borkdude yup, I do with Chrome Headless or PhantomJS when I need some more speed
Is it possible to get multiple output files based on namespaces, but in a static manner without cljs.loader and all that?
Like, I have 2 parts of the app: service worker and frontend. They barely share anything. I need all stuff in app.frontend go to 1 file and all stuff in app.sw go to other
Ok, so code splitting is possible without :modules ?
The problem I have is that on page load nothing gets called, even though it seems to build ok-ish
@cjsauer https://opensourcery.co.za/2017/02/12/using-semantic-ui-react-with-re-frame/
soda-ash
sodium
are other choices, I tend to like opensourcery work more for cleaner syntax to reagent/re-frame 🙂
I was attempting to avoid the React integrated packages, but I'm not entirely sure why...I think I find the approach of obtaining the Less source files and customizing styling via variables more appealing. It keeps my styling completely separate from my UI logic. The flipside to that is that I now have a lot of classes sprinkled around my hiccup, but I find that customizing the look-and-feel in this way is more obvious. How is custom styling done with the react-based package?
clojurian shared https://github.com/thheller/shadow/wiki/shadow.markup, otherwise a customed build http://g14n.info/2016/11/react-semantic-customized/