This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-28
Channels
- # announcements (1)
- # babashka (9)
- # beginners (82)
- # calva (6)
- # cider (3)
- # clj-kondo (69)
- # cljdoc (4)
- # cljs-dev (10)
- # cljsrn (2)
- # clojure (74)
- # clojure-europe (11)
- # clojure-italy (9)
- # clojure-nl (15)
- # clojure-spec (18)
- # clojure-uk (89)
- # code-reviews (8)
- # core-async (42)
- # cursive (22)
- # datomic (26)
- # fulcro (13)
- # graalvm (33)
- # graphql (1)
- # leiningen (20)
- # malli (19)
- # music (1)
- # off-topic (4)
- # pathom (56)
- # re-frame (3)
- # reitit (26)
- # shadow-cljs (40)
- # spacemacs (5)
- # tools-deps (25)
Q: I’ve just started playing with clj-cdk and it’s style of importing interop deps doesn’t play well with Cursive.
That’s a little strange. Unfortunately there’s no good way to handle that apart from adding explicit support to Cursive. What is that import actually doing?
It is an interesting combo but super useful. It’s jvm clojure importing some kind of Typescript bridging libs (called jsii in the docs)
The import is pulling in support for constructor fns for various parts of the AWS CDK api. there’s a conj talk about it if you want a better understanding
might be best for @UGM2P65B7 to comment on this
Are there any tricks for working with these kinds of imports? My workaround will be to isolate them in another namespace but it hinders the exploratory experience so I thought I’d ask
I’m not sure why they chose that particular syntax for imports. The equivalent typescript is, I believe:
import { Stack } from '@aws-cdk/core';
import { Bucket } from '@aws-cdk/aws-s3';
Not sure what would be lost if the syntax were something like:
(cdk/require '[aws-cdk/core :refer [Stack]])
(cdk/require '[aws-cdk/aws-s3 :refer [Bucket]])
Then maybe by resolving cdk/require as clojure.core/require, cursive could resolve the symbols? I guess you could try writing such a require macro and see if it works.I don’t speak Typescript (or NPM above a very basic level), but what is that import doing that the standard nodejs requires in CLJS don’t?
If the typescript compilation target is nodejs (commonJS), then its identical to var mod_1 = require('@aws-cdk/core'); var Stack = mod_1.Stack;
Hey guys, I was wondering if there is a way to configure the repls I start (using deps) to eval automatically (set! *warn-on-reflection* true)
?
@U0FR867U1 You should be able to do that using a user.clj
, which is not Cursive-specific. I have plans to allow some startup commands to be added to a particular run config, but that’s not possible yet.
Hi @U0567Q30W do you mean create a user.clj namespace? Relying on the fact that it should be loading automatically? That’s clever I didn’t think of that at all. Thanks Colin.
I tried this but it didn't work for some reason. I only did a tiny bit of investigation into it and it appears that (set! *warn-on-reflection* true)
only applies to the thread it's run on. Repl startup seems to be happening on a different thread than stuff like 'send form to repl'
For the record IIRC I also tried it with cli repls, and I think it didn't work there either, but I'd have to verify that. It could be a lot of places where this gets decided, including the type of repl you use, whether it's local or remote etc. Another thing I'm unsure about is how this behaves when you start new threads in your code, either manually or by relying on futures, pmap, core.async etc.
What's the "safest" version of IntelliJ to be on at the moment? I'm currently on 2019.1.4 and am wondering whether to update, or maybe downgrade back to 2018 series?
Actually, I should mail the list about this. AFAIK 2019.3 with 1.9.0 should be fine now.
Great, thanks!