Fork me on GitHub
#clojurescript
<
2021-10-18
>
Krishan V12:10:55

Hey everyone, I am trying to use js interopt to make use of StorybookJS. I need to have export {default} from './storybook'; in my entry point of my app which is essentially index.cljs . How can I go about doing this?

pez13:10:01

Is there something similar to tools.logging for ClojureScript?

borkdude13:10:53

There is also glogi from #lambdaisland which builds on top of this

Krishan V14:10:23

The components were written in cljs and not js/ts though. Not quite what I was looking for but thanks!

👍 1
sun-one18:10:27

A package I'm attempting to use has it's js transpiled to file names with a cjs extension. I get an error message around failing to locate source (note it exists in node_modules). When I move the output of the node_module to a .js file extension it succeeds and compiles. Is there a way to configure the CLJS compiler to also search for files with .cjs extension?

p-himik19:10:01

Out of curiosity - what's the package, if you can share that info?

sun-one19:10:48

Really it's all codemirror packages that are causing the issue for me (they're setup to compile to cjs files which they use as the main entry point).

sun-one19:10:25

I could always fork and alter it to compile to js extension but that will lead to a lot of headaches.

thheller19:10:47

do you use shadow-cljs?

sun-one19:10:10

No I'm using standard CLJS compiler with webpack bundler.

p-himik19:10:22

FWIW it does have index.js, but it's mentioned under "module" in package.json and not "main".

sun-one19:10:44

Yea it does compile to an index.js file but CLJS is by default searching for the "main".

Ty23:10:52

A couple of quick questions. 1. Can I query XTDB from a Clojurescript web app? 2. Any recommendations for a simple react wrapper in cljs? I just need something that isn't obfuscating away a ton of decisions for me. I like re-frame, but I really want to able to fully understand whatever libs I'm using right now. I'd rather sacrifice some niceness for simplicity.

refset23:10:00

XT's HTTP API isn't intended for direct usage from a web front-end, but it can be achieved and used at least for prototyping - e.g. see https://github.com/wkok/re-frame-crux

phronmophobic23:10:49

I think https://github.com/lilactown/helix is usually recommended as a simple react wrapper in cljs.

Ty20:10:32

Nice, looks perfect for my needs! Thank you. Do you happen to know of any similarly simple libraries for backend web services?

phronmophobic20:10:18

What kind of backend web services? What kind of simple are you looking for?

phronmophobic20:10:02

A general resource for finding options is https://www.clojure-toolbox.com/

🙏 1
phronmophobic20:10:17

in addition to here on slack

Ty20:10:17

In the most simple form I'm just trying to build a web app that can persist data and use the kind of xtdb/datascript datalog ideas across the stack. For now I don't care about auth/security at all, I'm just trying to build a local tool for myself and need persistence.

phronmophobic21:10:33

Unfortunately, nothing comes to mind

Ty23:10:31

I guess reagent is the best option in regards to #2?