Change internal VNode data structure.
See original GitHub issueI’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:
- Created 6 years ago
- Reactions:2
- Comments:11 (10 by maintainers)
@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.
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.