Closed AaronMoat closed 1 month ago
I am not sure I fully understand the issue here with the render. We document and encourage writing your own render function and only keep the render function here for backwards compatibility with V2. Is there an issue with the newest version of mjml? It seems to still work for me when I upgrade and test.
In general there is much that could be made variable with the render (e.g. optimization parameters) but we want this package to have no opinion on how the render should be defined, as it is heavily a case by case basis.
:+1: I was largely trying to loosen the peer dependencies requirement, but looking at this again after a break, this makes less sense because mjml-browser doesn't depend on core. Ignore this!
👍 I was largely trying to loosen the peer dependencies requirement, but looking at this again after a break, this makes less sense because mjml-browser doesn't depend on core. Ignore this!
That sounds good, glad it is cleared up. We appreciate the desire to contribute 😃
BREAKING CHANGE:
utils/render
now requires an additional argument, the import of eithermjml
ormjml-browser
.If you are not using the render utility, this has no effect. However, the mjml peer dependency has been removed, and so can be removed if not using for any other purpose. mjml-core has been added as an optional peer dependency for typings.
This change both allows greater flexibility, and removes dependencies pulled in via
mjml
->mjml-cli
unless necessary (using this utility).Before:
After:
Note: the render utility is undocumented.