joyride 2023-12-07

Are there plans to add support for reader conditionals in joyride?

This is easy to support, I suggest:

(def x #?(:joyride 1 :cljs 2 :default 3))

πŸ’― 2

where :cljs can be used for both joyride and cljs

Yeah, although I think currently the reader conditionals feature is off for sci in joyride.

I would be happy with just :cljs πŸ’―

add here:

:features #{:joyride :cljs}

and then it'll work

πŸ‘ Should I submit a PR?

2

πŸ‘ + test preferably

πŸ‘ 1

We only have e2e-tests currently. They are written in Joyride. You run them with an npm script. Let me know if you need any help with it.

Ok, verified the change locally via the repl and npm run integration-test. Do I need to add a test or is the change alone good enough for the PR?

don't you want to change the test?

eh test the change?

that's kind of the point for a test right

Ohh, I think I misunderstood. I though you were saying to test the change by trying it out. I launcehd the extension and eval'd some code to verify. IMO if a test should be added, it would be at the sci level since the feature is being provided by sci and joyride is opt-ing into enabling the feature. But I can add one to joyride if desired πŸ‘Œ

Just add a reader conditional to one of the existing tests

πŸ‘ 1

it's easy to mess up the config, even if it works in SCI, so my opinion is that it should be tested :)

I added :features #{:cljc} to squint a while back and assumed that :cljs reader conditionals worked. I was wrong ;)

πŸ‘ 1

I think I need a new test file since I need a cljc file

Ohh, I think cljs should be tried before cljc

yes, already commented

πŸ™ 1

also I tend to write test cases like this:

(is (= expected actual))

gotta go now, see you tomorrow

πŸ‘‹ 1

What’s the use case? Should a joyride script be able to use it? Right now we only list cljs files in the script menus.

I’m not familiar enough with how reader conditionals are supposed to work. Is this correct?

#?(:cljs :cljs :default :default :joyride :joyride) => :cljs
#?(:default :default :cljs :cljs :joyride :joyride) => :default
I’m guessing it is, but it surprises me that Joyride wouldn’t priortize the :joyride code.

it is correct. reader conditionals work in order

πŸ™ 1

My use case is trying to get some cljc namespace loaded into joyride via runCode but all the reader conditionals eval to nil. I think being able to run a cljc script also makes sense. I'll update the PR to include that.

πŸ™ 1

Are you trying to run tetris in joyride? clojure-spin

πŸ€” 1

Your PR already enables that, @djblue. But they are missing from the menu. See my PR comments.

Ohh, sorry that's what I mean πŸ‘

πŸ‘ 1

(I saw your video about portal in which you showed SCI tetris)

❀️ 1

The whole presentation was running via sci 🀫

🀯 1