cherry

armed 2022-08-21T15:32:19.903259Z

Hello, everyone. Recently had strange issue with macro requirement. Basically macros can’t be loaded if it is at least one level above source-file. E.g. • put macro in src/macros.cljs dir • nest sourcefile in src/my-ns/somefile.cljs • try to require (:require-macros ["../macros.mjs" :refer [foo]]) I’ve got following error:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/<path-to-project>/cherry-hn/node_modules/cherry-cljs/macro/macros.mjs' imported from /<path-to-project>/cherry-hn/node_modules/cherry-cljs/lib/cli.js
...
Not sure is this a real issue or I’m doing something wrong.

borkdude 2022-08-21T15:35:19.464529Z

Yes, macros in cherry are currently implemented in a very basic way. This will change (both here and in #squint): to be able to run the compiler in both JVM/bb/JS SCI will probably be used so you can directly refer to a .cljc namespace to load macros

👍 1
borkdude 2022-08-21T19:21:26.598889Z

hacker news reader made with cherry: https://github.com/armed/cherry-hn-reader - deployed https://armed.github.io/cherry-hn-reader/

👏 1
👏🏻 1
🎉 4
armed 2022-08-22T16:51:57.797069Z

Completely agree, HN API is just very convenient to play with.

2022-08-21T21:20:30.166589Z

Nice, but a site like that should not use JS in my opinion 😛