Fork me on GitHub
#clojurescript
<
2021-08-12
>
kennytilton13:08:55

Does anyone know if Vouch/@dnolen have done a "hello world" example of the Storyboard+CLJS+Krell workflow? And that is re-frame I spotted in that video as well, I think. I have someone looking at Storyboard, it does seem like a good way to go.

dnolen13:08:50

haven't done that yet no

dnolen13:08:26

there are a couple of specific boring details - like we use npm git deps to declare our UI component dep

dnolen13:08:35

and then the components we use need to be adapted in the usual way (for Reagent)

dnolen14:08:12

one RN specific trick is the need for Context, to transform nested ClojureScript values sent as props

dnolen14:08:44

all of these things are small - but potential gotchas

🙏 3
victorb14:08:49

I'm writing some glue code for integrating a CLJS library into a JS application. I've managed to get most things to work, but now I'm stuck at trying to get the JS side to provide some options to the CLJS library. The library is expecting keywords, but not finding how to create CLJS keywords from JS land (or, what the replacement could be that CLJS would still be happy with)

victorb14:08:42

import cljs, { keyword } from "goog:cljs.core";
was what I needed

dnolen14:08:49

org.clojure/google-closure-library {:mvn/version "0.0-20210811-6da97fe1"}
org.clojure/google-closure-library-third-party {:mvn/version "0.0-20210811-6da97fe1"}

dnolen14:08:32

finally some more recent Google Closure Library artifacts, these need some testing though because Closure changed their repo and we had to reinstate some things manually

dnolen14:08:08

if you're on 1.10.866 would be great to give these a spin - basic stuff - Browser REPL works - but seeing them on real projects would be more informative

p-himik15:08:05

Why is long implemented differently from int? Even though the docstring mentions that they're identical.

(defn int
  "Coerce to int by stripping decimal places."
  [x]
  (bit-or x 0))

(defn long
  "Coerce to long by stripping decimal places. Identical to `int'."
  [x]
  (fix x))

(defn- ^number fix [q]
  (if (>= q 0)
    (Math/floor q)
    (Math/ceil q)))

dnolen16:08:19

@p-himik probably the docstring is just wrong

dnolen16:08:56

but int clamps to 32bit - which isn't really desirable behavior

dnolen16:08:03

for long

👍 2
tessocog16:08:21

I have a single page, purely client side application. I have never done client side routing before. Is it possible to simulate the exact same behaviour as regular routing? such that back and forward buttons of the browser works? and the url in the url tab is updated accordingly?

tessocog16:08:55

do i need a lib for that? or is it simple enough to handcode?

p-himik16:08:00

Simple enough by using HTML5 history API, but even simpler with a lib. bidi, reitit, maybe some others.

2
p-himik16:08:04

And yet, it is possible to have the exact same experience as with regular routing. Do note however, that even in the case of SPAs with routing, you still need the server to have the exact same routes - otherwise, you will see HTTP 404 upon page reloading after some navigation.

2
2
lilactown20:08:10

is codemirror still the state of the art when it comes to a web editor with support for clojure/EDN and paredit?

Bobbi Towers21:08:04

Nextjournal's clojure-mode is open source and uses Codemirror 6 which is a complete rewrite

lilactown20:08:30

I'd like to have 2-4 different editable areas, so something light weight that I can have multiple instance or split panes is important to me

lilactown20:08:06

codemirror is a bit heavy weight which is why i'm wondering if there are others that provide similar essential functionality

Bobbi Towers21:08:41

or check out oakes/paren-soup

phronmophobic22:08:36

https://github.com/mogenslund/liquid , it might require a little more effort up front, but you could probably adapt liquid for this purpose.