Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLJC files are incompatible with ClojureScript #26

Open
livtanong opened this issue Mar 5, 2019 · 4 comments
Open

CLJC files are incompatible with ClojureScript #26

livtanong opened this issue Mar 5, 2019 · 4 comments

Comments

@livtanong
Copy link

I'm seeing use of java-only features, so I'm confused as to why the sources are in .cljc. Is clojurescript support planned?

@tolitius
Copy link
Owner

tolitius commented Mar 5, 2019

sorry for the confusion. I did plan cljs support at some point, but then, if I remember correctly the hesitation came from which JS ecosystem to target. i.e. Node makes sense:

(defn exists? [path]
  (fs/existsSync path))

(defn file? [path]
  (.isFile (fs/lstatSync path)))

(defn directory? [path]
(.isDirectory (fs/lstatSync path)))

;; ...

(defn slurp [filename & {:keys [encoding]}]
  (when (exists? filename)
    (.toString
      (if encoding
        (fs/readFileSync filename encoding)
        (fs/readFileSync filename)))))

but what if it's not Node. and since I did not need it myself, time invested was minimal, but I did get to rename files to .cljc :)

@livtanong
Copy link
Author

I think node makes the most sense, seeing as it has a large ecosystem and good support in some cljs build tools like shadow-cljs. But I could be biased :P

@ILoveHubGit
Copy link

I agree with @levitanong.
Besides that I could really use it now for a web application I just wrote. It is a test application that calls some external API's. But dependent on the environment it will be deployed in the URL for the API will be different. So I would love to be able to use a config file for this.

@KaliszAd
Copy link

KaliszAd commented Sep 21, 2021

Support for Node.js would be great, e.g. to be able to run Puppeteer from ClojureScript with more code sharing with a main server in Clojure. Having the same code for reading configuration in both cases would unify the setup a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants