This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-05
Channels
- # beginners (135)
- # cider (30)
- # clara (66)
- # cljs-dev (18)
- # cljsrn (6)
- # clojure (115)
- # clojure-austin (1)
- # clojure-dev (10)
- # clojure-italy (7)
- # clojure-nl (1)
- # clojure-spec (18)
- # clojure-uk (26)
- # clojurescript (76)
- # cursive (2)
- # datomic (4)
- # devops (1)
- # emacs (19)
- # fulcro (159)
- # garden (3)
- # klipse (5)
- # leiningen (5)
- # off-topic (61)
- # om (7)
- # pedestal (6)
- # re-frame (17)
- # reagent (73)
- # ring-swagger (6)
- # rum (5)
- # shadow-cljs (60)
- # spacemacs (31)
- # specter (4)
- # vim (8)
- # yada (1)
@richiardiandrea that already works… you can npm install
based on your package.json
dependencies and just require
them in your ClojureScript namespaces. That’s the whole reason why we index node_modules
before compiling
Oh cool @anmonteiro thanks, I should have added while compiling: does it work the same for compilation?
what are you asking? I don’t understand exactly
To reword it a bit, if I drop :npm-deps
during compilation would the compiler still take node_modules
deps? I remember having seen two different code paths but I might also be very wrong
yes, the way I understood it that’s what you asked initially
yes, the way I understood it that’s what you asked initially
Closure got finally fix for UMD wrapper detection, this should fix React 16 UMD bundles: https://github.com/google/closure-compiler/pull/2963
well then I think we should probably wonder if this has got anything to do with ClojureScript
doing nothing on the ClojureScript side would mean that all foreign libs would need to be packaged with "use strict" global directives stripped out to be usable with :modules, would this be the option you would suggest?
@dnolen The minified and optimized React v16 js specifies a global "use strict" directive, it can be seen on the first line here: https://unpkg.com/[email protected]/umd/react.production.min.js (https://reactjs.org/docs/cdn-links.html) . cljsjs/react
uses the same https://github.com/cljsjs/packages/blob/master/react/build.boot#L22 .
React v16 is not needed to repro the issue, setting a global "use strict" directive on any module output where another module will attempt to load and invoke a function will repro the issue.
@dnolen no, there was no global directive in v15, the global directive was introduced in 16.0.0
this seems broken to me, how is this not considered a bug if people are going to concatenate?
fwiw, bundlers like webpack and browserify wrap each script in an IIFE and use function-local “use strict”. it appears that the ‘use strict’ problem is part of the reason why: https://github.com/browserify/browserify/issues/926