Fork me on GitHub
#shadow-cljs
<
2019-06-09
>
thheller07:06:30

@tony.kay yeah macros with dependencies aren't tracked properly currently. see https://github.com/thheller/shadow-cljs/issues/495

4
tony.kay16:06:26

Got it, thanks. It isn’t that bad to have to put them in the same ns.

thheller07:06:30

if a restart doesn't fix it you might have some AOT compiled code on the classpath

thheller07:06:50

otherwise you currently only can reload the macro related things via the REPL

pez10:06:37

Hello. I am switching to bundling the Calva vscode extension using Webpack (from not really bundling it at all). It works fine for production builds, but I get WARNINGS when the cljs is compiled by the dev watcher:

WARNING in ./cljs-out/cljs-lib.js 70:56-63
    Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
     @ ./calva/nrepl/jack-in.ts
     @ ./calva/extension.ts
(`jack-in.ts`) is the first place where the cljs-lib is imported) Then the extension fails to load with the following message:
Activating extension 'betterthantomorrow.calva' failed: ENOENT: no such file or directory, open '/.shadow-cljs/builds/calva-lib/dev/out/cljs-runtime/goog.debug.error.js'.
I’m a bit stumped on what could be going on here. Anyone else with an idea?

pez11:06:19

So, I get that warning, and the crash, when running anything else but shadow-cljs release, (e.g. compile or watch). With release things are dandy.

pez11:06:09

The only mention of Webpack in the user manual is with the :npm-module target. But that has proven not to work for Calva builds. (Or, at least, didn’t work last time I tried it.)

thheller11:06:46

@pez if you use webpack you need :npm-module. no other way around it

pez11:06:49

OK. Let’s hope I can use it this time then. 😃

pez11:06:31

What are my other options? I am not wed to Webpack. Maybe I can use shadow for bundling?

Trevor17:06:04

Hi folks, what's the proper way to include a React component from Material-UI in a way that works in Cursive? I'm trying to load this file into the REPL

(ns app.common.CenteredContainer
  (:require
    [reagent.core :as r]
    ["@material-ui/core/Grid" :default Grid]
    ))

(defn centered-container
  [props & children]
  [:> Grid (merge {:container  true
                   :spacing    0
                   :direction  "column"
                   :alignItems "center"
                   :justify    "center"
                   :style      {:minHeight "80vh"}} props)
   children])

(def CenteredContainer (r/reactify-component centered-container))
And I get this error in the Cursive CLJS REPL:
Syntax error macroexpanding clojure.core/ns at (CenteredContainer.cljs:1:1).
((:require [reagent.core :as r] ["@material-ui/core/Grid" :default Grid])) - failed: Extra input spec: :clojure.core.specs.alpha/ns-form
When I remove the Material-UI require, I can then send forms to the REPL just fine, but if I have it, I get the above error. Using VS Code Calva I can interact with the in-editor REPL just fine. Maybe this is a question for #cursive ? Thought I'd try here though since it sounds like this might be specific to Shadow CLJS? Thanks!