Replies: 1 comment 2 replies
-
I don't know how this works, so I'm interested to see where this leads. nbb doesn't emit a |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
https://emacs-ng.github.io/emacs-ng/
Looking at projects like that, I can't help but think it would be interesting to see how nbb and clojurescript feels with it. Same for other services that might run node, but may not let us swap out the executable.
Describe the solution you'd like
Back in the day, before ESM was really a popular or even recommended option, certain transpiled tools like Babel would let you create and
index.js
that had code like the following:Which would then let you use modern JS syntax, at one point it was THE way for supporting JSX. I'm writing this as soon as the thought came to mind to get it out of my head, but curious if there's a better way to accomplish functionality like that. Similarly would like an API like the following:
Describe alternatives you've considered
Working on a netlify demo, that's not too crazy given that we can import the loadFile function from nbb. It's possible that may be the best approach to do it, but the register import can also be used from the command line like
node -r nbb/register
or environments that let you set some node flags.Additional context
Probably not a critical feature, but could make the inclusion of cljs files in existing node projects a bit more seamless without changing tools on people like having to use
loadFile
instead of vanillaimport
syntax. No love lost though if not practical or ESM does not provide an API like that.Beta Was this translation helpful? Give feedback.
All reactions