3 ms·
If you delete a div from the DOM, nested divs are deleted as well. This is the core to a new site engine I've built[0]. It takes a JSON representation of a sing
by stephengillie 9y ago
If you delete a div from the DOM, nested divs are deleted as well. This is the core to a new site engine I've built[0]. It takes a JSON representation of a single-page application, and dynamically constructs pages within the browser. The resulting page is very fast and lightweight, especially on mobile, as there are almost no server calls involved. The Node engine is less than 200 LOC and the client is less than 600 - both are smaller than the JSON file for the main site. I'm building a hosting service for this new type of site, hoping to launch before end of summer[1].
[0] https://gilpublic.s3.amazonaws.com/Gilgamech.js https://gilpublic.s3.amazonaws.com/Gilgamech.js
[1] https://www.SPArational.com https://www.SPArational.com
- jakobegger 9y agoDid you read that part about the upside down pyramid? I‘m not sure this article is the best place to pitch your project...
- deleted 9y ago[deleted]
- stephengillie 9y agoPart of the goal of this project is to abstract the data of a site's construction further from its presentation. Sites, and parts of sites, are very portable and transparent. You can move a div around a page simply by changing the parent element specified in the 'elementParent' field of the HTML element you're describing. And you can copy divs, pages, even whole sites, more easily than server-hosted HTML sites. Being in a more formal data structure lends sites to more automation, working with data objects alongside string parsing. The browser engine is meant to be as minimal as possible, and could be easily replaced by a native browser function that ingests JSON to display pages. CSS still works normally, and the engine has a variable system to add flexibility to CSS - you can specify several CSS styles as a variable, then just use the variable in the class field of the HTML element you're describing - the browser engine will replace the variable with the several styles on page build. These are written in JavaScript because it's the only language that runs in major browsers. Were other languages available in Chrome, Firefox, etc, this might be better in another language. Websites should be easier to build, faster to load, more robust and stable, while being smaller in memory. But going back to 1997 technology isn't the answer.