Skip to content
This repository was archived by the owner on Feb 24, 2020. It is now read-only.

Expose a minimal, shared reconciler interface to encourage component reuse #35

@jchavarri

Description

@jchavarri

While working on #34 I updated the DOM reconciler example to have its primitives look more like the ones in revery:

https://github.com/bryphe/reason-reactify/blob/60e270060db3980a833d4a62b5750c7b5e540855/examples/dom/WebReconciler.re#L17-L20

revery is already exposing CSS-like styles, and colors.

This made me think that, if there was a common interface that exposed the type for a minimal, shared set of primitives, it could be possible to have 100% reusable components across different reconcilers, as long as those primitives remain the same and the components themselves don't use environment-dependent APIs. Another upside would be the familiarity with these primitives so moving from one platform to another would have less friction.

The downsides of having this common interface would be that specific environments could put back-pressure onto these primitives, to promote new controversial primitives to get included, or some attributes / types are modified to satisfy one specific reconciler, but that might be unavailable in other platforms.

In any case, this "universal interface" would be optional, so reconcilers authors could always decide if they want their reconciler to matche this interface or not.

I'm also not sure if the interface should live in reason-reactify, or better in revery. I think the "lower" it is defined on the dependency chain, the more chances to increase the reuse of platform-agnostic components.

References:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions