Fork me on GitHub
#clojurescript
<
2019-06-26
>
scknkkrer10:06:11

I wanted to build a Wrapper around ReactStrap. How do I include ReactStrap’s JS file and ship it with my project ? Is including the closure as a foreign library enough ?

scknkkrer12:06:07

I’m using it actively.

scknkkrer12:06:34

Is it enough to add my dependency to the output ? Or the developer should include it again ?

henryw37410:06:44

Hi everyone, I've got a problem with using clojurescript foreign libs in node that I'd like some advice on. In quite a few cases, js scripts inside foreign-lib/cljsjs libraries to have this umd wrapper that checks the js environment and assigns a global variable, regardless of the current state. Here's an example of what you get with cljsjs/react: https://unpkg.com/[email protected]/umd/react-dom.development.js When running cljs on node, either a script or with repl commands (e.g. clj -m cljs.main -re node -m myscript), the js script is re-run every time you do a foreign lib require, e.g. (require 'cljsjs/react). In the case of cljsjs/react, this means the global js/React variable is reassigned to the result of running the script. This is unlike the behaviour that require has normally unless you do a (require ... :reload) and is different to what you get when running cljs in a browser. Is this a bug, or by design?

thheller11:06:17

foreign-libs are not really meant for node environments so I'd expect that to have all sorts of issues

thheller11:06:48

and especially cljsjs is targeted at the browser

henryw37411:06:32

It's true that if everyone were just targeting node, there'd be no need for foreign-libs and cljsjs. This does leave the question for how to write cljs libs (for node and browser) that depend on npm libraries. I heard npm-deps is deprecated now

tomaas11:06:43

hi, suddenly when start cider cljs in the re-frame template project i get error in process filter: nrepl-send-sync-request: Sync nREPL request timed out (op eval code (require 'figwheel-sidecar.repl)) error in process filter: Sync nREPL request timed out (op eval code (require 'figwheel-sidecar.repl))

Eric Scott11:06:14

Do you have a value set for {:cljsbuild ...{:repl-options {:timeout ...}..} ?

dpsutton11:06:26

@tomaas which template are you using?

tomaas11:06:51

lein new re-frame reframetestproject +cider

dpsutton11:06:05

i ran that, and then in the project.clj file ran C-c M-J (cider-jack-in-clojurescript). It cranked right up for me and http://0.0.0.0:3449/ has the app. Are you sure you ran the clojurescript command?

dpsutton11:06:35

can you look in *Messages* buffer for what command cider used to startup? Mine used /home/dan/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.4.1\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.22.0-beta6\"\] -- repl :headless :host localhost

vemv12:06:06

Since today I started seeing (without updating any dep):

WARNING: no :cljsbuild entry found in project definition.
--------------------------------------------------------------------------------
WARNING: your :cljsbuild configuration is in a deprecated format.  It has been
automatically converted it to the new format, which will be printed below.
It is recommended that you update your :cljsbuild configuration ASAP.
--------------------------------------------------------------------------------
:cljsbuild
{:builds []}
--------------------------------------------------------------------------------
See 
for details on the new format.
--------------------------------------------------------------------------------
The warning is spurious because I do have a :cljsbuild entry in my project.clj, and it's properly filled. Any ideas / familiarity with the issue?

vemv12:06:03

I suspect some transitive dependency was updated (which one cannot immediately see) causing the issue

emil0r12:06:09

Worth it? Lots of pain? More trouble than it’s worth? Alternatives?

lilactown14:06:45

I’ve never used it, but if you’re going to be using lots of 3rd party React components, you might consider using hx: https://github.com/Lokeh/hx/

Nolan17:06:07

How does one interoperate with a javascript library that uses tagged template literals?