question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rendering serialized trees

See original GitHub issue

I’m using preact in an electron-app. In electron the main-process and the rendering-process (= dom) are separate and communicated via json.

Right now I’m passing computing data in main and pass it to the render-process where preact will generate the tree and apply it to the DOM.

For simplicity, I would like to

  1. do the preact-tree-building in the main-process
  2. then serialize them to JSON
  3. receive them in the browser-window and call render() to apply them to the DOM.

Questions

  • Are h(…) trees serializable?
  • Does preact perform worse if I pass the entire tree, where all components are resolved to their subtrees so that only html-elements are left, to render() every time?
  • Does preact use keys or component-type to accelerate render()?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
developitcommented, Jan 24, 2018

No, it’ll be done as a plugin. It’s near the top of my todo list (finally!)

0reactions
fab1ancommented, Aug 23, 2017

Will the mutation-observers be included in undom-master?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rendering serialized trees · Issue #826 · preactjs/preact - GitHub
I'm using preact in an electron-app. In electron the main-process and the rendering-process (= dom) are separate and communicated via json.
Read more >
Serialize and Deserialize a Binary Tree - Baeldung
In this tutorial, we'll show how to serialize and deserialize a binary tree with a single tree traversal method. For example, we can...
Read more >
Serialize an item or a tree of items - Sitecore Documentation
Sitecore application Command Description User Manager Serialize User Serializes the selected user. User Manager Serialize All Users Serializes all the users. User Manager Revert User Reverts...
Read more >
How to use the react-component-tree.serialize function ... - Snyk
To help you get started, we've selected a few react-component-tree.serialize examples, based on popular ways it is used in public projects.
Read more >
How to serialize/deserialize Chrome tab (its DOM/RenderTree ...
Is it possible to completely serialize Chrome tab/(tab's DOM) and then to deserialize it again?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found