jdrouet / mrml

Implementation of mjml in rust
MIT License
356 stars 23 forks source link

registerComponent in MRML? #483

Open murphycw opened 4 weeks ago

murphycw commented 4 weeks ago

MJML has a registerComponent function. Does MRML have an analogous function? I did trying looking. Apologies if I missed it. If not, do you have a recommendation for using custom components with MRML? Thanks!

jdrouet commented 4 weeks ago

Hey!

Thanks for your interest in MRML! Unfortunately, right now, it's not possible to implement your own component in MRML. In the meantime, if your component can be split into known components/elements, you can use mj-include instead.

I'll start thinking about it though.

jdrouet commented 3 weeks ago

To get more into details about this. Right now, all the components are built on top of enums. Which means there is no dyn components, which avoids the use of a dynamic table, which improves the performances by a lot. Having a way to register components would imply a degradation of the performance. I will create a poc for that and see if I can make a feature for that so that it's an opt in... I'll keep thinking about it...

christopher-w-murphy commented 3 weeks ago

Thanks for the update and for your consideration!