binaryage / cljs-oops

ClojureScript macros for convenient native Javascript object access.
Other
351 stars 13 forks source link

[self-host] No such namespace env-config #8

Closed arichiardi closed 6 years ago

arichiardi commented 7 years ago

Hello Darwin!

I was trying to make cljs-oops work in lumo (self-host cljs) and I have run across the following:

#error {:message No such namespace: env-config.core, could not locate env_config/core.cljs, env_config/core.cljc, or Closure namespace "env-config.core" in file oops/config.clj, :data {:tag :cljs/analysis-error}}

I have two questions:

1) why is the library including a namespace for fetching environment variables? Is it a feature (in which case I can try to document it in the README) ? 2) Probably the macros are not self-host compatible, would you be open to some sort of refactoring patch that will fix this?

Thanks, as usual awesome work (I have used this successfully with cljs on jvm) !

darwin commented 7 years ago

Hi Andrea,

The error looks like you don't have env-config library on "classpath". I assume normal leiningen/maven project.clj dependecies don't work in self-hosted mode and you have to specify dependencies in another way.

  1. cljs-oops code generation can be configured via compiler options and since 0.5.2 those options can be overridden via environmental variables.

  2. the macros weren't designed with self-host in mind, but I don't think there are many places where I would assume JVM under the hood. env-config library seems to be JVM agnostic. And in cljs-oops, for example here your would have to return an empty map or retrieve oops compiler options some other way suitable for node.js.

I'm open for patches.

darwin commented 7 years ago

Bump! @arichiardi are you going to do something about this one?

arichiardi commented 7 years ago

Eventually I would like to of course, time will tell I guess 😀😀...

darwin commented 6 years ago

I'm going to close this one. Feel free to reopen if you have a specific actionable plan.