Fork me on GitHub
#shadow-cljs
<
2020-01-24
>
dpsutton13:01:37

just saw your shadow-cljsjs package. You are insanely awesome @thheller

😎 4
papachan14:01:00

wow didnt knew about this: (shadow/nrepl-select :app) selecting app directly from repl

kszabo14:01:00

yeah, it’s really powerful that you have the full API as fn calls at runtime

4
👍 4
Filipe Silva16:01:35

@thheller was attempting to update the codebase I had again

Filipe Silva16:01:01

I had a case with multi-modules there a lazy module failed to load unless I set :output-wrapper false when updating shadow-cljs from 2.8.67 to 2.8.68 (this release included a commit saying "make `:output-wrapper` for multi-module builds as well")

Filipe Silva16:01:01

tracing the error I saw that shadow wrapper for a npm dependency would throw when using defineProperty on export

Filipe Silva16:01:26

the debugger shows that the properties were already there

Filipe Silva16:01:50

lemme try to get a screenshot of the debugger...

Filipe Silva16:01:27

the npm package in question is called emoji-mart

Filipe Silva16:01:01

is this worth opening an issue for or is it known to happen?

Filipe Silva16:01:42

in case it's relevant, we import it thus:

(:require
   [reagent.core :as r]
   ["emoji-mart/data/all.json" :as emoji-data]
   ["emoji-mart" :as emoji-mart])

thheller17:01:35

:output-wrapper causing problems is known. dunno about the exports thing, never seen that before

Filipe Silva19:01:53

is it known to cause problems if it's true or false? or both 😄

thheller19:01:20

it is causing problems in some cases since making the default true ... but it is also known to fix other problems since making the default true. Can't win with this JS mess 😛

Filipe Silva20:01:34

I'll add these details in https://github.com/thheller/shadow-cljs/issues/611, it's the closes issue I could find

lilactown17:01:31

there was a blog post a few months ago about i18n I’m looking for. what I’m really looking for is an example of storing global state inside of the analyzer

thheller17:01:30

note that you can only write safely to the namespace that is currently getting compiled

thheller17:01:49

you must never reach into other namespaces or the entire things will fail when caching is involved

lilactown17:01:41

what about reading?

thheller17:01:20

if you require them properly that is fine

thheller18:01:22

so whats a good name for something that sits inbetween the frontend (ui) and backend (server) and handles their interaction?

thheller18:01:10

in my framework thing all non-ui code runs in a webworker but that should be optional. so calling everything worker seems weird 😛

thheller18:01:33

naming stuff is hard. I keep renaming stuff 😛

lilactown18:01:03

controller? feature code? application logic?

orestis19:01:48

Middle something

orestis19:01:08

Inbetweener

orestis19:01:27

(Sorry I’ll shut up now)

Kamuela21:01:27

Should this happen?

➜  new-app npx shadow-cljs node-repl
npx: installed 90 in 2.668s
shadow-cljs - config: /Users/kamuela/Code/new-app/shadow-cljs.edn  cli version: 2.8.83  node: v12.14.1
shadow-cljs - connected to server
cljs.user=> no "source-map-support" (run "npm install source-map-support --save-dev" to get it)
SHADOW import error /Users/kamuela/Code/new-app/.shadow-cljs/builds/node-repl/dev/out/cljs-runtime/shadow.js.shim.module$ws.js
[stdin]:66
    throw e;
    ^

Error: Cannot find module 'ws'
Require stack:
- /Users/kamuela/Code/new-app/[stdin]
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
    at Function.Module._load (internal/modules/cjs/loader.js:686:27)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at /Users/kamuela/Code/new-app/.shadow-cljs/builds/node-repl/dev/out/cljs-runtime/shadow.js.shim.module$ws.js:3:28
    at global.SHADOW_IMPORT ([stdin]:63:44)
    at [stdin]:2258:1
    at [stdin]:2266:3
    at Script.runInThisContext (vm.js:116:20)
    at Object.runInThisContext (vm.js:306:38) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/Users/kamuela/Code/new-app/[stdin]' ]
}

dpsutton21:01:45

npm i shadow-cljs

Kamuela21:01:08

Interesting. Yeah that seemed to do the trick