cljsjs

asolovyov 2016-03-14T13:36:33.000024Z

@juhoteperi: are there any tools to deal with packages which do var React = require('react');?

juhoteperi 2016-03-14T13:38:04.000025Z

I think in most cases such packages can be compiled using browserify or such to "normal" JS

juhoteperi 2016-03-14T13:38:21.000026Z

Usually packages provide some kind of build task to build browser compatible files

juhoteperi 2016-03-14T13:40:38.000027Z

Also, ClojureScript has some support for converting CommonJS modules to Closure modules, but I don't know if that is yet usable and what would that require from other packages

asolovyov 2016-03-14T13:40:49.000028Z

yeah, I'm not sure how to enable it...

asolovyov 2016-03-14T13:41:00.000029Z

this react-input-mask has 'require' inside of a build file 😞

juhoteperi 2016-03-14T13:41:09.000030Z

:module-type :commonjs on deps.cljs

juhoteperi 2016-03-14T13:41:30.000031Z

But I don't know how it is supposed to map require calls to closure modules

asolovyov 2016-03-14T13:42:30.000032Z

hm, I should try doing this somehow maybe...

juhoteperi 2016-03-14T13:43:26.000033Z

Looks like react-input-mask only uses babel to compile ES6 to ES5 CommonJS module

juhoteperi 2016-03-14T13:44:32.000034Z

A simple fix might be to remove the line with require call, React should already be available globally when you have :requires ["cljsjs.react"] on deps.cljs

asolovyov 2016-03-14T13:45:15.000035Z

"remove the line" you mean just read the file, skip the line, write it back?

juhoteperi 2016-03-14T13:45:49.000036Z

Something like it. Some package tasks are using regex to replace some parts of files.

asolovyov 2016-03-14T13:45:56.000037Z

cool, thanks

asolovyov 2016-03-14T13:46:29.000038Z

ah, replace-content, I see

juhoteperi 2016-03-14T13:46:50.000039Z

Yeah it's provided by boot-cljsjs

asolovyov 2016-03-14T13:56:53.000041Z

@juhoteperi: sorry for submitting previous takes, I should've checked better 😮