This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-04
Channels
- # beginners (8)
- # boot (20)
- # cider (8)
- # cljs-dev (263)
- # cljsjs (8)
- # cljsrn (20)
- # clojure (151)
- # clojure-argentina (1)
- # clojure-belgium (7)
- # clojure-dev (18)
- # clojure-italy (25)
- # clojure-spec (34)
- # clojure-uk (15)
- # clojurescript (89)
- # component (45)
- # core-async (27)
- # cursive (16)
- # datomic (53)
- # emacs (40)
- # figwheel (3)
- # hoplon (62)
- # jobs (1)
- # jobs-discuss (7)
- # luminus (8)
- # lumo (60)
- # off-topic (3)
- # parinfer (1)
- # precept (1)
- # protorepl (15)
- # re-frame (37)
- # reagent (7)
- # ring (3)
- # ring-swagger (73)
- # slack-help (1)
- # specter (19)
- # sql (4)
- # test-check (10)
- # uncomplicate (2)
- # unrepl (14)
- # untangled (52)
- # vim (5)
- # yada (42)
Anyone know how to generate externs for https://raw.githubusercontent.com/dreyescat/react-rating/master/lib/react-rating.js I copy paste the link in http://jmmk.github.io/javascript-externs-generator/ but it doesn’t load anything
oh, with this link it is working: http://dreyescat.github.io/react-rating/lib/react-rating.js
Would you know what is the JavaScript object to enter for this lib?
when does it make sense to reimplement a js lib as a cljs lib? I'm looking at the polymer source at https://github.com/Polymer/polymer and I'm thinking it would not be all that difficult to make a pure clojurescript version. But other than advanced optimization and namespaces, I'm not sure what that would buy us.
Is it a true statement that for any CLJS interop form like (.method <object> <params>)
, method
must be on an object prototype?
I guess the other case is if you explicitly assign a function to an object instance and then call it, but it seems like that would be uncommon.
@cfleming not a true statement, nor a good assumption
under Node.js:
cljs.user=> (def path (js/require "path"))
#'cljs.user/path
cljs.user=> (.resolve path ".")
"/Users/anmonteiro/Documents/github/clojurescript"
cljs.user=>
path is the exports of a module
you can think of it as an object
something like
function resolve(){
...
}
module.exports = {
resolve: resolve
}
This is in the context of completion, BTW, just trying to figure out where I should be looking for candidates.
Lumo has very basic support for JS completions: https://github.com/anmonteiro/lumo/blob/master/src/js/lumo.js#L269
I’ve been planning to try to understand the JS module system better, I might have to now.
granted, this is under Node. So I don’t need to worry about anything else 🙂
ah right. the SDK thing
perhaps this is not the best way to start
I guess if this is for Cursive & ClojureScript nailing down goog
stuff & foreign lib would be more approachable?
@cfleming and for foreign libs that have externs you have a lot of work done for you
exciting stuff
I’m not a Cursive user myself but I know a handful of people that will be very happy with that support 🙂
Actually all that works (to some degree) in Cursive now, I’m just improving the performance, and working on better test coverage.
gotcha
At some point soon I’ll attempt type inference too, which is very helpful in Clojure. There’s less information in CLJS though, but I still expect it to be useful.
I notice that on a def, the :file
metadata is an absolute path, unlike in clojure where it is a path relative to the classpath. Is there any reason for this?
http://swannodette.github.io/2014/12/17/whats-in-a-var looks like this might not always have been the case.
Haha, well seems like you’re doing more than lurking, and that can only mean good things for Cursive’s cljs-story 🙂
@thheller I'm trying to use shadow-cljs to write a node module. It works with (cljs/once :my-id)
but when using (cljs/watch :my-id)
or (cljs/dev :my-id)
I got this error: clojure.lang.ExceptionInfo: missing instance
@myguidingstar oh oops, these currently assume to have the embedded server running (which the shadow-cljs
CLI command launches). you can launch it manually by calling (shadow.cljs.devtools.server/start!)
I see. Thanks
it works. Thanks a lot @thheller
shadow-cljs is great
@dnolen IMO, define an alias re-quote-replacement
in clojure.string
of cljs has better uniform with clojure
(btw I’m not suggesting it shouldn’t be ported if it can be done simply, just explaining why it’s not there)
I just got started on Clojurescript and trying out my first hello world. How can I add bootstrap to project created using https://github.com/reagent-project/reagent-template
@dnolen I think he just wants feature parity regarding re-quote-replacement
, no special stuff
@dnolen I mean, we need not use conditional read in code like belowing, if we ported?
(defn foo [s]
#?(:clj (str/re-quote-replacement s)
:cljs (gstr/regExpEscape s)))
someone should make an issue and suggest that patch but also outline where the behavior diverges so we can provide an accurate docstring to set expecations
@dnolen I created [CLJS-2165](https://dev.clojure.org/jira/browse/CLJS-2165) for this feature.
Looks like the clojure 1.9 uri?
predicate is missing from cljs
@rickmoynihan yeah would probably need to tie to Closure Uri type
cool Closure Compiler change: https://github.com/google/closure-compiler/commit/4735d982d81d763b6a1887460152bc6d8b8052fb
I’ve seen people have problems with Google Analytics & advanced compilation
^ this will be in the next ClojureScript release
so, since searching has failed me (somehow), does anyone have a good cljs client-side approach to making a button that exports a table to csv?
the key part being cross-browser support (including like IE9+) where it downloads a generated file
The creating of the actual CSV part isn’t something that really needs much assistance. This cross-browser supported, client-side download a generated file part seems to be problematic via searches. I haven’t found anything in about it with respect to cljs or google closure though, so making sure I wasn’t missing anything out there
@mikerod We ended up using the download
attribute on the link, but that’s not IE compatible at all. Alternatively you can send the Content-Disposition
header, but since you cannot control the header in an <a href=
, you need to do an XHR request.