wix-incubator / mjml-react

React component library to generate the HTML emails on the fly
MIT License
989 stars 50 forks source link

`minify` option is deprecated #58

Closed Pedro-Souza closed 2 years ago

Pedro-Souza commented 3 years ago

The minify option is depreciated and when used a warning is triggered(see image). To solve it we could just remove the minify, what do you think?

PR that removed the minify option: https://github.com/mjmlio/mjml/pull/2059

image

botre commented 3 years ago

You can toggle of the option explicitly:

const { html, errors } = render(email, {
  minify: false
});

Since this option is deprecated, I agree that the default should be false.

andreymoser commented 3 years ago

I resolved using the same dependency (html-minifier) and minfy handling from mjml-core as the following:

minify(html, {
  collapseWhitespace: true,
  minifyCSS: false,
  caseSensitive: true,
  removeEmptyAttributes: true,
})

The minify option is really useful and I hope it helps, one good thing is to move this handling into mjml-react. :)

daliusd commented 2 years ago

PRs are welcome

pkuczynski commented 2 years ago

Here you go @daliusd #75. I couldn't run it locally as @wix/yoshi does not seem to exist anymore?

daliusd commented 2 years ago

Yes, it does not work locally anymore.

pkuczynski commented 2 years ago

Yes, it does not work locally anymore.

Shall this be fixed?

daliusd commented 2 years ago

Yes, it does not work locally anymore.

Shall this be fixed?

It is complicated. We would need to drop @wix/yoshi to fix this.

pkuczynski commented 2 years ago

I know its complicated, but maybe worth it, if this package is not public?

daliusd commented 2 years ago

I know its complicated, but maybe worth it, if this package is not public?

It was public and is not public anymore. Most probably we will do something about it but we have other pressing problems to solve now and time will come to this problem as well eventually.