clojurescript

2026-03-02T09:03:16.177809Z

Hi, is there currently support (via library) to use clojure qualified keywords on javascript? I tried to find any on internet and didn't find it so i started a "blind-llm" approach using babel here https://github.com/semantic-namespace/js-qualified-keywords the final purpose is to have LSP support for kws (navigate, refactor, etc.) and easy communication with cljs (sending kws instead of strings ) I'd love any feedback on the idea or lib impl

p-himik 2026-03-02T09:20:06.411539Z

> the final purpose is to have LSP support for kws (navigate, refactor, etc.) How is that related to keyword usage in JS? > easy communication with cljs (sending kws instead of strings ) What do you mean by "sending"?

2026-03-02T09:26:37.378169Z

Hi @p-himik > How is that related to keyword usage in JS? I like to write qualified-keywords as data-types (so LSP recognise them) , basically i want to easy my JS-team the use of a https://github.com/semantic-namespace/atlas project that deals around definitions and identity and fully embraces qualified keywords > What do you mean by "sending"? POST to clj backend

p-himik 2026-03-02T09:39:38.210119Z

I see. In that case, I think would completely avoid using Babel (no need to change JS syntax) or explicit function calls and instead I'd rely on template literals with a custom tag function. So you'd end up with code like this:

const { kw } = require(...);

const theKeyword = kw`:the-ns/the-name`;

2026-03-02T09:41:49.883449Z

and do you think i could also have LSP/IDE support?

p-himik 2026-03-02T09:42:32.356989Z

It you would be able to have such support with a custom function, there's no reason why such support couldn't exist for custom tag functions, which are also just functions.

2026-03-02T09:49:25.442059Z

thanks for the feedback @p-himik, I'll give a try to your proposal approach to see if it fits properly the final purpose

Kimo 2026-03-02T22:44:55.627149Z

Does anyone have a guide for targeting :lite-mode? I see discussion on the "mental overhead" of knowing what language features will break it. How can I adopt this mental overhead myself? For instance, how could I read the source of https://github.com/cjohansen/nexus and know whether lite-mode would work?

dnolen 2026-03-05T14:48:03.070349Z

there's no limit to the size of the program you can write, if you're doing light weight stuff on the client you write lots of code and get small artifact because you don't actually need persistent data structures.

dnolen 2026-03-05T14:48:44.906099Z

Google Closure Library and JavaScript apis help a lot for this style of dev

dnolen 2026-03-05T14:50:45.747569Z

that said you do have to be more familiar w/ ClojureScript to understand what to avoid - some things still need work. And I agree that using CLJS libs w/ :lite-mode generally has very little value.

dnolen 2026-03-05T14:52:04.700469Z

:lite-mode is more compatible w/ HTMX and derivative approaches

dnolen 2026-03-05T14:52:27.422969Z

where you're just not interested in JS deps at all

Kimo 2026-03-05T14:53:07.622709Z

Nexus has that going for it - no dependencies.

dnolen 2026-03-05T14:56:11.897919Z

thats's good but that's not what :lite-mode is about

dnolen 2026-03-05T14:58:09.618959Z

it's for people who know the want to drive a Web App from the server and aggressively minimize the JS footprint. So looking for library to combine it with defeats what it is for.

dnolen 2026-03-05T15:00:39.880959Z

granted there's no good docs for how to use it and the rationale - that's missing

Kimo 2026-03-05T15:03:49.357999Z

Exactly. I see the practical viewpoint, and that is my current area of research. I'm just wondering what's the right way I can learn more. So far my options look like: • read the source, starting from https://github.com/clojure/clojurescript/commit/f9a6856d91e45377391406fc34a581bc4043615e, • start compiling and try to reduce the bundle by trial/error • make an inventory of which language features use chunked-seqs and .toString

dnolen 2026-03-05T15:06:33.717159Z

you don't need to worry about chunked-seq, handled for you

dnolen 2026-03-05T15:06:51.078669Z

the only big foot gun is printing

dnolen 2026-03-05T15:08:27.181439Z

adding persistent data structure will expand your baseline to about 8K brotli

dnolen 2026-03-05T15:08:42.778589Z

printing will take you to 12k brotli, that's it

dnolen 2026-03-05T15:09:56.607139Z

modulo missed things, and things that need feedback (some case that should be small but isn't)

dnolen 2026-03-05T15:11:45.336439Z

if you want to build client-centric thing, lite-mode is not appropriate, if. you want to build server-centric thing lite-mode can be a sharp tool

Kimo 2026-03-05T15:12:03.211069Z

I probably will stumble with printing - since I am looking at methods for serializing edn into and out of a cljs runtime. Maybe there are bespoke ways to read/print smaller structures without requiring every feature of edn.

dnolen 2026-03-05T15:12:53.421699Z

impratical, if you're going to serialize to EDN then think about transit, 10K to your baseline

dnolen 2026-03-05T15:14:34.212969Z

but Transit probably needs to be tweaked so that lite-mode can work, again, in server centric context, you often don't need to bother, you're just dealing w/ markup not data structures, and JSON suffices in the few instances you need it

Kimo 2026-03-05T15:19:04.991139Z

I wonder how squint's printer fits in with these concerns - https://github.com/squint-cljs/squint/pull/765

dnolen 2026-03-05T15:20:22.333969Z

it doesn't, squint doesn't have all the data structures and doesn't need to cover all the cases

dnolen 2026-03-05T15:21:37.188349Z

also lite-mode has a relatively hard constraint that programs under lite-mode don't actually remove / alter language features (outside of optionally getting rid of toString)

Kimo 2026-03-05T15:22:48.810799Z

Right, I got the impression that it would just yield a larger bundle again, rather than any sort of compile failure

dnolen 2026-03-05T15:23:11.685319Z

yeap

Kimo 2026-03-05T15:23:40.774369Z

Thanks for the insights

dnolen 2026-03-05T15:23:49.103109Z

np!

thheller 2026-03-03T06:17:38.735639Z

I'd say if you writing anything above 500 lines of code don't bother. It really is only useful for very tiny programs.

thheller 2026-03-03T06:18:20.494339Z

so nexus alone makes it not worth using :lite-mode 🤷