This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-23
Channels
- # announcements (1)
- # beginners (21)
- # calva (2)
- # cider (26)
- # clj-kondo (5)
- # cljdoc (4)
- # cljsrn (1)
- # clojure (42)
- # clojure-spec (5)
- # clojure-uk (1)
- # clojurescript (45)
- # cursive (5)
- # data-science (1)
- # datomic (5)
- # emacs (6)
- # fulcro (18)
- # hoplon (8)
- # immutant (1)
- # joker (9)
- # nyc (1)
- # off-topic (72)
- # re-frame (3)
- # reitit (1)
- # rewrite-clj (11)
- # shadow-cljs (9)
- # tools-deps (70)
@mark340 I don't know anything about gmail add-ons. if you have a basic JS example I can maybe tell you how to do it CLJS
The basic challenge is GMail add-ons need a javascript entry function (the entry function is referenced by the GMail add-on manifest file). Of course, the entry function name cannot be mangled by the closure compiler using advanced compilation. For some reason, declaring it ^export doesn't work. I looked at the resulting javascript and cannot find a clear function definition with the exported name. I found an example of doing this using the ClojureScript compiler directly: https://github.com/plexus/gas-of-life The basic approach is to create a snippet of javascript that are the entry point functions. They call into the 'real' functions written in clojurescript. Then, tell the clojurescript compiler that these snippets are a foreign library. The resulting javascript (again, using advanced) incudes the js snippet verbatim so gmail can find the entrypoints. Essentially, it seems my code is a foreign library for itself 😕 I want to believe there's a more straightforward solution but I cannot find another magical incantation to make it work.
dunno why he created that extra file. guess it isn't well known that the :export
takes an actual string as well
Ah, that could be it! I'll give it a try. Thanks!