cljsjs

bru 2017-12-04T16:33:03.000527Z

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)?

bru 2017-12-04T16:44:16.000132Z

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

2017-12-04T20:20:16.000392Z

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

2017-12-04T20:53:56.000710Z

@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"]

2017-12-04T20:54:03.000307Z

Which version are you referring to?

2017-12-04T20:54:25.000006Z

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

2017-12-04T20:54:28.000300Z

i use boot, are there’re equivalent command?

2017-12-04T20:55:00.000426Z

looks like it

2017-12-04T20:55:09.000188Z

boot show -d

2017-12-04T20:56:14.000171Z

hmm

2017-12-04T20:56:26.000309Z

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

2017-12-04T20:57:01.000197Z

lemme remove :exclusions and see…

2017-12-04T21:00:38.000402Z

yeah, seems it is being excluded…

2017-12-04T21:01:42.000283Z

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

2017-12-04T21:02:00.000003Z

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

2017-12-04T21:02:32.000119Z

I don’t know about that

2017-12-04T21:02:41.000112Z

I haven’t used boot much

2017-12-04T21:03:21.000443Z

disregard this 🙂

2017-12-04T21:04:06.000334Z

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"]

2017-12-04T21:04:58.000338Z

nope… still same error

2017-12-04T22:56:32.000517Z

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

2017-12-04T23:14:21.000079Z

@mikerod i tried all possible combinations, but without luck

2017-12-04T23:16:12.000013Z

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

2017-12-04T23:16:26.000022Z

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

2017-12-04T23:16:33.000046Z

it highlights it in Chrome dev tools

2017-12-04T23:16:46.000439Z

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

2017-12-04T23:17:03.000013Z

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
			});

2017-12-04T23:17:28.000245Z

with classNames defined as:

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

2017-12-04T23:17:57.000287Z

when paused in debugger, classNames is undefined

2017-12-04T23:18:54.000216Z

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)

2017-12-04T23:20:24.000202Z

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

2017-12-04T23:53:48.000030Z

hmm I don’t see anything obvious still then

2017-12-04T23:54:01.000174Z

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

2017-12-04T23:54:10.000203Z

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