This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-05
Channels
- # 100-days-of-code (1)
- # announcements (9)
- # aws (1)
- # beginners (195)
- # braveandtrue (60)
- # calva (3)
- # cider (36)
- # cljs-dev (3)
- # clojure (124)
- # clojure-canada (13)
- # clojure-dev (18)
- # clojure-germany (2)
- # clojure-italy (2)
- # clojure-losangeles (1)
- # clojure-nl (9)
- # clojure-russia (1)
- # clojure-spec (20)
- # clojure-uk (109)
- # clojurescript (49)
- # core-logic (29)
- # cursive (7)
- # datomic (62)
- # defnpodcast (1)
- # devcards (11)
- # docker (3)
- # duct (6)
- # figwheel (13)
- # figwheel-main (57)
- # fulcro (2)
- # graphql (11)
- # hyperfiddle (3)
- # jobs (5)
- # jobs-discuss (9)
- # leiningen (2)
- # lumo (1)
- # off-topic (12)
- # onyx (2)
- # pedestal (1)
- # portkey (2)
- # rdf (1)
- # re-frame (39)
- # reitit (13)
- # remote-jobs (2)
- # rum (5)
- # shadow-cljs (82)
- # tools-deps (48)
- # unrepl (3)
- # vim (12)
- # yada (1)
you can also use create-react-class
, which is a helper library that lets you create components using a function instead of es6 classes
if you really want to extend and use the es6 machinery, then you need to use the goog.obj libraries from the google closure library
this is an example of how to do that https://gist.github.com/pesterhazy/2a25c82db0519a28e415b40481f84554
that’s what reagent uses. i believe it will be supported indefinitely going forward and should be fine to use
trying to create a small component that can be used from js so I'm staying away from reagent
@nolan can you be a bit more specific about the defspec issue? what is the problem? do you actually mean clojure.test/run-tests
not cljs.test/run-tests
?
hey @thheller, apologize for the poor clarity. i have one clojure.test/deftest
and one clojure.test.check.clojure-test/defspec
defined in test/some-test
, and originally i was trying to use the default runner namespace (i.e. shadow.test.browser
) with the following build config:
:tests
{:target :browser-test
:test-dir "target/test"
:devtools {...}
when i built and ran the tests, it would ignore the defspec
test and only run the deftest
. If i called clojure.test.check/quick-check
directly within a deftest
, it would run and work fine, but forfeit the test.check reporting line.
adding a custom :runner-ns
to the build config fixed the problem, where start
looks like this:
(ns runner-main
(:require [clojure.test :as t]
[some-test]))
(defn start []
(t/run-tests `some-test))
... ;; trivial stop and init
let me know if this helps, happy to provide more infook, no worries. that works fine for me. just wanted to float it out there and see what came back. thanks for the investigation and input!
the shadow.test.browser
thing works by hacking the deftest
macro so it doesn't have to use the macro to actually run the tests
but it doesn't hack the defspec
thing and therefore can only "discover" the extra tests in the macro
meh I don't like this. maybe I'll revise the deftest
hack and just use the macro after all
I opened https://github.com/thheller/shadow-cljs/issues/386 so I don't forget about it
java.lang.Exception: Unable to resolve spec: :clojure.core.specs.alpha/args+body
clojure.lang.ExceptionInfo: Unable to resolve spec: :clojure.core.specs.alpha/args+body
we have to also consider this still an alpha, I can understand the excitement to use it but can be painful to maintain something that's subject to keep on rapid changes =/
its not a problem in this case though since I just abused the core.specs to validate CLJS code
glad to hear that, I though was worst 🙂
I'm to use the antizer library working with shadow-cljs, which depends on the cljsjs version of antd. I've made my stub file as follows:
(ns cljsjs.antd
(:require ["antd" :as antd]))
(js/goog.exportSymbol "antd" antd)
and npm installed antd. but the value of antd
in that namespace is just coming up as nil
. Anyone know what might be going on here?hmmm I'm getting a console warning:
You are using a whole package of antd, please use to reduce app bundle size.
and a repl timeout[0:0]~cljs.user=> x
#js {:Affix #object[Affix], :Anchor #object[Anchor], :AutoComplete #object[AutoComplete], :Alert #object[Alert], :Avatar #object[Avatar], :BackTop #object[BackTop], :Badge #object[Badge], :Breadcrumb #object[Breadcrumb], :Button #object[Button], :Calendar #object[Calendar], :Card #object[Card], :Collapse #object[Collapse], :Carousel #object[Carousel], :Cascader #object[Cascader], :Checkbox #object[Checkbox], :Col #object[Col], :DatePicker #object[PickerWrapper], :Divider #object[Function], :Dropdown #object[Dropdown], :Drawer #object[Drawer], :Form #object[Form], :Icon #object[global], :Input #object[Input], :InputNumber #object[InputNumber], :Layout #object[Adapter], :List #object[List], :LocaleProvider #object[LocaleProvider], :message #js {:open #object[open], :config #object[config], :destroy #object[destroy], :success #object[Function], :info #object[Function], :warning #object[Function], :error #object[Function], :loading #object[Function], :warn #object[Function]}, :Menu #object[Menu], :Modal #object[Modal], :notification #js {:open #object[open], :close #object[close], :config #object[config], :destroy #object[destroy], :success #object[Function], :info #object[Function], :warning #object[Function], :error #object[Function], :warn #object[Function]}, :Pagination #object[Pagination], :Popconfirm #object[Popconfirm], :Popover #object[Popover], :Progress #object[Progress], :Radio #object[Radio], :Rate #object[Rate], :Row #object[Row], :Select #object[Select], :Skeleton #object[Skeleton], :Slider #object[Slider], :Spin #object[Spin], :Steps #object[Steps], :Switch #object[Switch], :Table #object[Table], :Transfer #object[Transfer], :Tree #object[Tree], :TreeSelect #object[TreeSelect], :Tabs #object[Tabs], :Tag #object[Tag], :TimePicker #object[TimePicker], :Timeline #object[Timeline], :Tooltip #object[Tooltip], :Mention #object[Mention], :Upload #object[Upload], :version "3.9.1"}
getting a bunch of
shadow.js.js:87 shadow-cljs - failed to load module$node_modules$fbjs$lib$UnicodeBidi
shadow.js.jsRequire @ shadow.js.js:87
shadow$provide.module$node_modules$fbjs$lib$UnicodeBidiService @ UnicodeBidiService.js:46
shadow.js.jsRequire @ shadow.js.js:85
shadow$provide.module$node_modules$draft_js$lib$EditorBidiService @ EditorBidiService.js:18
shadow.js.jsRequire @ shadow.js.js:85
...
shadow.js.jsRequire @ shadow.js.js:87
shadow$provide.module$node_modules$antd$lib$index @ index.js:485
shadow.js.jsRequire @ shadow.js.js:85
shadow.js.require @ shadow.js.js:111
(anonymous) @ cljsjs.antd.js:3
shadow.js.js:87 shadow-cljs - failed to load module$node_modules$antd$lib$index
errors in js consolevia the https://github.com/priornix/antizer project
hehe that version is pretty irrelevant. the npm version matters. but its already listed above :version "3.9.1"
can you post the full errors you get? usually only the first and the last one matter though
I'm trying use this library https://github.com/rauhs/hicada for creating React component. But not sure if I'm doing it right. hicada expects you to write your own macro. So here is something that works.