An alternative to clj->js

Hello, I have been playing with using JS Proxy as an alternative to clj->js.

The main idea is that instead of doing an eager conversion, make a proxy and read lazily.

I made a write up including some benchmarks on how it compares to clj->js, you can find it at https://wilkerlucio.github.io/alternative-to-clj-js/

I will be glad to hear what you think about this approach.

2 Likes

You can also check out https://github.com/mfikes/cljs-bean which has a similar approach.

1 Like

Yes, that’s cool, I see the cljs-bean covered the opposite direction, I mean using the CLJS Map interface to wrap a JS object. What I do is very similar, but in the other direction, I use the Proxy interface (which is JS) to wrap a CLJS data structure.

1 Like