Fork me on GitHub
#shadow-cljs
<
2024-01-25
>
Joshua Suskalo02:01:39

Is the modern cljs defclass structure still properly supported? ๐Ÿงต

๐Ÿ‘€ 1
Joshua Suskalo02:01:34

I'm using shadow in a pretty unusual place, in an extensible browser game. It requires using classes for some pretty basic stuff but I can work that out likely without issue.

Joshua Suskalo02:01:01

The trouble I've run into is shadow producing classes with $ as the delimiter to the classname to namespace classes

Joshua Suskalo02:01:35

The thing wants to use the class name as a css selector

Joshua Suskalo02:01:50

And these delimiters are making jquery choke

Joshua Suskalo02:01:36

So I'm curious if it'd be hard to support a shadow config to change the delimiter, or to allow marking a class as unnamespaced?

thheller07:01:20

I guess I could make it use a different character, but the things need to be namespaced because they end up living in the same "scope". so say you do (defclass Thing ...) in two different namespaces, they can't both be named Thing

thheller07:01:31

but using the classname for something is kind of a problem, since it'll usually get compiled away in :advanced, or shortened or whatever

thheller07:01:48

so can you override what name it uses maybe?

Joshua Suskalo14:01:19

That's what I've been trying, and I even filed a bug report on their system that they break on valid identifiers and the only response I got was basically "lolno"

Joshua Suskalo20:01:46

Because this is targeting a plugin like architecture though I'm not intending to go into advanced compilation.

thheller20:01:37

is that engine open source? just curious what they are doing

Joshua Suskalo20:01:31

It's FoundryVTT, not open-source unfortunately.

Joshua Suskalo20:01:54

There's a lot of open source plugins for it though that I'm using to model how to write one

thheller20:01:48

there are currently a lot of limitations in defclass, so you might be better off writing some classes in straight JS

Joshua Suskalo20:01:04

Yeah, that's the option I'm evaluating as a next step.