Fork me on GitHub
#clojurescript
<
2019-02-27
>
wood03:02:06

I find a bug in read-string or in keyword. {(keyword “”) ‘a} => {: a} , but I can not read it as string. (read-string (str {(keyword “”) 'a})) will rise a runtimeException.

Alex Miller (Clojure team)03:02:09

if you are programmatically making keywords, and you need to print/read them, you will need to validate the input

wood03:02:34

”” is allowed in keyword. And I can get the map. The problem is we can’t treat the code {: a} as data. It is un-Lisp

wood03:02:56

or treat the data {: a}as a code.

dpsutton04:02:43

Make your own function that wraps keyword with the validations you need

potetm04:02:54

@sodesu99 Just to explain the issue a little: the clojure keyword fn will take any string and turn it into a clojure.lang.Keyword object. However, the reader does not allow any string to be a keyword. There are some rules keywords must follow (e.g. no spaces, no empty string).

john07:02:13

Well, got it up a bit later than I'd have liked, but you can try out an early, alpha, rough version of the chrome extension that injects figwheel into browser tabs I'm calling chrepl here https://github.com/johnmn3/chrepl-example. Specific questions can be discussed in #chrepl.

🎉 8
iGEL13:02:35

Hi! I use cljsbuild to generate among others a test.js, that I run with phantomjs. That worked fine, but now I've updated cljs from 1.9.229 to 1.9.946 and get this all out of a sudden:

goog.require could not find: tools.money

   in logToConsole_
Error: goog.require could not find: tools.money

   in require
tools.money is my subject under test and cljsbuild is compiling that file, as it warns me about functions I overwrite in that namespace

iGEL13:02:00

but I can't find the goog.provide("tools.money") in the generated js as I could before

iGEL13:02:03

Downgrading to 1.9.229 fixes the issue, but I feel bad enough already that I haven't upgraded to 1.10 yet 😉

victorb14:02:27

seems figwheel/cljsbuild by default (in dev at least) creates around 300 requests per page load. Is there some option for making a bundle but unoptimized?

victorb14:02:51

(don't want :advanced and a production build, want a dev build but with less than 300 requests for dependencies et al)

thheller15:02:44

@victorbjelkholm429 not aware of anything like that in figwheel/cljsbuild but shadow-cljs has support for this: https://clojureverse.org/t/improving-initial-load-time-for-browser-builds-during-development/2518

john15:02:11

well, there's :whitespace

dpsutton15:02:48

wouldn't that make every change pull the entire app and not just the changed ns'es in that case?

john16:02:47

yeah... in :none, not all 300 artifacts should be getting pulled on every re-compile, usually. Should feel almost immediate.

Roman Liutikov17:02:35

is it really a problem? even with browser caching turned off, which I usually do, page load takes a couple of seconds. Figwheel is not even faster than that

victorb18:02:50

@john seems figwheel is not playing nice with anything else than :none

victorb18:02:42

problem is that I run a small proxy (dealing with webhooks) so each request has about a 30ms overhead, which adds up to a lot when in dev and loading bunch of dependencies rather than one file

victorb18:02:48

what I'm currently work around is to have two different work modes, one for general frontend dev when everything can live-reload real nice, and one for when dealing with anything webhooks and auth, not with figwheel, only cljsbuild but can't have live-reload...

john18:02:31

@victorbjelkholm429 so incremental compilation and updating is out of the question? :whitespace is not commonly used, so you may find some bumps in the road there. I'm not sure how much it'd improve the situation though.

john19:02:04

but I don't fully understand what your setup is accomplishing. what kind of webhooks are we talking about here? Are you just trying to get a repl into a production context?

sonnyto21:02:06

can anyone answer my question on eval in cljs? I cannot eval a lambda expression but can defn https://groups.google.com/forum/#!topic/clojurescript/3UV6HWyx-vM

john21:02:20

Have you tried adding :context :expr to your options map?

john21:02:41

I'm not sure if it would help in general though