-
Notifications
You must be signed in to change notification settings - Fork 16
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
Make this project agnostic to runtime environment (node/browser) #92
Comments
One of the big downsides of using What I thought we could potentially do, to alleviate this, is introduce something like this:
This tag would use the native import capabilities of node (or webpack in Storybook mode) to import the mjml file raw. This could then be passed "as is" to the This makes is distinct enough to not be confused with |
I'm of the opinion that we should just remove the render to mjml function all together and add this as a suggestion to the getting started.
|
@IanEdington In an other thread I've already indicated that this may not be the best corse of action. But maybe this is an opportunity in disguise. If you want to lift the render method from the package, where does it land? |
Some unrelated thoughts:
I like the idea of a package for rendering but it's outside the scope of what we're able to do with this package for now. If you decide to write a package for this multi-environment |
Should we change the title of this issue to: "Make this project runtime environment agnostic (node/browser)" I think that would capture the part we're aligned on accomplishing. If we're in agreement on that path forward we should be able to make these changes in the v4 alpha relatively soon |
mjml-browser
instead of mjml
?
Just as an FYI, and not sure if it's still relevant, but the old mjml-react @ 2.0.7 used to work just fine in a browser-only environment (I have a repo that does just that). I had left a comment on the following bug thread wix-incubator/mjml-react#84 (comment) but it might have been missed, but specifically the minimize css process that was added was what broke the browser compat:
Not sure if you all are still using that minification process. |
Hi @pachuka, we made this project have as few dependencies as possible for that exact reason. As a result there is no minifier in the dependencies of the latest version of In our getting started section we have a brief section on using mjml vs mjml browser. We kept the render function in utils as an example/lightweight starting option and also to not break any existing uses. However we also made it completely possible for the user to ignore it and use their own render function (which can be with mjml-browser and does not need to be minified). So the summary is we removed the dependency on that minification process so that you only have to use it if you want. |
Is there a renderer that works in web workers? |
@jlarmstrongiv web workers isn't something we have looked into, so unfortunately I am not aware of the best options in that case. |
The mention of Is there a minimal example? I can't seem to get it working in the example project mentioned in the README by simply uncommenting My use case is that I'd like to have a custom If there is another way to achieve that, I'd love to know! |
A bit of a crazy suggestion, but could this project depend on
mjml-browser
instead ofmjml
?Are there huge benefits or disadvantages in this choice?
The
mjml-browser
plugin mentions 2:I think both points are mostly covered by the fact that this library uses react. We can make out own react based components, same goes for
mj-include
.Originally posted by @Bertg in #89 (comment)
related issues:
The text was updated successfully, but these errors were encountered: