-
Notifications
You must be signed in to change notification settings - Fork 983
MJML5.0 Replace html-minifier and js-beautify #2858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
I currently get the error |
|
Make sure to have no global install, clean your node modules + lockfile
…On Sun, May 5, 2024 at 12:48 AM marvin-wtt ***@***.***> wrote:
I currently get the error nullTypeError: Cannot destructure property
'children' of 'element' as it is undefined. When compiling with CLI
—
Reply to this email directly, view it on GitHub
<#2858 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAELHTLDV3KHE7TT6KCZ7Y3ZAVQUBAVCNFSM6AAAAABGYUNVXSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJUGQ4TGNBRGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Just tried it with a fresh project and only the Black Friday template as test. Still fails. |
|
@marvin-wtt found out the issue thanks for reporting check the latest version (alpha.2) should be good now 👍 |
|
How experimental is this now? I see there have been alpha releases. Looks like CI isn't working as support for Node 16 needs to be dropped (cssnano doesn't support it as it's unmaintained). |
54ebade to
097a2bd
Compare
|
I don't think we'll find some alternative to those lib now. I still need some work tho to bring back the CI to a green state |
|
@iRyusa for what it's worth, the CI commands locally seem happy enough if async function run() {
const { html } = await mjml(input)
... existing ...
}
run(); |
|
Tried with a global await but it need to be converted to module. I'll try
your solution thanks !
…On Sat, Aug 3, 2024 at 1:47 PM Aaron Moat ***@***.***> wrote:
@iRyusa <https://github.com/iRyusa> for what it's worth, the CI commands
locally seem happy enough if packages/mjml/test/html-attributes.test.js
is updated to await mjml instead of just mjml; something similar to
test.js seems to work:
async function run() {
const { html } = await mjml(input)
... existing ... }
run();
—
Reply to this email directly, view it on GitHub
<#2858 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAELHTNMZAFNPNWTKMTCQL3ZPS7LTAVCNFSM6AAAAABGYUNVXSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRWGY4DMNRVHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Is there any other support that you might want to get this over the line from experimental to shipped @iRyusa? 😄 |
6dfc0d7 to
e457883
Compare
|
Alpha 6 might be the last alpha version. Then I'll push it to the "live". |
|
@iRyusa thank you for this change. It's going to be deployed to our production on Monday 🤞🏽 |
|
Feel free to reach me on slack if you find any issues 👍 |
Without any problems. About 415.358 mail build with "5.0.0-alpha.6" since the deploy. The only thing that is changed is that I use mjml in a microservice build with hapi. I only needed this change in a hapi route to make it work. @@ -1,37 +1,40 @@
"use strict";
const Boom = require("@hapi/boom");
const Mjml = require("mjml");
module.exports = [
{
method: ["get", "post"],
path: "/mjml",
- handler: (request, h) => {
+ handler: async (request, h) => {
if (request.method === "post") {
try {
- const result = Mjml(request.payload.mjml, request.payload.options);
+ const result = await Mjml(
+ request.payload.mjml,
+ request.payload.options
+ );
if (request.payload.return_html) {
const formattedMessages = result.errors
.filter((x) => x.formattedMessage)
.map((x) => x.formattedMessage);
if (formattedMessages.length) {
request.logger.warn(formattedMessages.join("\n"));
}
return result.html;
}
return result;
} catch (err) {
const boom = new Boom.Boom(err.toString());
boom.reformat(true);
return boom;
}
} else {
return "post mjml and I will return html";
}
},
},
]; |
- Added a santizeStyles option to account for templating syntax. Can use as either complete block or CSS values either in <mj-style> tag or style=“” attributes - Added optional templateSyntax array of objects for multiple syntax types - Created a shim for minifyCSS to minifyCss for CLI
- Added the cssnoano preset as users were being prompted to install it from 5.0.0-alpha.8 - ES Lint upgrade for better compitibility with Prettier
- Removed spaces from restored values when using sanitizeStyles - Added allowMixedSyntax to allow bost block and CSS propertiy/value pairs in the same document - Added function to precheck for unbalanced delimeters before sanitizing - Added unit tests - Update docs
bugfix(cssnano): added lite profile to dependencies
…ilding bugfix(mjml-browser): not building
- removed glob dependency - replaced with native globSync
feature(template syntax): santization before PostCSS
- set ignoreIncludes to default to true - setflag for CLI to set to true - updated docs - added unit tests Fixes #3018
chore(glob): replace with globSync
…j-body feature(mj-body): moved body from skeleton
…-defaults-to-false bugfix(ignoreIncludes): mjml5 security fix #3018
…ith-globSync Revert "chore(glob): replace with globSync"
- Move to lerna v9 to get OIDC capabilities. - Force auth in NPM publish action.
chore(lerna): move to lerna v9
Revert "chore(lerna): move to lerna v9"
I tried using v5.0.0-alpha.9, only to find some weird ESM-related problem (sigh). This was only noticable as the visual regression tests failed, so this change ensures it goes through Jest too. Refs mjmlio/mjml#2858
- bumped due to security issues with current version
|
I'm not getting the CssSyntaxError error I mentioned in #2858 (comment) with 5.0.0-alpha.9 🎉 |
bugfix(mj-body): background-color attributes
chore/glob package update
|
Hey folks, we've released alphas 9 and 10 on the
Template syntax santizationIf you're using e.g. The default template syntax types are The santization occurs inside both blocks, e.g. CSS properties and/or values, e.g. By default you can only have one or the other but you can optionally allow these to be mixed by setting Happy testing! Let us know if there are any issues |
I don't see this reflected in the code-base. I only see 5.0.0-alpha.9 made about 10.000 email on production yesterday. Today 5.0.0-alpha.10 is going to be deployed. |
|
As Prettier is now a dependency, any usage in Jest fails due to jestjs/jest#15816. 😩 Edit: I've been able to confirm everything works as expected in Jest if I comment out the |
Edit: Available on MJML on v5 for now on
experimentaltag