Fork me on GitHub
#clojurescript
<
2017-10-16
>
tiagoantao03:10:28

Hi, when referring node modules on clojurescript with npm-deps what is the syntax for scoped modules, i.e., @xxx/yyy? Thanks

thheller05:10:14

@tiagoantao (:require ["@xxx/yyy" :as y]), :npm-deps {"@xxx/yyy" version}

rovanion08:10:15

Are there any resources for learning "modern" JavaScript for those who have used Clojure/Script for far too long?

royalaid08:10:26

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?

borkdude11:10:47

Any recommendations on automated headless testing? I was thinking Puppeteer + clojurescript, but other recommendations welcome.

joshkh13:10:57

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? 🙂

joshkh14:10:04

okay, upgrading from node 4.4.4 (ha...) to 8.7.0 fixed it.

joshkh15:10:28

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

andrewboltachev18:10:55

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?

hkjels18:10:21

I think the downside is the performance of native EDN. However, I believe using transit delivers the alike performance

hkjels18:10:39

or so I’ve been told anyways

hkjels18:10:26

For me, if it’s a full-stack project I’d use edn

noisesmith18:10:15

@andrewboltachev @hkjels you can get better performance plus full usage of clojure data structures if you use transit instead of edn or json

noisesmith18:10:37

oh right, you mentioned transit 😄

andrewboltachev18:10:52

@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

borkdude18:10:59

@tatut That looks very interesting

cjsauer19:10:52

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?

yury.solovyov20:10:00

Did anyone successfully set up working modules with boot? or better to ask in #boot ?

borkdude20:10:05

@metametadata Thanks, do you use it?

metametadata20:10:39

@borkdude yup, I do with Chrome Headless or PhantomJS when I need some more speed

yury.solovyov21:10:25

Is it possible to get multiple output files based on namespaces, but in a static manner without cljs.loader and all that?

dnolen21:10:45

code splitting and cljs.loader are separate features

yury.solovyov21:10:54

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

yury.solovyov21:10:26

Ok, so code splitting is possible without :modules ?

dnolen21:10:25

I’m just saying loader is another feature on top of :modules - not a requirement

yury.solovyov21:10:47

The problem I have is that on page load nothing gets called, even though it seems to build ok-ish

lovuikeng01:10:58

soda-ash sodium are other choices, I tend to like opensourcery work more for cleaner syntax to reagent/re-frame 🙂

cjsauer04:10:50

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?

emccue23:10:27

I'm trying to convince the team I'm working on to use mori as opposed to ImmutableJS

emccue23:10:04

Is this project still being maintained?

emccue23:10:35

If it isn't, why not?