Fork me on GitHub

I’m having some trouble figuring out how to package up a clojure + clojurescript library with a foreign-lib dependency for clojars. It’s a pretty simple project, just a wrapper around the java and javascript implementations of google’s diff match patch library. I’m just not sure how to configure the build so that the foreign lib and externs are recognized when pulled in as a dependency in another project. this is the error i am getting when trying to use the library from another project (error doesn’t happen when i just cljsbuild from within the project):


Any folks on atm?


I'm stumped on this issue I'm having — there's an issue created here:


no idea what I'm doing wrong 😛 any help super appreciated


Is there a way to stop Google Closure Compiler from advanced compiling a segment of code (short of making the code a string and wrapping it with js/eval)? It looks like the @preserve JSDoc only works for comments.


@haywood: I answered on GitHub


@haywood: #C06DT2YSY is a better channel for this


@domkm: is it code you can pull in as a foreign lib?


@bensu: No, it's compiled in a macro that shells out to Node (Babel) and embedded with js*.


@domkm: What are you trying to accomplish? This sounds suspiciously like an xy problem...


@chrisoakman: Heh, I'm hacking around a limitation of Relay imposed currently imposed by a limitation of JavaScript (lack of macros).


I see; seems like a lot of incidental complexity here related to build process and tools. I'm not sure I would approach this problem as "getting around the GClosure compiler" from a CLJS perspective.


Being able to define GraphQL queries as a CLJS data structure would be very clean (if a library for that doesn't already exist). Similar to HoneySQL:


@chrisoakman: The issue is not writing GraphQL, it's that GraphQL needs to be precompiled to complex data structures (like ASTs) that are not practical to write by hand and not part of the public contract so a Clojure wrapper that compiles directly will break very frequently. It's just the state of how Relay works right now. There's not a simple solution, short of refactoring relay-babel-plugin. (See the issue above.)