Fork me on GitHub
#cljsjs
<
2017-12-04
>
bru16:12:03

hello hello. I was looking into updating the cljsjs package for slate. Problem: the project now is split into several internal packages (see https://github.com/ianstormtaylor/slate/tree/master/packages). What is the idiomatic way of handling that case (if there is one)?

bru16:12:16

to expand: shall I provide several externs file in the same package (would that even work?) or create multiple packages… judging by the treatment of the babel packages I’d say the latter

olegakbarov20:12:16

Did anyone had issues with react-select (or classnames) package? I got some trouble described here: https://github.com/cljsjs/packages/issues/1418

mikerod20:12:56

@olegakbarov When I do a lein deps :tree with cljsjs/react-select as a dep, I get:

[cljsjs/react-select "1.0.0-rc.10-1"]
     [cljsjs/classnames "2.2.3-0"]
     [cljsjs/react-input-autosize "2.0.0-1"]

mikerod20:12:03

Which version are you referring to?

mikerod20:12:25

Notice that [cljsjs/classnames "2.2.3-0"] is a transitive dep here - as expected

olegakbarov20:12:28

i use boot, are there’re equivalent command?

mikerod20:12:00

looks like it

mikerod20:12:09

boot show -d

olegakbarov20:12:26

i got this [cljsjs/react-select “1.0.0-rc.10-1” :exclusions [[cljsjs.classnames]]]

olegakbarov20:12:01

lemme remove :exclusions and see…

mikerod21:12:38

yeah, seems it is being excluded…

olegakbarov21:12:42

i removed exclusion, but boot show -d has same output

olegakbarov21:12:00

are there any way to “clean cache” or smth?

mikerod21:12:32

I don’t know about that

mikerod21:12:41

I haven’t used boot much

olegakbarov21:12:21

disregard this 🙂

olegakbarov21:12:06

got this now:

[cljsjs/react-select "1.0.0-rc.10-1"]
├── [cljsjs/classnames "2.2.3-0"]
├── [cljsjs/prop-types "15.5.10-1"]
└── [cljsjs/react-input-autosize "2.0.0-1"]

olegakbarov21:12:58

nope… still same error

mikerod22:12:32

@olegakbarov You should have the dep available now. maybe you’re caching or something.

olegakbarov23:12:21

@mikerod i tried all possible combinations, but without luck

mikerod23:12:12

using the browser can you try to pinpoint where the JS error is occurring?

mikerod23:12:26

I use the js debugger sometimes to find the “error” place

mikerod23:12:33

it highlights it in Chrome dev tools

mikerod23:12:46

Also, see if you see the class names JS in sources there

olegakbarov23:12:03

yeah, sure — the error is in Select package

var className = classNames(‘Select’, this.props.className, {
				‘Select--multi’: this.props.multi,
				‘Select--single’: !this.props.multi,
				‘is-clearable’: this.props.clearable,
				‘is-disabled’: this.props.disabled,
				‘is-focused’: this.state.isFocused,
				‘is-loading’: this.props.isLoading,
				‘is-open’: isOpen,
				‘is-pseudo-focused’: this.state.isPseudoFocused,
				‘is-searchable’: this.props.searchable,
				‘has-value’: valueArray.length
			});

olegakbarov23:12:28

with classNames defined as:

classNames = classNames && classNames.hasOwnProperty('default') ? classNames['default'] : classNames;

olegakbarov23:12:57

when paused in debugger, classNames is undefined

olegakbarov23:12:54

also, when i require classNames from node_modules and set it as global variable — it do not work either

(def cn
 (js/require "classNames"))

(aset js/window "classNames" cn)

olegakbarov23:12:24

im not sure how does require’ing works in cljsjs, but pretty sure the error might be somewhere in that realm

mikerod23:12:48

hmm I don’t see anything obvious still then

mikerod23:12:01

I use this [cljsjs/react-select "1.0.0-rc.10-1"] without a problem

mikerod23:12:10

and I don’t have anything with cljsjs/classnames giving trouble. In both REPL and an :advanced optimized build. I’ve only used with lein though. Not sure what may be happening in your setup