This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-28
Channels
- # ai (1)
- # beginners (239)
- # bitcoin (1)
- # boot (4)
- # cider (5)
- # clara (3)
- # cljs-dev (16)
- # cljsjs (5)
- # cljsrn (1)
- # clojure (152)
- # clojure-android (3)
- # clojure-dev (3)
- # clojure-greece (4)
- # clojure-italy (5)
- # clojure-spec (14)
- # clojure-uk (24)
- # clojurescript (81)
- # data-science (1)
- # datomic (47)
- # devcards (34)
- # docs (3)
- # emacs (6)
- # ethereum (1)
- # events (9)
- # flambo (5)
- # fulcro (11)
- # graphql (1)
- # immutant (3)
- # lein-figwheel (2)
- # leiningen (2)
- # luminus (6)
- # lumo (90)
- # off-topic (25)
- # proton (2)
- # re-frame (44)
- # reagent (5)
- # ring (7)
- # ring-swagger (11)
- # shadow-cljs (11)
- # spacemacs (6)
- # vim (13)
- # yada (25)
I seem to have hit a problem with using React UMD modules on Node (while testing Reagent)
Cljs loads React UMD file OK, but create-react-class doesn't work as it tries to use require("react")
as exports
and module
are defined, but React module can't be found
I wonder if such case has ever worked? Reagent didn't use create-react-class previously
Though probably loading react-dom which requires react should cause the same problem
> require("/home/juho/Source/reagent/out/cljsjs/react-dom/development/react-dom.inc.js");
Error: Cannot find module 'react'
Yeah, hmm...@juhoteperi @rauh had another issue earlier where the UMD file leaked some variables into the global scope. maybe their UMD bundler got messed up in some way.
Could be. I'm trying to understand how this Node bootstrap code affects this.
nodeGlobalRequire
clearly would run the code without module
or exports
, but I'm not sure if that is used here
which files is react-dom.inc.js
? there are a bunch of different .js
files in react-dom
now
This is with 15.6 still
I was, initially, but the whole test setup for Reagent is so "delicate" I decided to improve that first
Works before this change: https://github.com/clojure/clojurescript/commit/fc0989f1b44b97547410a2d2c807f16430b47486#diff-db201d3634488851510ee2fbce327924
After that change, normal require
is used instead of nodeGlobalRequire
I wonder if require
change was intended as commit speaks about __dirname
and __filename
But advanced build doesn't work either, and it that case goog.require shouldn't matter at all as all code is already in the same JS file