Open isaaclfelix opened 5 years ago
@Rodmg @mendoza1024 what do you guys think?
Sounds similar to what React does with JSX behind the scenes, the difference here is that this would be JSON and not a JavaScript Object.
However the use case you are giving for visual website builders makes sense. @isaaclfelix Could you take a look on what React does behind the scenes to see if we can reuse anything there? I know that JSX actualy compiles to a JavaScript object that looks similar to what you are proposing here but for JSON.
JSX and visual site builders is worth a try. A React and JSX based visual site builder for Wordpress could be proposed in that case.
El mar., 26 de feb. de 2019 4:12 PM, Rodrigo Méndez < notifications@github.com> escribió:
Sounds similar to what React does with JSX behind the scenes, the difference here is that this would be JSON and not a JavaScript Object.
However the use case you are giving for visual website builders makes sense. @isaaclfelix https://github.com/isaaclfelix Could you take a look on what React does behind the scenes to see if we can reuse anything there? I know that JSX actualy compiles to a JavaScript object that looks similar to what you are proposing here but for JSON.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ksquarelabsmx/project-proposals/issues/2#issuecomment-467635468, or mute the thread https://github.com/notifications/unsubscribe-auth/AI3kSNdzYpMwrsdxnGRQ1lTdTTUN5xZLks5vRbFDgaJpZM4bNkPp .
Summary
HJSON means Hypertext Javascript Object Notation. It aims to represent the same as HTML, only on a JSON object structure.
How does it work?
HTML builds layouts by nesting tags in an XML based syntax. Each tag consists of:
An identical representation can be done with a JSON object. That is HJSON, a standarized HTML like representation on JSON.
The simplest tag with the simplest representation, for example a
<span></span>
, only a tag name, with no attributes and no children, can be represented with this HRJSON string:Complex blocks can be easily represented by replicating this atomic structure, like so:
Would be represent with a HRJSON string like this:
Considerations
As any feature that aims for implementation on current browsers despite being composed of futuristic features, parsing protocols are considered to transform the HJSON objects into classic HTML. It is the goal to perform at least the following operations:
Motivation
Storing, retrieving and manipulating huge HTML strings can become a hassle on the modern visual website building ecosystem. Visual site builders create huge and complex HTML string based layouts that end up saved on the DB, cluttering it. Not only that, but that information is not easily shared across different development environments (local / staging / prod), since it comes from the database.
HJSON aims to become a way to transform complex HTML structures in JSON strings that can be parsed into JSON objects, which then can be used by modern frontend libraries like React, Angular or Vue, to create layouts dynamically without querying the database by saving instructions to build a dynamic layout on JSON files.
In other words, its a project aimed to change the dynamic-content-based websites paradigm, from pulling dynamic content (which nowadays can extend, but not limit to visually built layouts that are saved --and served!-- as huge HTML strings) from databases, into a JSON file based storage system that can even be commited into the repository and pushed / pulled to the different instances of the project.
Not only that, but in the long term, HJSON could become a JSON based, more efficient way to parse websites, that competes with the XML based HTML, which is significantly slower in parsing.
Team
Estimated time
Completing a finished distributable HJSON module is essentially easy. Since this was a personal project, I already built the initial prototype and published it here: https://www.npmjs.com/package/@lobodeguerra/hrjson
It would take about a year to complete it to a really high quality standard. However, if everything is planned properly this could be one of the most significant projects on our experimental side, if we complement this project with a web browser project based on this protocol instead of HTML for layouts.
Internal Adoption strategy
We could use HJSON as a way to kick up our credibility on the open source community, as if well planned it can escalate. Also it will speak about our web development level of understanding and applied science.
Contributing to the foundations of how the web browsers display contents is a way of saying that we're really deep in the matrix. This is a project where the theory behind HTML will serve as a way of finally having an alternative to the XML based notation to represent web documents.