-
Notifications
You must be signed in to change notification settings - Fork 21
Async Macros #31
Unanswered
jarrodpayne
asked this question in
Q&A
Async Macros
#31
The Macro API doesn't appear to support async. I'm curious to know if there may be some interest in this functionality.
Simple example adapted from the docs
import { macaron$ } from '@macaron-css/core'; import { readFile } from 'fs/promises'; const files = macaron$(async () => await readFile('file.txt', 'utf8'));
All reactions
Replies: 1 comment
I filed this discussion before reading the source code. Based on my first glace, it appears this is a limitation of babel-plugin-macro. There are workarounds if this is something someone needs and macron isn't interested in taking this up.
My initial use case was to dynamically import code inside macaron$, but I may be able to rely on Vite's dead code elimination. Sync only APIs may be fine here, but I'll keep looking to this and report back if I find anything useful.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment