devcards

Devcards aims to provide a visual REPL experience for ClojureScript https://github.com/bhauman/devcards
2016-09-20T01:49:55.000028Z

when i require devcards.core i get this error:

Invalid regular expression: /[֑-ۯۺ-߿‏יִ-﷿ﹰ-ﻼ]/: Range out of order in character class
it comes from goog.i18n.bidi

2016-09-20T01:49:59.000029Z

is anyone familiar with this?

2016-09-20T03:25:22.000030Z

it appears to be from this dependency chain: - devcards.core - goog.dom - goog.html.SafeHtml - goog.i18n.bidi.Dir

2016-09-20T03:27:55.000031Z

a glance at the source shows

goog.i18n.bidi.rtlChars_ =
    '\u0591-\u06EF\u06FA-\u07FF\u200F\uFB1D-\uFDFF\uFE70-\uFEFC';
the compiled version shows:
goog.i18n.bidi.rtlChars_="֑-ۯۺ-߿‏יִ-﷿ﹰ-ﻼ";

2016-09-20T03:28:44.000032Z

i'm loading this from a file:/// url, could that cause some kind of corruption of the charset?

2016-09-20T03:31:45.000033Z

aha, that is exactly what it was. added charset="UTF-8" to my script tag and it ran fine.

2016-09-20T15:14:35.000034Z

i'm trying to get started with devcards (non figwheel project, should that matter) and i am having trouble getting any cards to render. something as simple as this...

(ns myns.examples
  (:require [devcards.core :as dc :refer-macros [defcard-rg]]))

(defcard-rg foo
  [:p "bar"])

(devcards.core/start-devcard-ui!)

anmonteiro 2016-09-20T15:16:00.000036Z

@eyelidlessness are you passing :devcards true to your CLJS build?

2016-09-20T15:16:04.000037Z

yes

anmonteiro 2016-09-20T15:16:19.000038Z

and calling devcards.core/start-devcard-ui! ?

2016-09-20T15:16:27.000039Z

yes (was in my code above)

anmonteiro 2016-09-20T15:16:31.000040Z

ooops

anmonteiro 2016-09-20T15:16:32.000041Z

right

2016-09-20T15:17:04.000042Z

one thing i just spotted, i had not specified a :main in my cljsbuild. is that necessary? (spinning up a new build now to see if it makes a difference)

2016-09-20T15:17:20.000043Z

no difference.

anmonteiro 2016-09-20T15:20:06.000044Z

@eyelidlessness these problems are normally just tiny details. can you put a minimal repo together I can look at?

2016-09-20T15:20:42.000045Z

yeah gimme a bit

2016-09-20T15:20:52.000046Z

thanks for looking into this with me!

2016-09-20T15:26:20.000047Z

haha i figured it out.

2016-09-20T15:26:36.000048Z

:devcards true must be in the :compiler section of cljsbuild config. i had it up a level

2016-09-20T15:26:49.000049Z

sorry for the dumb mistake 🙂

2016-09-20T15:36:17.000050Z

is it possible to use mkdn-pprint-source as the docstring for a card, or do you need to use a separate defcard-doc?

kauko 2016-09-20T17:30:05.000051Z

Probably not..? Not really sure though

2016-09-20T23:01:31.000052Z

for anyone else wondering, i was able to render the source in a normal card using the doc macro