Fork me on GitHub
#shadow-cljs
<
2022-10-06
>
Hukka12:10:09

Hmh. Seems like shadow 2.19.9 (i.e. 2.19.8 still works) stopped redirecting to index.html when going to localhost:8000, as configured for the dev server, if proxy-url is also configured. Nothing jumps to my eyes from the changelog, but have to bisect the commits then.

Hukka12:10:23

I suppose the bump to undertow could do it? But I can't even see version 0.3.0 at https://github.com/thheller/shadow-undertow

thheller17:10:53

it has never redirect anywhere?

thheller17:10:30

:proxy-url always tries to load from proxies for files that don't exist?

Hukka19:10:54

The special case of checking for index.html when client is getting just the directory is still working, as long as proxy-url isn't defined and up to 2.19.8, even when it is

thheller19:10:32

(forgot to push the changes to the github repo)

thheller19:10:04

so :use-index-files true should work, :dev-http {3000 {:root "public" :use-index-files true :proxy-url ...}} that is

Hukka19:10:00

Hm, no difference with 2.19.9

Chris McCormick13:10:10

Hello, I am seeing an error when trying to consume https://ffmpegwasm.netlify.app/ in a front-end build:

Closure compilation failed with 4 errors
--- node_modules/@ffmpeg/ffmpeg/src/browser/defaultOptions.js:17
This code cannot be transpiled. import.meta. Use --chunk_output_type=ES_MODULES to allow passthrough support.
--- node_modules/@ffmpeg/ffmpeg/src/browser/fetchFile.js:43
This code cannot be transpiled. import.meta. Use --chunk_output_type=ES_MODULES to allow passthrough support.
--- node_modules/@ffmpeg/ffmpeg/src/browser/getCreateFFmpegCore.js:44
This code cannot be transpiled. import.meta. Use --chunk_output_type=ES_MODULES to allow passthrough support.
--- node_modules/@ffmpeg/ffmpeg/src/browser/getCreateFFmpegCore.js:80
This code cannot be transpiled. import.meta. Use --chunk_output_type=ES_MODULES to allow passthrough support.
I tried tinkering with :output-feature-set but it doesn't seem to help.

Chris McCormick13:10:18

Is there a way to set the chunk_output_type flag on the Closure pass?

Chris McCormick14:10:40

I have managed to get around this issue by using the pre-compiled dist artifact instead:

["@ffmpeg/ffmpeg/dist/ffmpeg.min" :refer [createFFmpeg fetchFile]]

thheller16:10:48

there is no setting that would influence this currently. the error message only refers to the google-closure-compiler npm package option, it is not an option in shadow-cljs

👀 1
Ben Lieberman16:10:36

I have this ["react-bootstrap/Card$default" :as card] in my require form and I see the modules being loaded in the console but I can't figure out how to use it correctly. When I call it like a function I get a use of undeclared var warning and nothing else

thheller16:10:02

well you typically don't call a react component as a function?

Ben Lieberman16:10:38

Right, but how does that translation to CLJS get made?

Ben Lieberman16:10:52

I tried this out and I see this logged in the console:

Card {$$typeof: Symbol(react.forward_ref), defaultProps: {…}, Img: {…}, Title: {…}, render: ƒ, …}$$typeof: Symbol(react.forward_ref)Body: {$$typeof: Symbol(react.forward_ref), defaultProps: undefined, render: ƒ}Footer: {$$typeof: Symbol(react.forward_ref), defaultProps: undefined, render: ƒ}Header: {$$typeof: Symbol(react.forward_ref), render: ƒ}Img: {$$typeof: Symbol(react.forward_ref), render: ƒ}ImgOverlay: {$$typeof: Symbol(react.forward_ref), defaultProps: undefined, render: ƒ}Link: {$$typeof: Symbol(react.forward_ref), defaultProps: undefined, render: ƒ}Subtitle: {$$typeof: Symbol(react.forward_ref), defaultProps: undefined, render: ƒ}Text: {$$typeof: Symbol(react.forward_ref), defaultProps: undefined, render: ƒ}Title: {$$typeof: Symbol(react.forward_ref), defaultProps: undefined, render: ƒ}defaultProps: {body: false}render: ({bsPrefix,className,bg,text,border, body,children,as:Component="div",...props},ref)=> {…}displayName: (...)get displayName: ƒ ()arguments: nullcaller: nulllength: 0name: "get"prototype: {constructor: ƒ}[[FunctionLocation]]: react.development.js:1497[[Prototype]]: ƒ ()[[Scopes]]: Scopes[4]set displayName: ƒ (name)[[Prototype]]: Object
so it seems to be imported correctly but I still get those undefined var warnings on invocation.

thheller16:10:38

this is a react component, you do not call it

thheller16:10:44

what do you use? reagent/re-frame? how did you require it now?

Ben Lieberman16:10:17

Reagent. Should I use their create-react-class function here? I tried what the original SO thread showed, i.e.

[:div
[:> Card
[:> Card.Body]]]
etc, but I suspect that's also wrong

Ben Lieberman16:10:55

["react-bootstrap/Card" :as Card]

thheller16:10:27

that should be fine

thheller16:10:52

wait no? what did you do for the log above?

Ben Lieberman16:10:13

(js/console.log "Card" Card)

thheller16:10:50

should be fine then

thheller16:10:57

might be the same issue

👀 1