@hlolli add it here https://github.com/anmonteiro/lumo/blob/master/src/js/cljs.js#L124
@hlolli does goog/global.setTimeout
work?
@pesterhazy I remember seeing that it didn't work either. I'm compiling a release binary now at the moment and will quickly find out if this is only a problem with the dev build or not.
Hello friends, I struggle to make puppeteer
working with lumo
To make puppeteer work, you need to inject javascript into browser context where offcourse browser knows nothing about cljs
Maybe one way would be to inject cljs into every page but I am wondering if there is a way to compile in my code cljs to make it work
here is the function that needs it https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pageselector
Have you tried building your code with lumo.build.api
?
nope I should do that, not cool for REPL experience though but I think I don’t have a choice
no I guess you'd only do it when you'd be makeing releases, you can do autobuild as well tough.
hummm
but from the repl ?!
I am using tubular
with cursive
No not from the repl, you want to do something like cljs string to js string in the repl in runtime?
would be good for dev ^^
There are some tricks where you give the compiler empty environment, I forgot how that command was. But I don't see a good way to get good dev experience in your case useing cljs. Maybe figwheel or something could work with this headless browser.
It's still on my todo list to compile with lumo build to stream instead of file implicitly. But I still can't see how that would work in non-advenced compilation as we always end with many files that need to be placed in according folders.
ok, no worries, I’ll try building the js instead
Doh. I simply have to add -K
flag when running REPL and :reload-all
s become almost immediate. Somehow I thought that -K
only helps when loading code from files.
I'd love to see more intro documentation about Lumo: - Syntax for requiring NodeJS modules - Syntax for invoking function imported from NodeJS - Tutorial on adding NPM modules to Lumo app I eventually worked out most of these, and technically it's in the ClojureScript documentation, but it would be nice if it was all laid out in one place.
@hlolli for information, it’s working really well by using the .addScriptTag
of pupeteer and adding cljs with klipse
*klipse cdn
even if I could compile it myself, I was just lazy ^^
@hlship I think the best place would be the wiki
or a proper readthedocs
page...unfortunately I don't have the time for bootstrapping that at the moment, but can contribute once it is going
@hlship agreed. A documentation website is on the roadmap but I have been busy
I'm good with readthedocs
, I've used it successfully for several projects. Easy. I may have time to put together a PR on Friday.
nice, hope it works for you. Can imagine dev and production to differ somewhat, but doesnt have to be.