Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Working with cljs and Fulcro app #55

Closed
rafaeldelboni opened this issue Aug 16, 2019 · 8 comments
Closed

Question: Working with cljs and Fulcro app #55

rafaeldelboni opened this issue Aug 16, 2019 · 8 comments
Assignees
Labels
question Further information is requested

Comments

@rafaeldelboni
Copy link
Sponsor Contributor

First of all, thanks for this plugin!

I've been a couple of days using it with my company backend services written in Clojure and is super great!

Now I would like some help to setup an environment to play around with some cljs and fulcro.

Here is what I'm doing:

  1. lein new fulcro app
  2. npm install and npx shadow-cljs server
  3. Turn On building and watching the main and workspaces
  4. lein repl :connect 9000
  5. Execute the following command in the repl:
(clojure.core.server/start-server {:accept 'clojure.core.server/io-prepl :address "localhost" :port 55555 :name "lein"})
(clojure.core.server/start-server {:accept 'cljs.server.node/prepl :address "localhost" :port 55556 :name "node"})
  1. Open nvim

When I open a .clj file like server_main.clj everything is working great, but for any .cljs file I lost all the benefits like Go To Definiton, Documentation and Auto Complete.

Here is my conjure.edn file

{:conns
 {:lein {:port 55555}
  :node {:port 55556 :lang :cljs}}}

Can someone help me to find out what I'm doing wrong?

Log

conjure.log

@Olical
Copy link
Owner

Olical commented Aug 16, 2019 via email

@Olical Olical added the question Further information is requested label Aug 16, 2019
@Olical Olical self-assigned this Aug 16, 2019
@Olical
Copy link
Owner

Olical commented Aug 29, 2019

So I've fixed go to definition to an extent on a branch that'll be released as part of my 1.0.0 documentation push (hopefully tomorrow!), documentation seems to work fine for me 🤔

Screenshot_2019-08-30_00-21-45

Waiting on Complement to release their next version that adds ClojureScript support which I think is almost there!

I've completely refactored how dependencies are prepared and injected so hopefully that'll make integration for ClojureScript easier going forward. You probably won't see many improvements in the next release but I will be giving the CLJS side more love as the tooling I depend on adds more and more support 😄

Go to definition was broken though, it was using clojure.string internally which might not have been loaded in your environment.

@Olical
Copy link
Owner

Olical commented Aug 29, 2019

Also worth noting, if you eval a function with ,ee or something then it loses it's definition information. The only way to preserve it is to eval the whole file with ,ef. I can't find a nice way to tell ClojureScript where things are right now like I do with Clojure but I may find a way some day and it'll just start working for you.

I'm working around the constraints of a ClojureScript only REPL as best I can 🙂

@Olical
Copy link
Owner

Olical commented Sep 4, 2019

I'm going to close this for now since you should have doc and go to definition (for some symbols) again. To keep go to definition working consistently you should evaluate the entire file from disk (<localleader>ef), if you just evaluate the form it'll lose it's definition information.

It's annoying but I can't find a way around that just yet, I'll see what I can do to improve that eventually! Autocompletion will start working soon I hope, I'm waiting on a new release of Compliment.

@Olical Olical closed this as completed Sep 4, 2019
@rafaeldelboni
Copy link
Sponsor Contributor Author

rafaeldelboni commented Sep 4, 2019

Is there any special setup for this, or only updating to 1.0.0 should be fine?

@Olical
Copy link
Owner

Olical commented Sep 4, 2019 via email

@rafaeldelboni
Copy link
Sponsor Contributor Author

Go to definition and docs is a great progress, I will try it out and give you an feedback, just a last question in this thread: Which prepl should I use node or browser?

@Olical
Copy link
Owner

Olical commented Sep 4, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants