clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
Trung Dinh 2020-10-13T00:33:04.430600Z

thanks @p-himik, I did as suggested + switch to material ui, it works but style seems not to work properly,

(defn row [index style]
  (r/as-element
   [:> ListItem {:button true
                 :style style
                 :key index}
    [:> ListItemText {:primary "test"}]]))

(defn example []
  [:> FixedSizeList {:height 500
                     :item-count 200
                     :item-size 200
                     :width 300
                     :border "1px solid black"}
   row])

(defn iam-app []
  [:<>
   [:div [example]]])
The example I followed was https://codesandbox.io/s/6zvhc?file=/demo.js , not sure how can I pass in data to row if replacing [row] with row? and how do we do this in cljs/hiccup? Thanks
renderRow.propTypes = {
  index: PropTypes.number.isRequired,
  style: PropTypes.object.isRequired,
};

Trung Dinh 2020-10-13T02:54:07.430900Z

all good, I need to destructure the params passed to row properly, thanks

suren 2020-10-13T08:50:31.435Z

Whats the Clojurescript equivalence of Javascript re.exec ? re-maches returns the string and captured group without name. Is there a way to get the captured group name and its value ? For example for regex "^/item/(?<itemid>[a-zA-Z0-9-]+?)$" I want to get the {:itemid 1} for string /item/1 .

p-himik 2020-10-14T11:43:00.450300Z

It's not a malformed array. In JavaScript world, it's a proper array-like object with custom fields. Or something like that. Do not convert it to CLJS using js->clj. Just use interop: (.-matches result).

p-himik 2020-10-14T11:43:25.450500Z

The matches themselves can be converted with js->clj if you really need it.

suren 2020-10-17T09:04:38.049Z

It worked. Thanks buddy

šŸ‘ 1
p-himik 2020-10-13T10:40:06.435700Z

Nothing built-in. You can just JS interop or some thirdparty library.

jmckitrick 2020-10-13T13:14:43.436200Z

Whatā€™s the best non-chrome browser for cljs development these days?

jmckitrick 2020-10-17T15:51:05.068Z

Yeah, I was really excited about it, too. Was hoping to be mentored and help with the feature.

jmckitrick 2020-10-21T21:48:19.183100Z

Would Safari be a huge step down for cljs dev? Iā€™d like to commit to Safari or FF for an upcoming large project. Donā€™t want to re-learn tools in the middle of something bigā€¦.

jmckitrick 2020-10-21T21:48:45.183300Z

Seems Safari would be optimized for my mbp, which could be a good thing. And itā€™s WebKit.

p-himik 2020-10-21T22:03:17.183500Z

I don't remember seeing anything good about WebKit that wouldn't also be true for Chrome/FF. But I remember quite a few instances were it didn't work as expected. Also not sure what "optimized" would mean here. If it work fast enough both for you and your users, then all is good.

jmckitrick 2020-10-21T22:13:14.183800Z

I just hate Google and Chrome now. Itā€™s totally irrational, but there it is.

jmckitrick 2020-10-21T22:13:39.184Z

I just want to support the alternatives.

jmckitrick 2020-10-21T22:14:00.184200Z

ā€˜optimizedā€™ = runs better on the mac Iā€™m developing on

p-himik 2020-10-13T13:23:27.436300Z

Given that most browsers are based on Chromium and generally provide only user-facing changes, I'm pretty sure that your only alternative is Firefox.

p-himik 2020-10-13T13:24:04.436500Z

But its DevTools are not yet as extendable as Chrome's AFAIK.

jmckitrick 2020-10-13T18:12:00.437100Z

Yeah, FF was on the verge of implementing the custom formatters, but it got squashed after downsizing šŸ˜ž

p-himik 2020-10-13T18:39:28.437300Z

Oh, that sucks, I didn't know about that.

Rico Meinl 2020-10-13T21:54:15.438900Z

#shadow-cljs Iā€™m importing a library via :require . Then after doing the shadow-cljs release to a node-library I get this error when importing it into the browser. Does anyone know why it doesnt resolve the require durin the build?

thheller 2020-10-13T21:57:59.441100Z

because as the name implies it is building a node-library. intended to run in node, not in the browser?