-
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
Remove renderToJSON
and renderToJSON2
#103
Comments
I honestly have no idea. This is left over from when mjml-react was maintained by wix-incubator. We were planning on removing them in v4. What are you hoping to use them for? They are defined here: mjml-react/src/utils/render-to-json.js Lines 90 to 94 in ab2829a
mjml-react/src/utils/render-to-json2.js Lines 72 to 76 in ab2829a
|
I believe these were created to be used with: https://documentation.mjml.io/#using-mjml-in-json. The exported function is identical, but the difference is in the defined reconciler. This dictates how to convert the |
Thanks for getting back to me! Honestly I was mostly just curious since I was digging around in the internals + types and thought it was really peculiar to see two identical type signatures like that. (especially with the naming convention being used). |
🎉 Thanks for digging in and looking around our project! I'll turn this into a issue to remove |
renderToJSON
and renderToJSON2
?renderToJSON
and renderToJSON2
?
renderToJSON
and renderToJSON2
?renderToJSON
and renderToJSON2
HI! Please don't remove this utility function since my current application uses renderToJSON. I'm primarily using renderToJSON to build mjml body component in json form and store them in the back-end. This way I can save & retrieve custom mjml components and load them into my application via mjml renderer & createElement. If you do remove this util function then I won't be able to update to future version of this lib. Thanks for taking over this lib, btw! |
Thank you @tobiechvarria. I'm trying to understand this better so we can evaluate if we remove it from the core package and offer it as a secondary package or leave it in the main bundle.
Is the idea that the json contains all the data required to render the component? Also, do you use |
Hi @IanEdington, "Is the idea that the json contains all the data required to render the component?' Yes, to this question. My application is an email builder which a user can add mjml body component types to build out a custom email design. I'm using renderToJSON to help build out the user interface. Using JSON, I able to easily traverse the mjml object and grab the attributes for each tag and present an appropriate UI element for the user to interact with. I can create my own mjml to json parser to do this, but why would I if one already exist :). Thanks for the reply! |
I noticed there's two module files related to rendering to JSON. What's the difference between the
renderToJSON
andrenderToJSON2
exports? The types seem identical.The text was updated successfully, but these errors were encountered: