Fork me on GitHub
#shadow-cljs
<
2018-07-27
>
eoliphant00:07:10

looks like this react-scripts command does bunch of that stuff, delegates out to webpack etc

eoliphant00:07:24

but apparently the configs are internal or something

eoliphant00:07:44

found it, you can ‘eject’ the project and see all the configs

justinlee00:07:06

fwiw, react-scripts is the meat of create-react-app

eoliphant00:07:16

just figured that out 🙂

justinlee00:07:36

so you have a commercial library that assumes you’re running on c-r-a? wonders never cease

eoliphant00:07:03

even better that’s how it’s distributed

justinlee00:07:20

i don’t really grok how that’s supposed to work

eoliphant00:07:35

yeah it’s a little annoying

eoliphant00:07:25

they’ve lumped the components, demo pages, etc

justinlee00:07:27

so if it is cra have you tried typing npm run-script build

eoliphant00:07:32

all in a ‘src’

eoliphant00:07:45

just re-unpacked it

eoliphant00:07:49

and trying that

justinlee00:07:01

that should create a javascript bundle and a css bundle

eoliphant00:07:48

so.. at this point i should be able to drop the .js in my source and (require) stuff from it?

justinlee00:07:46

i don’t know 🙂

justinlee00:07:12

the thing is that the bundle is going to include react

justinlee00:07:27

i wonder if the intermediate compiled files can be picked up before they’ve been bundled

eoliphant00:07:45

ugh this is truly in the weeds now. since that’s essentially an ‘app’… yeah it’s gonna have react

eoliphant01:07:31

ugh.. lol, plus not even sure how the (require) is supposed to work. I have this main.js now, with all the components I want. But if I’m doing (require “a/b” :default c) presumably shadow is going to expect to see that in node_modules, etc

eoliphant01:07:37

to your point, i really need the transformed .jsx files

thheller07:07:58

@eoliphant the code you posted seems to be very webpack specific and its going to be hard to port this to shadow-cljs. you could instead use :target :npm-module and continue using the existing build system to create the final bundle

thheller07:07:12

results won't be optimal but probably a lot less work to integrate

kwladyka07:07:28

I have .sol files in project, which are files in different language to compile. I would like to do shadow-cljs watch tests and re-run tests if this file will change. At that moment shadow-cljs doesn’t detect this change. 1) How to re-run tests when .sol files change? 2) How to compile .sol files if they change. I have to run code (probably the best lein command) each time when files in /src/contracts change. It could be done in 2 separated steps. 1) shadow-cljs watch app to watch changes including change of compiled files .abi in some directory, 2) watcher to track /src/contracts to compile them when source changed.

thheller07:07:27

@kwladyka how are the .sol files used in the project?

kwladyka07:07:38

.sol are compiled to .abi and .bin files. These files are used by module in javascript later.

thheller07:07:00

how are they compiled? by a command you trigger?

thheller07:07:18

ie. make contract or something?

kwladyka07:07:31

but it could be run by shell

kwladyka07:07:52

but probably I prefer lein command

kwladyka07:07:59

to make it consistent

thheller07:07:37

