pentacent / keila

Open Source Newsletter Tool.
https://keila.io
GNU Affero General Public License v3.0
1.44k stars 81 forks source link

Use some frontend mjml validation #327

Open jdrouet opened 3 months ago

jdrouet commented 3 months ago

👋 I've seen you're using mrml in the backend and some js in the frontend. Did you know you could validate the template directly in the frontend with https://www.npmjs.com/package/mrml and avoid some computation/network costs?

wmnnd commented 3 months ago

Oh, that’s cool, I didn’t know there was a WASM version of it!

I’m actually planning to add some frontend validation eventually. But I would probably give the official MJML package a try first because it seems to give more meaningful error messages when the markup is invalid :blush:

I also think I could optimize things further by rendering the MJML only once instead of for every recipient when sending a campaign.

But for now (aside from error handling), using mrml on the backend works like a charm and I’m excited to see how it performs at scale! So thanks again for creating it!

jdrouet commented 3 months ago

Last time I tried, it was not possible to run mjml in the frontend. That was the original reason for building mrml 😉