markdown-reason-react icon indicating copy to clipboard operation
markdown-reason-react copied to clipboard

split into 2 packages?

Open MoOx opened this issue 7 years ago • 4 comments

Idea:

  • markdown to serializable ast
  • ast to reason-react

My idea is to be able to avoid a reason file per markdown file for scalability reason (if you have 1000 mardown files, building as react pages might make a bundle pretty big)

MoOx avatar Jun 07 '18 07:06 MoOx

How would you feel if I implemented this through CLI flags?

kennetpostigo avatar Jun 07 '18 07:06 kennetpostigo

For the usage I have in mind, I would not be interested to have reason conversion directly. It closes door to dynamic rendering that can adjust components during rendering. I am thinking about this kind of logic, that end user can customize when rendering the ast https://github.com/MoOx/moox.io/blob/2b7d26596e9da068b9fa95fe0f4190db8908a0be/src/components/MyBodyRenderer.re#L55-L119

MoOx avatar Jun 07 '18 08:06 MoOx

Gotcha, I already generate a serializable AST and can definitely expose from the module programmatically. Similar to Reason module that offers refmt as a CLI but also exposes toolchain programmatically that you can use in your code.

kennetpostigo avatar Jun 07 '18 15:06 kennetpostigo

I'll keep this issue open, and will ping you here once I get to exposing the AST.

kennetpostigo avatar Jun 07 '18 15:06 kennetpostigo