i’m trying to make a drag and drop website builder but I’m unable to come up with an efficient way to generate the HTML code. any suggestions?
server-side: express.js (node 10.x)
i’m trying to make a drag and drop website builder but I’m unable to come up with an efficient way to generate the HTML code. any suggestions?
server-side: express.js (node 10.x)
Do you have any ideas to start out with? Maybe we can take something that works inefficiently and come up with ways to improve it.
As of now, I thought of making an npm package with different functions for generating button, card, etc. Each function would take in the necessary parameters including basic styling requirements and then generate HTML code for it.
I thought I could have an initiator function where I write the <html>
<head>
and <body>
(opening only) tags to a file. And with each added function I append the code to that file.
A slightly more detailed example:
<html
and <head>
tag elements (as of now, I am not giving the user to add custom meta descriptions) to a file.Any help is appreciated! Thanks
That already sounds pretty efficient. React supposedly builds up its virtual DOM in a way very much like that. And then you’re serializing it to a file a single time, as opposed to doing some kind of diffing and syncing with the real DOM, which should be plenty efficient.
fair enough, thank you!
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.