Fork me on GitHub
#clojurescript
<
2019-10-28
>
Shi Yan02:10:20

Hello, I need some help on self-hosting with webpack. I'm making an online editor for ClojureScript using the cljs/compile-str function. The code totally works if I use it with the <script> tag. But my project is mainly a webpack js project. If I import my ClojureScript using import, the compile-str function will fail with the following:

{:error
 #error {:message "Could not compile ", :data {:tag :cljs/analysis-error}, :cause #error {:message "Cannot read property 'findInternedVar' of null at line 1 ", :data {:file nil, :line 1, :column 1, :tag :cljs/analysis-error}, :cause #object[TypeError TypeError: Cannot read property 'findInternedVar' of null]}}}
Meanwhile, webpack has this error message:
WARNING in ./clojurescript/out/main.js 2660:154-228
Critical dependency: the request of a dependency is an expression
I suspect webpack altered the code. Any tips?

Anik Chowhdury09:10:57

How to make chrome extension using clojurescript? can anyone give me some guidelines about that?

darwin10:10:28

but you don’t have to use this library, people were successful building chrome extensions with raw clojurescript js interop as well

aisamu11:10:35

but it's worth saying @U08E3BBST’s chromex is an absolute joy to use (we use it in anger)

4
bcaccinolo12:10:51

Anyone has some clojurescript code using Puppeteer as an example ?

herald13:10:47

kitchen-async makes it much more weildy

Filipe Silva13:10:12

I found taiko has a nicer API for use with cljs

Filipe Silva13:10:14

it's still just using puppeteer, but has some nice helpers that work well with deftest/is

Filipe Silva13:10:02

and doesn't require you to initialize the page and browser separately, which reduces the need to use kitchen-async (although it's still pretty nice to have it anyway)

herald13:10:19

Taiko looks great! I haven't heard of it.

Filipe Silva13:10:45

yeah I only heard of it a month or so ago

Filipe Silva13:10:10

I think it's pretty handy for the cases where you already have a decent test runner and are just missing the browser control

Filipe Silva13:10:36

the taiko people have a test runner as well called gauge but I don't think it's necessary with deftest

herald13:10:49

Thanks for sharing the code snippet. Looks like exactly what I needed for a work project [=

bcaccinolo15:10:12

taiko looks great. thx @UJVKWJTGE

👍 4