Fork me on GitHub
#clojurescript
<
2020-05-12
>
lilactown00:05:53

generally, I prefer keeping different JVMs for UI and backend to avoid instances like this, as the dev tooling for CLJS can end up clobbering things like that

rgm00:05:44

argh, I didn’t even think of that. Have now ended up with dev-time 2 JVMs anyway so maybe it’s fine, but that’ll get me closer to a good bug report.

rgm00:05:41

hm, wonder if org.mortbay.jetty (xgboost) versus org.eclipse.jetty (figwheel) accounts for this … I could get figwheel to compile but the browser hot-reload websocket couldn’t connect.

lilactown03:05:11

I've written some Closure JS code. what's the proper way to bring it into my app?

lilactown03:05:33

currently I've just pasted the code into a file on my classpath. is that enough, or do I need to add a foreign-libs declaration as well?

p-himik05:05:26

The page at https://clojurescript.org/reference/dependencies has broken markup at the bottom. Not sure what's a better way to notify someone about it.

Alex Miller (Clojure team)12:05:34

Thanks, we will fix it up. FYI, the site docs are at https://github.com/clojure/clojurescript-site

Alex Miller (Clojure team)12:05:02

Issues and prs are good places to report

danielstockton12:05:38

Should i be able to bundle es6 modules using :npm-deps? When trying to run the build, I'm getting SyntaxError: Unexpected token 'export'

dnolen13:05:05

@danielstockton it's not clear what you mean

dnolen13:05:15

"bundle es6" what does that mean?

dnolen13:05:47

:npm-deps probably doesn't do what you imagine - it's just used to install Node dependencies

dnolen13:05:51

nothing else

danielstockton13:05:27

Right ok, this is browser side. I wanted to require an npm library into one of my namespaces

dnolen13:05:36

if it's present it does mean the compiler with other configuration will index node_modues

dnolen13:05:53

have you read the new webpack guide?

danielstockton13:05:24

Nope, will do, thanks

dnolen13:05:20

this is the recommended way now - trying to push a node_module through Closure is very challenging or sometimes impossible (and challenging to figure out if it is actually impossible)

👍 4
lilactown14:05:39

@dnolen if I have a Closure JS file in disk that I want to require, do I need to write a foreign lib entry for it?

dnolen14:05:40

not if you respect the classpath

dnolen14:05:01

so if the naming convention matches the classpath it should just work

lilactown18:05:33

I'm trying to load my Closure JS file in a node repl. not working yet

lilactown18:05:56

it uses goog.module and goog.module.declareLegacyNamespace();

lilactown18:05:14

goog.module('lilactown.harmony');
goog.module.declareLegacyNamespace();

lilactown18:05:48

after requiring it, I cannot reference any exports

lilactown18:05:11

cljs.user> (require 'lilactown.harmony)
nil
cljs.user> lilactown.harmony
Execution error (ReferenceError) at (<cljs repl>:1).
lilactown is not defined

cljs.user> lilactown.harmony/ref
Execution error (ReferenceError) at (<cljs repl>:1).
lilactown is not defined

mruzekw18:05:32

Is there any other documentation for core.async 's <p! macro? This is all I've found https://clojurescript.org/guides/promise-interop#using-promises-with-core-async

dvingo19:05:48

theres also these helpers, which i didn't know about until recently https://github.com/wilkerlucio/wsscode-async

lilactown18:05:48

is there a specific question you have about it? AFAICT the docstring describes it succinctly, but maybe you’re seeing something that’s missing?

mruzekw18:05:42

Well I honestly couldn't find it in the codebase, but I haven't (doc <p!) yet either

mruzekw19:05:33

Thank you 🙏

dnolen20:05:56

@lilactown don't use goog.module

dnolen20:05:09

use normal goog.provide - goog.module is just a pain

dnolen20:05:28

it's possible to handle it but honestly not worth the effort in my opinion

dnolen20:05:32

it solves no problems we care about

lilactown20:05:19

😕 I'm using code generated by tsickle. I would have to do a lot more rewriting of the Closure JS by hand

lilactown20:05:33

I thought goog.provide was deprecated?

dnolen20:05:57

for Google

dnolen20:05:08

goog.module is a mess

dnolen20:05:17

it requires transpilation which is ridiculous

dnolen20:05:08

@lilactown I do understand that such a feature would be useful, file a ticket, anybody can work on it

dnolen20:05:17

pretty much everything that would need to be done is already there

dnolen20:05:58

@lilactown if you interested happy to explain some pointers in #cljs-dev

lilactown20:05:28

I would be interested. I might not get to it for a bit though

dnolen20:05:20

if tsickle generally gets you Closure modules from TS than of course that's something you'll see in the near future

dnolen20:05:33

anyways please write up a ticket and capture the details like this

👍 4