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

Steps to work with shadow-cljs #105

Closed
knubie opened this issue Mar 21, 2019 · 3 comments
Closed

Steps to work with shadow-cljs #105

knubie opened this issue Mar 21, 2019 · 3 comments

Comments

@knubie
Copy link
Contributor

knubie commented Mar 21, 2019

Hi, first of all, thanks for creating vim-iced, it's a fantastic plugin.

I just want to document my experience getting it set up and working with shadow-cljs, because it wasn't very straightforward, and this post might help other people in the future.

The following incantation worked for my project:

  1. :IcedConnect
  2. :IcedEvalRepl (shadow/repl {build-id})
  3. :IcedEval and :IcedEvalVisual (not :IcedEvalRepl :IcedEvalReplVisual)

There were a couple of stumbling blocks I encountered when getting this to work.

  1. Using :IcedStartCljsRepl shadow-cljs {build-id} did not work for me.
  2. Not knowing the difference between :IcedEval and :IcedEvalRepl and when to use each.
    • E.g. At first I tried to eval project-specific code using :IcedEvalRepl, which didn't work.

I would be happy to look more into the :IcedStartCljsRepl issue and possible open a PR.

@liquidz
Copy link
Owner

liquidz commented Mar 22, 2019

@knubie Thank you for opening this issue.
It is very welcome to improve documents about shadow-cljs!

Using :IcedStartCljsRepl shadow-cljs {build-id} did not work for me.

Could you tell me the minimal steps to reproduce the problem?
I could confirm to work with following steps.

  1. Generate a test project
  2. Set up shadow-cljs.edn
  3. Start to watch
    • npx shadow-cljs watch frontend
  4. Open app.cljs
    • vim src/main/acme/frontend/app.cljs
  5. Connect and start cljs repl
    • :IcedConnect
    • :IcedStartCljsRepl shadow-cljs frontend

Not knowing the difference between :IcedEval and :IcedEvalRepl and when to use each.

:IcedEval is a evaluation method for the current namespace, so you should use only :IcedEval basically.
:IcedEvalRepl is a evaluation method for the initial namespace of REPL(such as :init-ns in project.clj), and vim-iced detects the session switching with this method.
So you must use :IcedEvalRepl for starting cljs repl.

Other examples: :IcedEvalRepl is useful for starting a system (go, reset or etc) in integrant-repl.
https:/weavejester/integrant-repl

@knubie
Copy link
Contributor Author

knubie commented Mar 22, 2019

@liquidz Thank you for helping me troubleshoot! I can confirm that everything works as expected with the shadow-cljs test project, and I also discovered why it wasn't working for my project. 😁

I was running

:IcedStartCljsRepl shadow-cljs :my-build

Instead of

:IcedStartCljsRepl shadow-cljs my-build

Passing :my-build would then become ::my-build (:shadow.user/my-build).

I will let you decide if the docs should be amended.

またありがとうございました!

@knubie knubie closed this as completed Mar 22, 2019
@liquidz
Copy link
Owner

liquidz commented Mar 22, 2019

@knubie Great!

Passing :my-build would then become ::my-build (:shadow.user/my-build).

Oh, it is confusing. Sorry!
I'll fix to trim the beginning colon.

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

No branches or pull requests

2 participants