This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-25
Channels
- # aleph (12)
- # announcements (2)
- # beginners (40)
- # calva (8)
- # cider (26)
- # cljs-dev (71)
- # cljsrn (2)
- # clojure (122)
- # clojure-dev (9)
- # clojure-europe (2)
- # clojure-nl (2)
- # clojure-spec (42)
- # clojure-uk (20)
- # clojurescript (86)
- # cursive (15)
- # data-science (1)
- # datomic (42)
- # duct (4)
- # emacs (33)
- # events (1)
- # figwheel-main (2)
- # fulcro (33)
- # jobs (2)
- # jobs-discuss (46)
- # kaocha (13)
- # leiningen (9)
- # off-topic (62)
- # pathom (75)
- # quil (2)
- # re-frame (6)
- # reagent (13)
- # reitit (3)
- # shadow-cljs (52)
- # spacemacs (3)
- # specter (17)
- # sql (6)
- # tools-deps (2)
- # vim (3)
- # yada (28)
Trying to integrate graphiql into a CLJS page. I get this log message on the shadow-cljs build:
[2019-01-25 09:09:15.405 - INFO] :shadow.build.npm/js-invalid-requires - {:resource-name "node_modules/graphql-language-service-interface/dist/GraphQLLanguageService.js", :requires [{:line 149, :column 30}]}
— the graphiql thing appears correctly but it’s broken in weird ways. Might the above log message have anything to do with it?Probably not, here’s the code in question:
customRules = void 0;
customRulesModulePath = projectConfig.extensions.customValidationRules;
if (customRulesModulePath) {
/* eslint-disable no-implicit-coercion */
rulesPath = require.resolve('' + customRulesModulePath);
if (rulesPath) {
customRules = require('' + rulesPath)(this._graphQLConfig);
}
/* eslint-enable no-implicit-coercion */
}
Hah, stupid codemirror. Needs to have the CSS mounted and parsed before it can do its thing. Got it working 🙂
yeah don't worry about the warning. it just has a dynamic require which is not currently supported
OMG javascript is annoying. I want to use the rangy npm module, which exposes just a single “rangy” global object - but! if you require some other file present in the node_modules lib folder, it mutates the global rangy
object. Is there any way to do this with shadow-cljs? I’ve tried copying the rangy-textrange.js
file in my classpath, but I can’t figure out a way to require it from CLJS. Shadow complains it can’t be found.
are you sure you want to use a lib that hasn't been updated in 4 years? thats not a good sign is JS land 😉
I want to use paren-soup to show a nice cljs editor in a browser, and it depends (via cljsjs) on that.
The npm package.json says that main
is rangy-core.js
. Which is what I get when I do :require ["rangy" :as rangy]
in shadow.
But, I also need to somehow require rangy-textrange.js
, which adds a few methods to the global rangy
object.
I didn’t realize you could do that, because I mistyped it first and got the message about installing the npm package 🙂
do you have the cljsjs shims setup correctly? https://shadow-cljs.github.io/docs/UsersGuide.html#cljsjs
Yep. I’m getting it loaded just fine, it’s just that it’s not doing what it’s supposed to do.
I use it here https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/ui/pages/repl.cljs
you can see it in action at http://localhost:9630/repl if you have shadow-cljs server running
I’m already doing a bunch of work in a custom build
namespace — starting my API server in the background, watching the filesystem and compiling SCSS etc, and now I want to be able to send some commands from the hosted cljs build to the shadow/clojure server running the watch. At what point does it make sense for me to use shadow-cljs as a library, instead of launching it via the command line?
Whaaaat, there’s already an hud/open-file function I can use? I was about to go down that path on my own 🙂
as far as other commands are concerned: I think at that point it makes sense opening your own websocket connection to a custom server
Yeah, I’ll cross that bridge if I need to. I like to keep in shadow land if I can, then my backend server won’t need to worry about this (since it’s a dev-only concern) and I don’t want to bring yet another web server into the mix.
reading all this prepl
business I am worried about the fact that prepl
will receive way less love than nrepl
(check the activity boom in the last months)...so...would nrepl
still be supported for the time being by shadow?
cool thanks, I am relieved 😄
yeah that's what I think as well
agree, at least is not character-based 😄
thank you Thomas for confirming
Is it possible that the cider/shadow-cljs combo does not handle well pprint?
I am using cider 0.20 and I can’t get my repl to get pprint :/
Have the same problem
Thanks! I wondered if I was alone