You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since mjml4-in-browser is only being used to compile the mjml -> html, I was wondering if there is a way to create an override to the current parse method, to allow users to compile the mjml on the server instead.
something like:
consteditor=grapesjs.init({fromElement: 1,container : '#gjs',plugins: ['grapesjs-mjml'],pluginsOpts: {'grapesjs-mjml': {parser: asyncfunction(mjml){constres=awaitaxios.post("/parser",{mjml: mjml})// this returns the htmlreturnres.data}}}});
pros:
this way the mjml4-in-browser package could become an optional peerDependency and would probably shave off a lot of the bundle size.
parsing mjml in the browser can be quite heavy, so this should be less stress on the browser
no future problems with running mjml in the browser since it is a node.js package
cons:
parsing delay since you are now depending on network requests, needs error handling.
I don't have any experience with the grapesjs internals so I was just wondering if building something like this is even possible, @artf thoughts?
The text was updated successfully, but these errors were encountered:
Hi,
Since
mjml4-in-browser
is only being used to compile themjml
->html
, I was wondering if there is a way to create an override to the current parse method, to allow users to compile themjml
on the server instead.something like:
pros:
mjml4-in-browser
package could become an optionalpeerDependency
and would probably shave off a lot of the bundle size.mjml
in the browser since it is a node.js packagecons:
I don't have any experience with the grapesjs internals so I was just wondering if building something like this is even possible, @artf thoughts?
The text was updated successfully, but these errors were encountered: