cherry

Aleed 2022-12-03T00:58:04.216979Z

how are clojurescript deps* handled when using cherry? just realizing that the typical deps.edn may not work outright, but couldn’t find any examples or issues on topic

Aleed 2022-12-03T01:45:31.852729Z

hm I’m thinking it’s meant to be done via bb.edn but since i’m compiling files via framework’s build process (webpack and metro), this would just be a separate step of creating bb compiled file with deps

Aleed 2022-12-03T02:10:56.403949Z

ok seeing how nbb loads deps to see what could be done https://github.com/babashka/nbb/blob/df170a3a6bd7ec3ca009c39b207fc2f7d7dac925/src/nbb/api.cljs#L48 still wondering what the overall expectation is before going in on any one solution

Aleed 2022-12-04T20:30:32.826399Z

oh wow did not know shadow-cljs recently released an esm target https://shadow-cljs.github.io/docs/UsersGuide.html#target-esm I still see value in having cljs exposed as npm module and not depending on google closure compiler, but this does alleviate some of the pain points Cherry was resolving

Aleed 2022-12-04T20:30:53.047469Z

I wonder how difficult it’d be for shadow-cljs to integrate a cherry-cljs target

borkdude 2022-12-04T20:36:35.572749Z

yes, cherry of course uses shadow with the esm target to build itself, so does #nbb

👍 1
borkdude 2022-12-03T08:55:51.529019Z

yeah, there's an issue for this here: https://github.com/squint-cljs/cherry/issues/64

borkdude 2022-12-03T08:56:00.646339Z

not yet implemented

Aleed 2022-12-03T17:10:02.047049Z

That’s specifically about local user namespaces not remote dependencies but they may* deal with same solution. I was fine* with specifying local cljs code by relative string path, as that made it easier to integrate alongside JS projects. Otherwise we would need typical namespace enforcement.. or perhaps some path to identify related files that get picked up with their namespaces read

borkdude 2022-12-03T17:22:25.400379Z

Yes. Right now you can compile the file and then refer to it as the compiled JS. But I think later on we would need some kind of "out" folder for compiled libraries which gets added to the search path and files will be automatically compiled if they aren't already

Aleed 2022-12-03T18:30:17.461689Z

remote deps could be precompiled but I think to integrate with js tools local namescapes would need to be handled on the fly and cached compileString could accept an option for finding namespace paths and validating their names I’m not sure how this impacts macros or the repl though

Aleed 2022-12-03T18:47:39.655619Z

@borkdude Right now my priority is releasing current js project, so may not be right time to try to take this on as I don’t want to get too derailed with surprises. But so awesome to see what’s unfolding. For now if you’d like me to extract webpack loader logic into a Cherry example (or separate repo) to reference, let me know

Aleed 2022-12-03T18:48:49.612089Z

i’m using next+webpack (since there’s better tooling for React Native/Web with it); but with Vite and vite-ssr-plugin could open up cool possibilities for ecosystem

borkdude 2022-12-03T18:49:05.385509Z

Yeah, I think that would be helpful, we could just link to a repo that you manage

borkdude 2022-12-03T18:50:22.598509Z

It's a bit early days and I want to flesh out some organisational issues like where does the code of cherry/squint and compiler live, before tackling some of the other issues (REPL, code loading)

Aleed 2022-12-03T18:53:07.551939Z

Yeah totally. May make since to consolidate repos completely as now issues are spread out too. The monorepo management on CLJS side isn’t great but for JS it is, in case that’s a route you’d like to go and need assistance setting any of that up

borkdude 2022-12-03T18:53:52.463409Z

I'm losing the github stars from the other repos then :(

Aleed 2022-12-03T18:54:14.233149Z

pick the repo with the most stars? 🙂

Aleed 2022-12-03T18:55:38.771379Z

when I extract webpack logic, I can try to give a monorepo example for compiler-common a go if that’s something you’re considering

Aleed 2022-12-03T18:55:57.172139Z

can just devote an evening to all this

Aleed 2022-12-03T18:58:03.525169Z

> I want to flesh out some organisational issues like where does the code of cherry/squint and compiler live i guess I don’t know exact frustrations you’re experiencing, but did see that you’re treating code in compiler-common as three separate projects

borkdude 2022-12-03T18:59:36.125459Z

the reason I did that is that when you make a PR against compiler-common, you know if it will break either cherry or squint

👍 1
borkdude 2022-12-03T19:00:10.613339Z

I'll probably make compiler-common a library like SCI and will then depend on that in cherry / squint (like babashka / nbb depend on SCI)

👍 1
borkdude 2022-12-03T19:00:18.644949Z

but for that to happen I have to move more code to compiler-common first

borkdude 2022-12-03T19:00:33.114319Z

and then move some wrapper code back to cherry / squint

Aleed 2022-12-03T20:06:28.918259Z

example isn’t fully working but i did extract the logic in case anyone follows this trail https://github.com/alidcast/next-cherry-cljs-example

borkdude 2022-12-03T20:10:58.482929Z

cool, thank you!