Fork me on GitHub
#shadow-cljs
<
2021-11-17
>
Ryan06:11:58

WHat's the right synax for requiring goog.object? is it

(:require     ["goog.object" :as goog.object]) ?
edit: it appears to be simply
(:require [goog.object])

thheller06:11:29

technically (:require [goog.object :as gobj]) as you should always be using aliases IMHO 😛

Ryan07:11:24

Fair point!

Ryan07:11:55

Might this error be related to the goog changes?:

TypeError: Cannot read properties of undefined (reading 'Level')
    at eval (logging.cljc:12)
    at eval (<anonymous>)
    at Object.goog.globalEval (pnx-web.js:488)
    at Object.env.evalLoad (pnx-web.js:1563)

thheller07:11:57

likely, just not the goog.object one but an older one

thheller07:11:35

can't remember what exactly but some class was renamed/moved goog.log.Level or so

martinklepsch15:11:38

We’re still seeing TypeError: (0 , _app._registerComponent) is not a function errors when trying to use Firebase SDK v9 with shadow-cljs 2.16.3 . I think the new cljs compiler was meant to fix some of these issues but we haven’t been able to get things working.

thheller16:11:30

@martinklepsch this is pretty much guaranteed to be a closure compiler issue. without a repro I can't tell. the new cljs release didn't do anything affecting this. the only thing it did was also upgrading the closure compiler version which sometimes fixes things and indeed seems to have fixed some (0, thing) related issues others had. this is not happening in code generated by CLJS, so it'll be guaranteed to be something badly rewritten by :simple in some npm code

martinklepsch17:11:38

Ok, we’ll try to create a repro case then 🙂

Dharmendra17:11:14

Hi, I am trying to resolve one issue which I am currently facing. I am following below steps 1. Created a project using lein new reframe appname +10x. Then I installed mui5(CSS framework) https://mui.com/getting-started/installation/ 2. Then I just modified views.cljs like below

(ns demo.views
  (:require
   ["@mui/material/styles" :refer [ThemeProvider, StyledEngineProvider]]
   ["@sphere/component-library" :refer [themeV2]]
   ["@sphere/component-library/build/components/v3/Dummy/Dummy" :default Dummy]
   ["@mui/material/Button" :default Button]
   ["@mui/material/CssBaseline" :default CssBaseline]))

(defn test-component []
  [:<>
   [:> Button {:variant "contained"} "MUI Button"]
   [:> Dummy]])
   

(defn main-panel []
  [:> StyledEngineProvider {:injectFirst true}
     [:> ThemeProvider {:theme themeV2}
      [:> CssBaseline]
      [test-component]]])
Note: Here ["@sphere/component-library/build/components/v3/Dummy/Dummy" :default Dummy] is a UI library written in JS react and https://mui.com/getting-started/installation/ only used there I am getting below error in screenshots:

Dharmendra17:11:22

If I do the same in create-react-app it works fine without any problem. Here is the code in screenshot:

thheller17:11:40

thats a #reagent question and has nothing to do with shadow-cljs

Dharmendra18:11:13

Yeah, thanks I will ask in reagent channel.

Joshua Smock22:11:19

Is it possible to use :ns-regexp with :target :esm?