Clojurians
#clojurescript
<
2016-03-19
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

akjetma02:03:23

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. https://github.com/akjetma/dmp-clj 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):

haywood03:03:04

Any om.next folks on atm?

haywood03:03:18

I'm stumped on this issue I'm having — there's an issue created here: https://github.com/omcljs/om/issues/658

haywood03:03:35

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

domkm04:03:31

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.

iwankaramazow07:03:48

@haywood: I answered on GitHub

iwankaramazow07:03:26

@haywood: #C06DT2YSY is a better channel for this

bensu08:03:42

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

domkm19:03:27

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

chrisoakman19:03:41

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

domkm19:03:53

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

chrisoakman20:03:01

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.

chrisoakman20:03:23

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: https://github.com/jkk/honeysql

domkm20:03:32

@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.)