I’m moving my projects to ReScript and I don’t understand how the ppx @intl.messages is interpreted without being in my config ?
As far I know, we have to add some config in bsconfig.json to make it works right ?
Probably @cknitt can give the most qualified answer.
I just briefely checked the source code: it looks like @@intl.messages isn’t used for a ppx. If there isn’t any ppx setup to handle this extension the compiler ignores it I believe?
This means the rescript compiler doesn’t act on this extension.
The extractor CLI uses the rescript parser. The CLI now does look for such extensions to identified value bindings which shall be extracted.
Edit: Thanks for the link to the repo btw. It tried to use the rescript parser as a libraray some time ago and failed miserably. Hopefully this gives me some new ideas.
Exactly, this is not a PPX but a standalone extraction utility.
The compiler ignores the @intl.messages attribute. The separately run bs-react-intl-extractor utility parses the source files and traverses the AST of each file to extract all the messages.