Fork me on GitHub
#clojurescript
<
2017-08-20
>
cl0jurian01:08:39

Hi there, is it possible to use clojurescript modules with figwheel or under development configuration?

tony.kay07:08:07

@cl0jurian Yep. Working perfectly for me.

tony.kay07:08:13

use 0.5.13 of figwheel and no optimizations. Works like a charm. Some examples can be seen in my devcard demos for Fulcro. https://github.com/fulcrologic/fulcro/blob/develop/src/demos/cards/dynamic_i18n_locale_cards.cljs

tony.kay07:08:54

the develop branch is right on the cutting edge

cl0jurian07:08:21

@tony.kay thats news for me. awesome. I'm gonna try right away 🙂

tony.kay07:08:58

It rocks. Tests out fine for dev (no opt), simple, advanced. All working well as of 1.9.0-908 or so

tony.kay07:08:22

NOTE: If you do play with my demos, advanced optimizations requires using the :production profile.

tony.kay07:08:53

Make sure you read the docs. You have to call set-loaded! for each module that gets loaded (as it gets loaded), even the initial one.

cl0jurian07:08:20

well noted. thank you so

pwrflx08:08:56

I've upgraded to the latest clojurescript release (r1.9.908) and suddenly the funciton nat-int? is missing from core.. and my previously working source code gets the error "Unable to resolve symbol: nat-int? in this context". Any ideas?

pwrflx08:08:33

Even if I type it out like cljs.core/nat-int? it works.. autocompletion also finds it, only compiling does not work.

andrea.crotti09:08:25

how do you guys do localization (just a couple of languages in my case) in Clojurescript projects?

andrea.crotti09:08:39

I've seen tempura and tongue as possible options, is there anything else?

Aron10:08:25

i am unable to enable source maps. i get errors with js file names and line numbers. this is my project.clj https://gist.github.com/ashnur/78e17b961568ae8dbbb3bf102753f1f8 . I just start lein figwheel and write the files.

mfikes14:08:18

@pwrflx It's probably worth doing a clean build

alex-dixon17:08:53

Any reason CLJS doesn’t support the following? Or anyone know if supported in latest?

#:foo{:bar "baz"}
clojure.lang.ExceptionInfo: Reader tag must be a symbol {:type :reader-exception, :line 1, :column 6, :file "NO_SOURCE_FILE"}

noisesmith17:08:19

Lumo 1.2.0
ClojureScript 1.9.482
 Docs: (doc function-name-here)
 Exit: Control+D or :cljs/quit or exit

+cljs.user=> #:foo{:bar "baz"}
{:foo/bar "baz"}
cljs.user=> 

mfikes17:08:25

@alex-dixon I'd check to see what version of the reader you are using. For example, ClojureScript master currently uses [org.clojure/tools.reader "1.0.5"]

anmonteiro17:08:29

@noisesmith Lumo 1.2?! do you live in a cave? 😄

mfikes17:08:07

Right, that's like, from several months ago. 🙂

anmonteiro17:08:26

years in internet time

stvnmllr217:08:15

Can anyone here confirm that you can't prevent CSRF without a server side session? Or point me towards a good resource.

pesterhazy18:08:45

Could you use a cookie based encrypted session that include a session id?

stvnmllr218:08:49

I just got the Encrypted JWT working with buddy. Is that what you mean?

stvnmllr218:08:33

I guess my goal would be to not worry about replicating the session once i have more than one server

noisesmith18:08:15

usually it's a question of using a session store other than the in-memory store

noisesmith18:08:31

jwt is a decent way for a client to prove which session id it owns

stvnmllr218:08:41

yeah, i assume you mean like redis. was hoping to not do that, but if that's the way, so be it.

noisesmith18:08:37

sure, you can even use postgres or something depending on load - pretty much any shared data store that all the servers can use

stvnmllr218:08:32

yep, i've done that before with the db. Didn't know if someone found a better way by now. thanks.

lepistane18:08:41

i am trying to make this work with reagent and cljs https://codepen.io/AngelaVelasquez/pen/Eypnq it doesnt work. recreated html structure with reagent and then just copying css am i making the error or cljs/reagent dont work with some css rules ?

roklenarcic18:08:06

this might be a dumb question: when using boot-cljs, why do I need to name all my namespaces in module.cljs.edn file under :require

roklenarcic18:08:21

it works without it, at least in development

roklenarcic18:08:16

why did the modern cljs tutorial insist, that any new namespace has to be included in that vector?

roklenarcic18:08:35

is it ok if I just put in my main namespace?

juhoteperi18:08:46

No idea. Yes, it should usually include just the main namespace. Or with Boot-cljs 2.1+ you don't need to use :require and you can just use :main like with other tooling.

roklenarcic18:08:17

perhaps it affects boot.reload?

roklenarcic18:08:41

second dumb question, when I run my "production" build, my target folder includes a bunch of stuff that is byproduct of compilation, i.e. besides the 500kB main js, it also includes all libraries, instead of generate .css file, it also includes all the .scss sources

roklenarcic18:08:31

and I kinda want a clean output to package up

roklenarcic18:08:36

seems like boot filesets is just everything thrown together

juhoteperi18:08:03

@roklenarcic Boot-cljs by default includes the compiler output in fileset without output role, (kind of bad default, it will probably get option later to change this), you can use sift task to filter the fileset (`:include` and :invert options). .scss files you can remove from the output by moving them from directory with output role (`:resource-paths`) to directory with only input role (`:source-paths`)

jhorwitz18:08:00

Might me a silly question, but does Om-Next , reagent, re-frame etc.. fall under the React license as well since they wrap React?

roklenarcic18:08:12

aha, I thought source-paths had special meaning as in cljs, clj, cljc files only

roklenarcic18:08:00

@jhorwitz well even if they don't it's a dead library without react

roklenarcic18:08:34

like if you had a free library that uses a closed source library

mfikes19:08:49

@jhorwitz A wrapper library might be compatible with Preact.

jrychter19:08:03

As a data point: ClojureScript 1.9.521 -> 1.9.854, app size increase from 2028491 to 2059398 (1.5%). Only changes are ClojureScript version and clojure.spec to clojure.spec.alpha renaming.

lumpy20:08:05

I created the externs for cxApi.js and added a PR to https://github.com/cljsjs/packages. Was surprised it hadn’t been done already. I’m not sure how to package it so it can just be included as a dependency. I’m just adding it as an :externs in :compiler Let me know if there is anything I missed, this is my first externs file. @mfikes Thanks for the fast response, was able to get this working very quickly thanks to your links

anmonteiro23:08:04

@jrychter would be interested to check the differences in source-map-explorer reports: https://github.com/danvk/source-map-explorer