This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-17
Channels
- # announcements (2)
- # aws (7)
- # beginners (46)
- # cider (15)
- # clj-kondo (24)
- # cljs-dev (3)
- # clojure (46)
- # clojure-dev (34)
- # clojure-europe (7)
- # clojure-italy (7)
- # clojure-nl (10)
- # clojure-norway (15)
- # clojure-spec (5)
- # clojure-uk (42)
- # clojuredesign-podcast (1)
- # clojurescript (79)
- # clr (3)
- # core-async (1)
- # cursive (45)
- # data-science (1)
- # datomic (4)
- # fulcro (17)
- # funcool (14)
- # gorilla (2)
- # graphql (30)
- # jackdaw (5)
- # jobs-discuss (8)
- # joker (4)
- # lein-figwheel (1)
- # off-topic (48)
- # pedestal (26)
- # re-frame (36)
- # reagent (18)
- # reitit (6)
- # remote-jobs (4)
- # shadow-cljs (115)
- # tools-deps (62)
- # vim (12)
Can somebody provide me with example how can I create simple node-script project and start repl sesstion so that I can connect from nvim to it?
Yes that’s exactly what I did
when I try to execute some form in nvim i get Fireplace: no default ClojureScript REPL
I tried to call :Piggieback :app
but no results
via :Connect
it is connected to nrepl
Tried that too, doesn’t work, can’t execute anything from within the nvim
Do I need to add what ever special to config, like dependency, ports, whatever. Or should it work just out of the box ?
I created project using npx create-cljs-project hello-node
created one cljs file
yes it is connected for sure
I did manually typed host:port
I don't know. if I look at this error you might not have provided enough args? https://github.com/tpope/vim-fireplace/blob/master/autoload/fireplace.vim#L512
Ok I started shadow-cljs node-repl
, Connected, Runned Piggieback :node-repl
and tried to run Eval (+ 1 1)
and got Fireplace: session closed
The same with :Piggieback (cider.piggieback/cljs-repl :node-repl)
I don’t see nvim section in Editor Section
in docs, maybe it is not supposed to work at all
I definitely connected to nrepl, I can execute clj, but not cljs
ok, finally
CljEval (shadow/repl :node-repl)
And it works now
i love and hate clj so much 🤯
I loaded successfully BlueprintJS with shadowjs. Works at many cases, maybe my poor react knowledge.. could you help me what I forget or how to rewrite to cljs? https://blueprintjs.com/docs/#core/components/popover.dark-theme
(defn PopOver []
[:> bp/Popover {:content [:div
[:> bp/Menu {:large false}
[:> bp/MenuItem {:text "test1"}]
[:> bp/MenuItem {:text "test2"}]
[:> bp/MenuItem {:text "Test3"}]]]
:enforceFocus false
;:position "Position.BOTTOM_LEFT" ;;error
:interactionKind "HOVER"}
[:> Button {:variant "info"} "hello"]]
)
and require with ["@blueprintjs/core" :as bp]
.. my problem is how to add content section and position part of the codeI'm new to ClojureScript and trying to get my head around how the front-end is set up. We're using ClojureScript, shadow-cljs, Leiningen and Reagent. I am just a bit confused about the dependencies around React.
We're using Leiningen for our dependencies and have Reagent and shadow-cljs as dependencies. Do I still need to require React in the package.json
file?
Ok, so in layman terms, there is one version of React used in the app and it's required in one place, package.json
you can have thousands of things in package.json but that wouldn't mean they are actually included in a build
We have some :exclusions
in the project.clj file - cljsjs/react
etc - I think it's the cljsjs part I don't understand - basically how it's all connected. I come from React/Vue background and am used to just having one package listed
Ok. So if we didn't use shadow-cljs (for example) and just reagent - where would that be pulling React from?
So we can run just Reagent and shadow-cljsjs - I think I was getting confused as we run
[thheller/shadow-cljs "2.8.52"]
[thheller/shadow-cljsjs "0.0.20"]
Ok great. So ideal basic setup would be
[reagent "0.9.0-rc1"]
[thheller/shadow-cljs "2.8.52"]
and then
"dependencies": {
"react": "^16.9.0",
"react-dom": "^16.9.0",
}
shadow-cljsjs is about providing compatibility with packages that assume you don't have direct access to npm. described here https://shadow-cljs.github.io/docs/UsersGuide.html#cljsjs
Cool. So how does having reagent in lein then access the packages in json - is that what shadow-cljs is taking care of?
if you don't they are only downloaded once and then cached so no big overhead at all
Sorry, my last question, in the documents say it's recommended to run shadow-cljs as a standalone NPM version - but it doesn't say why that is recommended?
We have a lot of stuff in lein - I'm just trying to strip down the front end as it's a bit of a mess
but you can also declare them in shadow-cljs.edn directly (and skip using project.clj completely)
we are still managing 2 separate package managers. there is npm for JS and maven for CLJ/CLJS
Ok, makes sense. So for a new project, probably declare it in shadow, but we have quite a few depends in lein so probably best to keep it there for the moment
one is controlled by package.json the othe other by shadow-cljs.edn or project.clj or deps.edn
shadow-cljs uses the exact same dependency resolution library as lein so moving them over would be easy
Is it possible to make shadow-cljs build a release mode in dev with hot code reload? I’m trying to investigate an issue I only see in the release mode.
@thheller Just FYI, what we wanted was to resolve to React’s production js file while in dev mode. I used :js-options
to map react and react-dom straight to the prod min files. That seemed to work.
yeah i figured
a component breaks my app in one particular context but not another, I’m on a beta release of fulcro, so it could very well be a bug in fulcro 3, trying to figure out what’s going wrong
this component is loosing it’s dynamically bound variables
shadow-cljs release app --debug
or shadow-cljs release --pseudo-names
might provide clues if you are not using that yet
yup using those, very handy
now that i think about it, i wonder if react’s async render stuff is not compatible with the way fulcro binds dynamic vars
i’ll check thanks