Closed borkdude closed 2 years ago
@alexdao3 The logic for this lives near:
Please also add a test for this.
@borkdude In addition to the above example, should this work support the following cases as well?
(:require
["./local_file.mjs" :as local-file] ;; a local file import
["url" :as some-url] ;; a JS library not containing the`"$default"` suffix
[clojure.core :as clojure-core]) ;; Clojure namespaces?
I think so yes
@alexdao3 I pushed both your cherry + compiler-common PRs here:
https://github.com/squint-cljs/cherry/pull/75
It has failing tests
You can run these tests locally with:
node lib/cherry_tests.js
I have resolved the failing test and will merge manually
@alexdao3 Merged, thanks. I forgot to mention you as a co-author, I'll do this next time, sorry for this.
I hope to come up with some more contributor friendly way to contribute to both compiler-common and this project so tests run in CI. If you have any ideas, feel free to share them.
@borkdude No worries at all, and thanks a ton for getting that over the finish line!
I'm looking at some of the changes you added on top of the PR and that would've taken me a long time to figure out 😅 Do you mind if I ask some clarifying comments on the PR? Would help me with understanding for future contributions
I hope to come up with some more contributor friendly way to contribute to both compiler-common and this project so tests run in CI. If you have any ideas, feel free to share them.
Gotcha, I'll keep that in mind!
A few things I didn't quite undersatnd:
Invalid regular expression: missing /
errors? cc/target
and binding it to :cherry
?bb dev
setup working with the compiler-common package (which I git cloned under a sibling squint
directory). Do you have any tips? https://github.com/squint-cljs/cherry/pull/72#issuecomment-1306609341What caused all of the failed tests with the Invalid regular expression: missing / errors?
This happens when symbol
is called with an empty string namespace, which was probably triggering this.
What is the purpose of cc/target and binding it to :cherry?
In compiler-common, the code differs for squint and cherry, so this is a way to check what we are compiling for
I couldn't seem to figure out how to get bb dev setup working with the compiler-common package
Yes, just clone compiler-common within the squint or cherry clone such that you get this:
squint/compiler-common
cherry/compiler-common
Discussed in https://github.com/squint-cljs/cherry/discussions/70