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))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 π―
I think https://github.com/BetterThanTomorrow/joyride/blob/master/src/joyride/sci.cljs#L106 needs to be updated
add here:
:features #{:joyride :cljs}and then it'll work
π Should I submit a PR?
π + test preferably
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
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 ;)
I think I need a new test file since I need a cljc file
Ok, got https://github.com/BetterThanTomorrow/joyride/pull/179 up π
Ohh, I think cljs should be tried before cljc
yes, already commented
also I tend to write test cases like this:
(is (= expected actual))gotta go now, see you tomorrow
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
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.
Are you trying to run tetris in joyride? clojure-spin
Your PR already enables that, @djblue. But they are missing from the menu. See my PR comments.
Ohh, sorry that's what I mean π
(I saw your video about portal in which you showed SCI tetris)
The whole presentation was running via sci π€«