lein solc once && touch test/your_ns/*-test.cljs

thheller07:07:42

that is probably the easiest thing

thheller07:07:57

touch will cause the compiler to trigger a recompile, which will then trigger re-running the tests.

thheller07:07:45

but that probably doesn't work when you use lein solc auto

kwladyka07:07:48

no way to add directory to watch in shadow-cljs?

thheller07:07:28

there are plenty of options. they are all just a lot more complicated than the above

kwladyka07:07:55

but this above wouldn’t work for me in easy way too

thheller08:07:04

are the .abi files actually consumed via some macro or such or are they just loaded via the node fs package?

kwladyka08:07:47

hmm or maybe this .abi and .bin files are needed to update in blockchain, not in js… not sure, I am doing it first time. However I need: 1) detect change in directory and run code 2) re-run tests after files changed / blockchain update <- this one I have to check to be sure

thheller08:07:28

I'm asking because its important to know if you actually need to recompile the code or just re-run the test

kwladyka08:07:17

hmm and actually I am not using project.clj here, so I am not sure about lein solc. I am trying to move solution into shadow-cljs from standard lein cljs compiler

kwladyka08:07:57

I have to re-compile .sol files, not .cljs files.

thheller08:07:10

lein solc just seems to shell out to solc so you don't seem to gain much from it

thheller08:07:44

so if you just run the tests that will use the updated .sol files?

kwladyka08:07:06

ok, once again:

kwladyka08:07:31

1) when change .sol files I have to re-compile them to .abi and .bin files. <- this one for sure 2) when step 1) finish I have to update blockchain and I think use this files in javascript module too <- not 100% sure. cljs files don’t need to be re-compile. 3) re-run tests

thheller08:07:31

so you can shadow-cljs compile tests once (no watch). update the .sol files and compile those

thheller08:07:52

then run node out/the-tests.js without recompiling the CLJS

thheller08:07:00

and it will use the newer contract files?

kwladyka08:07:46

but while develop .sol code I will have to write tests in cljs to check them. So I have to use fresh tests.

thheller08:07:12

yes but please figure out my question first

thheller08:07:23

the recommendation on what to do then varies greatly on the answer

kwladyka08:07:46

I don’t need to compile cljs files after change .sol files. But I will edit .sol and .cljs files step by step

thheller08:07:24

yes. I'm just trying to be sure that you do not need to recompile the CLJS when you edit .sol files

thheller08:07:32

so they do not need to coordinate at all

kwladyka08:07:48

yes, compiled .sol files are used at runtime, not during compilation

kwladyka08:07:39

but maybe I need third party solution to watch .sol files and run shell command then. Maybe it is not something to do in shadow-cljs

thheller08:07:46

ok. then I would recommend using chokidar. disable :autorun in the shadow-cljs build config. then let chokidar watch the :output-to file and in addition to that the .sol files.

thheller08:07:57

and then trigger running the tests if either change

kwladyka08:07:30

thanks, I didn’t use it. I will check it.

thheller08:07:47

since you are going to need something to run watch the .sol files anyways

thheller08:07:51

that seems like the best option

kwladyka08:07:26

because there is no option in shadow-cljs to watch directory and then do something while I am doing shadow-cljs watch ...?

thheller08:07:28

you can also use the https://www.npmjs.com/package/chokidar directly and create a small watch.js

kwladyka08:07:00

Oh so Can I use it not directly?

kwladyka08:07:30

oh by directly you mean js code

thheller08:07:44

@kwladyka you can use shadow-cljs to watch the directory and make it do all of it BUT that is not documented at all and a little more complex than just using chokidar

thheller08:07:59

yes, directly in some js code

thheller08:07:23

the problem with doing it in shadow-cljs is that you must be very careful of not leaking data. ie. watching a file and then not closing it

thheller08:07:38

you don't really have to deal with that when you just a node process that you can kill at any time

thheller08:07:50

killing shadow-cljs sucks because of its startup time

kwladyka08:07:52

ok, doing this in third party solutions sounds ok

kwladyka08:07:08

so I will compile .sol files with chokdiar. It will detect changes in files and run commands for me. But how to tell shadow-cljs watch tests to re-run? by touch?

thheller08:07:57

I'm assuming that is :target :node-test?

kwladyka08:07:41

at that moment yes, but later probably I will move to Karma

kwladyka08:07:33

difficult to say at that moment

thheller08:07:54

well can't comment on the karma part but for :node-test I would recommend simply dropping :autorun true from your build config and letting your chokidar thing run the tests whenever either the .sol files change or the :output-to changes

kwladyka08:07:59

maybe I could stay with node-test

thheller08:07:16

ie. shadow-cljs watch tests just watches and compiles the .cljs files but does not run the tests

thheller08:07:42

you then just call node out/the-tests.js to run them

kwladyka08:07:45

just not run shadow-cljs watch tests, use only chokidar

thheller08:07:23

> ie. shadow-cljs watch tests just watches and compiles the .cljs files but does not run the tests

kwladyka08:07:53

ok I understand now

thheller08:07:33

basically you'll have the shadow-process procress runnning and doing its thing

thheller08:07:47

and then the chokidar thing running independently

chrisetheridge08:07:52

does this error look familiar to anyone? running shadow-cljs watch from the CLI works, but using the library i get this exception

chrisetheridge08:07:59

i have a feeling its something to do with dependencies clashing

thheller08:07:06

@biscuitpants yes. incompatible closure compiler version

thheller08:07:42

using lein?

chrisetheridge08:07:52

yes to start the process

thheller08:07:25

then make sure you have the correct CLJS 1.10.339 and no manual closure-compiler-unshaded depdencency

thheller08:07:43

check lein deps :tree it'll probably show a conflict somewhere

chrisetheridge08:07:10

thank you! that was it. i’ve got another problem with Transit, but that’s the same issue 🙂

thheller08:07:35

core.async is another one to watch out for

chrisetheridge08:07:13

i fixed that one yesterday actually (big thanks to shadow too)

chrisetheridge08:07:31

with figwheel we just could not get a cljs repl to work. always a problem about cljs.core.async.macros

chrisetheridge08:07:38

using shadow and the repl works with no problem

chrisetheridge08:07:43

seriously happy man ❤️

👍 4
kwladyka09:07:49

@thheller You help everybody all the time. When do you work? Are you a robot? 🙂

chrisetheridge09:07:51

is it possible to start a repl from the library, without stdin then waiting for input?

chrisetheridge09:07:04

@kwladyka i’m pretty sure he doesn’t sleep haha

kwladyka09:07:28

maybe he has secret twin 😉

thheller09:07:49

hehe. unfortunately not a robot 😉 and no twin

thheller09:07:15

work currently consists of rewriting 3 year old CSS+HTML

thheller09:07:26

so I'm happy about every excuse not to do that 😉

kwladyka09:07:23

haha I just see this joke in that context > How long will take to rewrite 3 years old CSS + HTML 3 years

thheller09:07:25

@biscuitpants what do you mean? non-nrepl repl?

thheller09:07:07

hehe if I had to do this for 3 years out probably jump out of a window or so 🙂

chrisetheridge09:07:33

so when i do shadow/repl :app my repl process expects input and hangs until i give input

thheller09:07:01

but isn't that the point of a REPL?

chrisetheridge09:07:02

this is from running a lein repl and then using the api to setup my builds and CLJS repl

thheller09:07:01

ah right you probably need to add the nrepl middleware

kwladyka09:07:15

Can you tell a little your personal story how did you start shadow-cljs, how did you get money to not work in that time etc. You did so good job. I am curious your story how did you achieve it having life in the same time (this is my assumption :P).

thheller09:07:46

@kwladyka I started using CLJS about 5 years ago. the tools sucked so I started building my own. so I built it mostly on weekends over 5 years and used it for my projects.

chrisetheridge09:07:54

ah thank @thheller - just saw that now 🙂 i see the server starts an nREPL automatically too

kwladyka09:07:59

oh man you live in Germany, so close to me

kwladyka09:07:12

Definitely I have to buy you a bear one day

thheller09:07:40

haven't got any money to work on shadow-cljs yet. took some time off work last year to work and docs and such

thheller09:07:35

thinking about doing this a bit more seriously in the future. there is so much more I want to do but just can't justify doing

thheller09:07:30

seriously wish I didn't have to do these annoying work projects anymore. they pay well but totally suck. 😛

kwladyka09:07:39

oh you definitely deserve for funds

kwladyka09:07:22

yeah, probably everybody wish to use native solutions

kwladyka09:07:41

But it wouldn’t happen soon

chrisetheridge09:07:25

when i do shadow/nrepl-select :build i get Can't change/establish root binding of: *nrepl-cljs* with set

thheller09:07:22

that probably means that the middleware isn't loaded

chrisetheridge09:07:22

oh i see. it looks like i need to set up the nrepl middleware?

nha09:07:59

Maybe you could apply to the clojurists together? https://www.clojuriststogether.org/

kwladyka09:07:50

I will vote for you 🙂

thheller09:07:12

I did apply

thheller09:07:25

starts next week so who knows 😉

😁 16
👍 12
kwladyka09:07:24

let us know if we can do something for you to make it happen 🙂

eoliphant10:07:28

thanks @thheller You mean this from the guide?

:js-options
   {:resolve {"d3" {:target :npm
                    :require "d3/build/d3.js"}}}
And the code I posted was perhaps a bad example it’s from a sample page, I’m mainly after the components, thought they certainly also have the style imports.. Here’s an example from their custom button
import React from "react";
// nodejs library that concatenates classes
import classNames from "classnames";
// nodejs library to set properties for components
import PropTypes from "prop-types";

// material-ui components
import withStyles from "@material-ui/core/styles/withStyles";
import Button from "@material-ui/core/Button";

import buttonStyle from "assets/jss/material-dashboard-pro-react/components/buttonStyle.jsx";
So to your point, I’d build this to say my-mui-lib.js Then do something like the following? But isn’t the :require going to look in node_modules?
:js-options
   {:resolve {"my-mui-lib" {:target :npm
                    :require "my-mui-lib.js"}}}

eoliphant10:07:48

They should really just adopt/merge/whatever shadow into cljsbuild 🙂

thheller10:07:28

eek why would you want that 😉

thheller10:07:45

how do you build the JS only currently

thheller10:07:51

and how do you want to integrate CLJS into that?

thheller10:07:09

or rather what is more code. the CLJS part of the JS part?

eoliphant10:07:31

ah I’m building a CLJS app

eoliphant10:07:45

i just have this lib of MUI extensions I want to use

thheller10:07:49

:resolve is not the option you are looking for

eoliphant10:07:36

gotcha, i didn’t see the :target :npm-module you mentioned in the guide

eoliphant10:07:44

thoguht that was it

eoliphant10:07:58

ah duh, searced for both keywords together lol

thheller10:07:01

but your app is primarily CLJS and you just have some library which is JS?

thheller10:07:19

and that library is not available on npm?

eoliphant10:07:25

using MUI, want to add these nicer components

eoliphant10:07:14

these components aren’t free

thheller10:07:03

trying to get a sense of what the code looks like

bbss10:07:22

@eoliphant I'm using material-ui with shadow-cljs. I'm re-using some of the experiments done by @thheller earlier.

eoliphant10:07:17

just uploaded a screen shot of the layout.. which you apparently cant see because we’re on the free plan lol

bbss10:07:58

@eoliphant we can still see it, confusing slack message is confusing

eoliphant10:07:24

ok @bbss so you had to do this to core

eoliphant10:07:30

lol, ok cool

bbss11:07:33

This is by no means the "correct way". Meaning I haven't tested it with advanced compilation, and it might import everything so no tree shaking.

eoliphant11:07:46

so, I really just need the components

bbss11:07:51

But in case you were looking at how to hack it together. It works fairly well.

eoliphant11:07:24

the js build ecosystem is quite literally a nightmare lol

bbss11:07:02

Yeah, and shadow-cljs helps a ton 🙂 I really hope shadow-cljs get the clojurists together help.

👍 4
thheller11:07:47

@eoliphant that library is an absolute nightmare

thheller11:07:04

only looking at the free version but I assume the pro version isn't much better

thheller11:07:39

but it should work if you just put it into one directory

thheller11:07:09

and run babel on it

thheller11:07:12

testing something with the free package

eoliphant11:07:12

ok, so yes based on @lee.justin.m’s advice, I did the babel thing

eoliphant11:07:34

so say the header of the button component I posted earler

eoliphant11:07:22

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

import React from "react";
// nodejs library that concatenates classes
import classNames from "classnames";
// nodejs library to set properties for components
import PropTypes from "prop-types";

// material-ui components
import withStyles from "@material-ui/core/styles/withStyles";
import Button from "@material-ui/core/Button";

import buttonStyle from "assets/jss/material-dashboard-pro-react/components/buttonStyle.jsx";

thheller11:07:23

always fun when a simple npm install takes several minutes to complete ...

thheller11:07:08

Done in 166.89s.

eoliphant11:07:53

whereas the example compoents obvioully still have css, etc imports

// creates a beautiful scrollbar
import PerfectScrollbar from "perfect-scrollbar";
import "perfect-scrollbar/css/perfect-scrollbar.css";

// @material-ui/core components
import withStyles from "@material-ui/core/styles/withStyles";

// core components
import Header from "components/Header/Header.jsx";
import Footer from "components/Footer/Footer.jsx";
import Sidebar from "components/Sidebar/Sidebar.jsx";

import dashboardRoutes from "routes/dashboard.jsx";

import appStyle from "assets/jss/material-dashboard-pro-react/layouts/dashboardStyle.jsx";

import image from "assets/img/sidebar-2.jpg";
import logo from "assets/img/logo-white.svg";

thheller11:07:54

the problem is import buttonStyle from "assets/jss/material-dashboard-pro-react/components/buttonStyle.jsx";

eoliphant11:07:25

that’s a jss or whatever file

thheller11:07:02

yeah that should be relative paths

thheller11:07:47

trying to figure out if there is a babel plugin to override that

eoliphant11:07:14

now if I do the ‘src/gen’ dir per your .jsx example, and all that stuff is in there

eoliphant11:07:45

wouldn’t the buttonStyle resolve? ah wait, no.. because it’s not .js

thheller11:07:12

no imports without a / or ./ in front will resolve to node_modules

thheller11:07:15

not the classpath

eoliphant11:07:16

and conversely, if i just say do the full webpack build

thheller11:07:12

yeah thats probably the easier option

eoliphant11:07:55

ok, but in that case, wasn’t sure how I’d require a given component. I say stick ‘irritating-mui-lib.js’ in my src. and I want to do the equivalent of (require ["components/CustomButton/Button" :default Button]) if this was working normally

thheller11:07:18

thats not a problem since webpack will then resolve the components

thheller11:07:31

it just won't work in the REPL at all

eoliphant11:07:14

ok, but in my cljs code, that require above would work?

thheller11:07:48

when using the webpack stuff yes

thheller11:07:07

well assuming of course you have webpack configured correct and stuff

thheller11:07:23

its an absolute mess

eoliphant11:07:40

and the .js should be just included in the .html, as opposed to trying to (require [“irritating.js”….])

eoliphant11:07:53

yeah I’m going to assume that at least

eoliphant11:07:12

their webpack build is functional

thheller11:07:28

theirs yes but also when you use it as a library?

eoliphant11:07:08

yeah again, this is where i’m getting a headache. lol. They’re using the stock create-react-app stuff. So that build creating an ‘app’ that’s probably had its tree shaken lol, etc.

thheller11:07:17

if only I didn't have to wait 2mins to install that shit

eoliphant11:07:36

so conceivably, it might not even have all of the components

thheller11:07:39

so they basically just dumped their shit into a basic boilerplate

eoliphant11:07:44

i’m guessing

thheller11:07:45

instead of making it a proper clean library 😛

eoliphant11:07:59

that you’re supposed to just drop these in your source treee

eoliphant11:07:25

which is mega, mega irritating

eoliphant11:07:38

seems like they should have a component

eoliphant11:07:54

distro and an examples distro that uses it

thheller11:07:18

npm is such a shit show sometimes

thheller11:07:46

why the heck does it take 166sec to install a single package

thheller11:07:56

and then that package is empty for some reason?

thheller11:07:54

guess the plugin is just broken

thheller11:07:24

onto the next then

thheller11:07:46

meh also doesn't work

thheller11:07:08

it works now?

eoliphant11:07:48

Haven't tried heading to the office going to give it a shot when i get in

eoliphant11:07:18

But yeah as i think about it

thheller11:07:51

ok I think I got it working

thheller11:07:09

absolute nightmare but working

thheller11:07:31

I'll see if I can setup a demo repo

eoliphant11:07:10

The tree shaking is most likely a problem

thheller11:07:46

I'm somehow doubtful that it works properly in webpack?

eoliphant11:07:02

So the import path fixer upper should do the thing for the paths.?

eoliphant11:07:39

Well as far as that goes. The demo or whatever runs fine.

thheller11:07:40

yeah its rewritten to var _cardStyle = require("../../assets/jss/material-dashboard-react/components/cardStyle"); for me

thheller11:07:24

npx babel src -d ../src/gen/material-dashboard-react

thheller11:07:53

assuming the stuff is cloned into <project>/some-dir running the babel in some-dir

thheller11:07:17

in CLJS then (:require ["/material-dashboard-react/components/whatever/andSoOn" :as x])

thheller11:07:19

just need to manually add all the proper npm dependencies

eoliphant11:07:21

Ok ok. That's great. But will still need something to strip out the css, etc refs like webpack does right?

thheller11:07:49

not sure. which one is used?

eoliphant11:07:58

Yeah. I already copied all their deps into my package.json

thheller11:07:56

hmm but its only the dasboard component doing this I think

thheller11:07:08

but yeah that won't work

eoliphant11:07:57

To handle the css? Whatever the more or less default webpack hander is i guess.

thheller11:07:37

well the css is just ignored

thheller11:07:45

problem is the image imports

thheller11:07:51

since they are supposed to return something

thheller11:07:58

and shadow-cljs would just return nil

thheller12:07:11

import image from "assets/img/sidebar-2.jpg";

thheller12:07:17

is supposed to return the path to that image

thheller12:07:24

but it will be nil

eoliphant12:07:40

Having said that it looks like the components are largely using jss

thheller12:07:26

well you should really try :npm-module I guess

thheller12:07:50

it won't be fun but probably easier than trying to get all the webpack specific stuff out

thheller12:07:43

basically you let the mui stuff alone

eoliphant12:07:46

Fortunately i think most of the image refs are in the examples, not the components. But will need to verify

thheller12:07:09

meh .. no time to finish this. I'll probably take a look later

thheller12:07:16

there has to be some solution to this mess

eoliphant12:07:19

Ok ill read up on it when i get in

eoliphant12:07:32

Thanks for the help. ;)

kwladyka14:07:46

https://clojurians.slack.com/archives/C6N245JGG/p1532689094000283 hmm so you read the file as a text and parse it to generate cljs ? @bbss

kwladyka14:07:44

BTW wow StarCraft II API in cljs nice 🙂

👍 12
😄 8
eoliphant14:07:12

Ok, yeah I was so busy reading over the code, totally missed that.. super cool

eoliphant14:07:02

So, @thheller, when you’re back around, I read over the :npm_module target. If I’m understanding this correctly it allows me to call my cljs code from js, and plays nicely with a webpack, etc toolchain. But am I correct in that I wont be able to grab say these components in my CLJS code?

bbss16:07:01

@kwladyka I run the clojure file which checks the dirs in node_modules and filters some dirs to get the names of what the material-ui exports. Write that to the cljs file which can then be used by other cljs.

kwladyka06:07:33

But you parse the code, not use cljs to “read” the code. Parse string, not load the code to read something from namespace etc.

kwladyka06:07:04

I am asking because I wanted do something similar for material-ui too before

kwladyka06:07:57

But is sounds too complex and hard, so I resigned and I am using material-ui as normal node_module require

lilactown16:07:39

is there a way to get source maps in node.js release builds?

lilactown17:07:28

I'm having serious issues with doing a release build rn after upgrading

thheller17:07:19

shadow-cljs relaease your-build --source-maps or :compiler-options {:source-map true}

lilactown17:07:50

they don't show in the stack trace when my app fails 😕

thheller17:07:21

you might need to manually load the source-map package

thheller17:07:31

node -r source-map your-script.js might do it

thheller17:07:35

node -r source-map-support/register compiled.js

thheller17:07:46

like that I guess

lilactown17:07:11

@thheller with shadow-cljs 2.4.24 I'm getting this error using a release build with :node-script

TypeError: (intermediate value)(intermediate value)(intermediate value).Dg is not a function
    at a8 (/Users/r627543/Code/fido/packages/web/app/target/out/server.js:1694:329)
    at lh (/Users/r627543/Code/fido/packages/web/app/target/out/server.js:1710:27)
    at jh (/Users/r627543/Code/fido/packages/web/app/target/out/server.js:249:291)
    at Function.<anonymous> (/Users/r627543/Code/fido/packages/web/app/target/out/server.js:1712:156)
    at Function.y.b (/Users/r627543/Code/fido/packages/web/app/target/out/server.js:212:112)
    at /Users/r627543/Code/fido/packages/web/app/target/out/server.js:1711:103
    at Object.<anonymous> (/Users/r627543/Code/fido/packages/web/app/target/out/server.js:1713:3)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Function.Module.runMain (module.js:684:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

lilactown17:07:55

reverting back to 2.4.0 fixes. zeroing in on the version that introduced it...

thheller18:07:21

@lilactown that commit made :advanced the default and the above error is most likely externs

thheller18:07:32

do you have :infer-externs :auto set?

thheller18:07:41

no warnings?

thheller18:07:09

try running shadow-cljs release your-build --pseudo-names to figure out what .Dg is

thheller18:07:22

or set :compiler-options {:optimizations :simple}

lilactown18:07:40

TypeError: (intermediate value)(intermediate value)(intermediate value).$createServer$ is not a function
    at $macchiato$server$start$$ (/Users/r627543/Code/fido/packages/web/app/target/out/server.js:33718:362)

lilactown18:07:52

changing to :simple gives me:

Users/r627543/Code/fido/packages/web/app/target/out/server.js:22985
        return $keyword_fn$$.cljs$core$IFn$_invoke$arity$1 ? $keyword_fn$$.cljs$core$IFn$_invoke$arity$1($x$$) : $keyword_fn$$.call(null, $x$$);
                             ^

TypeError: Cannot read property 'cljs$core$IFn$_invoke$arity$1' of undefined
    at $cljs$core$thisfn$$ (/Users/r627543/Code/fido/packages/web/app/target/out/server.js:22985:30)
    at Function.cljs.core.key__GT_js.cljs$core$IFn$_invoke$arity$2 (/Users/r627543/Code/fido/packages/web/app/target/out/server.js:22957:19)
    at /Users/r627543/Code/fido/packages/web/app/target/out/server.js:22974:35
    at $cljs$core$thisfn$$ (/Users/r627543/Code/fido/packages/web/app/target/out/server.js:23003:465)
    at Function.cljs.core.clj__GT_js.cljs$core$IFn$_invoke$arity$variadic (/Users/r627543/Code/fido/packages/web/app/target/out/server.js:23032:10)
    at cljs.core.clj__GT_js (/Users/r627543/Code/fido/packages/web/app/target/out/server.js:22969:31)
    at /Users/r627543/Code/fido/packages/web/app/target/out/server.js:14078:104
    at /Users/r627543/Code/fido/packages/web/app/target/out/server.js:14079:8
    at cljs.core.LazySeq.sval (/Users/r627543/Code/fido/packages/web/app/target/out/server.js:10219:122)
    at cljs.core.LazySeq.cljs$core$ISeqable$_seq$arity$1 (/Users/r627543/Code/fido/packages/web/app/target/out/server.js:10295:8)

lilactown18:07:45

:whitespace

/Users/r627543/Code/fido/packages/web/app/target/out/server.js:1016
goog.debug.Error = function(opt_msg) {
                 ^

TypeError: Cannot set property 'Error' of undefined
    at /Users/r627543/Code/fido/packages/web/app/target/out/server.js:1016:18
    at Object.<anonymous> (/Users/r627543/Code/fido/packages/web/app/target/out/server.js:118841:3)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
    at startup (internal/bootstrap/node.js:201:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)

lilactown18:07:39

I'm wondering if this is a weird interaction with :reader-features

lilactown18:07:25

okay, apparently I needed to restart my shadow-cljs server because now :simple is working

thheller19:07:40

@lilactown :whitespace is not compatible with node. the :simple error was actually an :advanced build with pseudo names active

eoliphant23:07:38

hey @thheller i looked at that :npm_module stuff, but I’m not quite grokking how that’s would work. Would I be be able to ref stuff from the react libs in my cljs code?

Schpaa23:07:07

this is from the manual, but is it true?