joyride

djblue 2023-12-07T22:17:44.379289Z

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

borkdude 2023-12-07T22:18:26.257569Z

This is easy to support, I suggest:

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

πŸ’― 2
borkdude 2023-12-07T22:18:37.171849Z

where :cljs can be used for both joyride and cljs

djblue 2023-12-07T22:20:00.819439Z

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

djblue 2023-12-07T22:20:35.450729Z

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

djblue 2023-12-07T22:21:05.867139Z

I think https://github.com/BetterThanTomorrow/joyride/blob/master/src/joyride/sci.cljs#L106 needs to be updated

borkdude 2023-12-07T22:21:46.079839Z

add here:

:features #{:joyride :cljs}

borkdude 2023-12-07T22:21:50.305409Z

and then it'll work

djblue 2023-12-07T22:22:07.483339Z

πŸ‘ Should I submit a PR?

2
borkdude 2023-12-07T22:22:15.597159Z

πŸ‘ + test preferably

πŸ‘ 1
pez 2023-12-07T22:24:05.426179Z

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.

djblue 2023-12-07T22:38:18.573809Z

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?

borkdude 2023-12-07T22:42:34.925919Z

don't you want to change the test?

borkdude 2023-12-07T22:42:45.272449Z

eh test the change?

borkdude 2023-12-07T22:42:54.049319Z

that's kind of the point for a test right

djblue 2023-12-07T22:46:17.585579Z

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 πŸ‘Œ

borkdude 2023-12-07T22:47:30.469479Z

Just add a reader conditional to one of the existing tests

πŸ‘ 1
borkdude 2023-12-07T22:48:27.493019Z

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

borkdude 2023-12-07T22:50:03.242849Z

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

πŸ‘ 1
djblue 2023-12-07T22:52:14.647719Z

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

djblue 2023-12-07T23:18:53.959259Z

Ok, got https://github.com/BetterThanTomorrow/joyride/pull/179 up πŸ‘Œ

djblue 2023-12-07T23:22:51.443129Z

Ohh, I think cljs should be tried before cljc

borkdude 2023-12-07T23:23:00.670839Z

yes, already commented

πŸ™ 1
borkdude 2023-12-07T23:23:23.192349Z

also I tend to write test cases like this:

(is (= expected actual))

borkdude 2023-12-07T23:24:04.097679Z

gotta go now, see you tomorrow

πŸ‘‹ 1
pez 2023-12-08T08:26:00.855779Z

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.

pez 2023-12-08T08:36:38.005319Z

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.

borkdude 2023-12-08T08:46:21.553739Z

it is correct. reader conditionals work in order

πŸ™ 1
djblue 2023-12-08T15:23:55.729339Z

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
borkdude 2023-12-08T15:24:47.541209Z

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

πŸ€” 1
pez 2023-12-08T15:25:09.643879Z

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

djblue 2023-12-08T15:25:27.226869Z

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

πŸ‘ 1
borkdude 2023-12-08T15:25:54.944479Z

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

❀️ 1
djblue 2023-12-08T15:26:21.077249Z

The whole presentation was running via sci 🀫

🀯 1