melange-re.github.io icon indicating copy to clipboard operation
melange-re.github.io copied to clipboard

Document `@mel.config` and `--preamble`

Open psb opened this issue 2 years ago • 3 comments

Should @bs.config and --preamble have some documentation, especially since NextJS and RSC will require things like [@bs.config {flags: [|"--preamble", "\"use client\";"|]}];

psb avatar Aug 09 '23 15:08 psb

Do you see this becoming an attribute? Something like [@mel.directive "use client"].

psb avatar Oct 12 '23 15:10 psb

I imagine that could be the case if its usage ends up being more pervasive.

I've actually been working on a Next.js app with Melange and I must admit: writing the first [@mel.config {flags: [|"--preamble", "\"use client\";"|]}] was a bit annoying, but then when I had one I could just copy paste it to other pages.

I guess I can see both sides.

anmonteiro avatar Oct 12 '23 19:10 anmonteiro

If you think it is worthwhile, and can point me in the right direction, then I could try writing it.

psb avatar Oct 13 '23 12:10 psb