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.

Change internal VNode data structure.

See original GitHub issue

I’d like to discuss the possibility to change our internal VNode data structure name and props fields to nodeName and attributes respectively.

This is an internal breaking change, so I don’t believe it warrants a major bump. If you know semver better than I do, can you please help me confirm this?

Before

{
  name: "h1",
  props: { id: "title" },
  children: "Hello"
}

After

{
  nodeName: "h1",
  attributes: { id: "title" },
  children: "Hello"
}

Why?

It makes Hyperapp VNode object compatible with Preact and possibly other libraries that use the same schema. I think React uses elementName instead, which is a shame.

This is useful if you are authoring a tool that outputs virtual nodes (e.g., @lukejacksonn’s ijk or a JSX plugin that transforms JSX to VNodes skipping hyperscript syntax).

Maybe you want the library to be compatible with Hyperapp out of the box without having to distribute a Hyperapp-specific build or use a constructor function to register the VNode schema, but you also want to support at least another framework such as Preact.

Related

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
jorgebucarancommented, Jan 31, 2018

@brodybits Performance is not the most important metric when choosing a framework. It’s not even close to the top in my book. But if Inferno and React use the same VNode, then Inferno+React > Preact IMO.

1reaction
jorgebucarancommented, Feb 7, 2018

Removing breaking, because this is not technically a breaking change if we consider breaking changes only changes that break the external / public API, which this is not.

Read more comments on GitHub >

github_iconTop Results From Across the Web

virtual DOM nodes - Mithril.js
A virtual DOM tree is a JavaScript data structure that describes a DOM tree. It consists of nested virtual DOM nodes, also known...
Read more >
vnode_open | Apple Developer Documentation
Pull file data into memory. Release filesystem-internal resources for a vnode. Call down to a filesystem to set vnode attributes. Call down to...
Read more >
Evolving the Vnode Interface - CiteSeerX
idea to impose 80+% space overheads on data structures in order to cope with future change. It appears that a revision of the...
Read more >
Diving into the Virtual DOM - Vue.js 3 Course
For various reasons, one of which is performance, Vue keeps an internal representation of the component hierarchy. This is called a Virtual DOM...
Read more >
Class 9: The Unix Filesystem
(Note: Linux names their vnode-ish data structure "generic inodes".) Vnode Table: The kernel keeps yet another table, the Vnode table, which has an...
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