This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-21
Channels
- # announcements (20)
- # beginners (31)
- # biff (8)
- # cherry (5)
- # cider (4)
- # cljs-dev (1)
- # clojure (26)
- # clojure-australia (2)
- # clojure-europe (16)
- # clojure-spec (10)
- # community-development (8)
- # conjure (1)
- # core-async (1)
- # data-oriented-programming (1)
- # data-science (54)
- # datascript (10)
- # fulcro (1)
- # graalvm (2)
- # malli (5)
- # off-topic (3)
- # pathom (23)
- # rdf (1)
- # re-frame (6)
- # reitit (11)
- # shadow-cljs (6)
- # squint (2)
- # xtdb (33)
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.Yes, macros in cherry are currently implemented in a very basic way. This will change (both here and in #clavascript): 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
hacker news reader made with cherry: https://github.com/armed/cherry-hn-reader - deployed https://armed.github.io/cherry-hn-reader/