3 ms·
Cool idea and implementation. Question: If the “initial render” of client side code involves JavaScript mounting nodes on the DOM, how is this transformed into
by chatmasta 8y ago
Cool idea and implementation.
Question: If the “initial render” of client side code involves JavaScript mounting nodes on the DOM, how is this transformed into static HTML that can be rendered without JavaScript? Does headless chrome offer a way to “snapshot” the DOM in its current state (basically like copy pasting the “elements” pane in dev tools)? Just wondering if there is a term for this, and/or where it’s documented.
- geo_mer 8y agoRendora uses internally cdp https://github.com/mafredri/cdp https://github.com/mafredri/cdp, a golang client implementation for "Chrome Devtools Protocols" which works on top of websockets, when Rendora detects a witelisted request, it instructs the headless Chrome instance using cdp to render the corresponding page and waits for the DOM load event, after that the content of the page is copied to rendora and then returned back to the client while preserving HTTP headers and status code. It's all about using the chrome-devtools-protocol, if you are interested, you may want to read about it in https://chromedevtools.github.io/devtools-protocol/1-2 https://chromedevtools.github.io/devtools-protocol/1-2 >If the “initial render” of client side code involves JavaScript mounting nodes on the DOM That's the raison d'être of rendora, if your website doesn't add DOM nodes using some javascript framework (e.g. React, Vue, etc..)in client, basically the HTML will be exactly the same and thus you don't need rendora in that case