Skip to content
Shane Brinkman-Davis Delamore edited this page Aug 14, 2020 · 15 revisions

Art.React

ArtReact is inspired by Facebook's React. In fact, it is much the same. However, ArtReact is designed from the ground up to run with the ArtEngine, not HTML/DOM.

Why Art.React

  • Uses a real, full-featured class system (CoffeeScript + Art.Foundation.BaseObject)
  • Supports custom property values types with custom comparators.
  • Improvements on the Facebook React Component Lifecycle API
  • Full Web-Worker support

Example

ReactJS 2020, with hooks, has closed the gap somewhat for the simplest component, but that gap widens again once you start adding complexity.

Comparison of simplest component-modules:

# ArtSuite + CaffeineScript: 16 tokens
import &ArtReact

class Hello extends Component
  render: ({name}) -> TextElement text: name
// ReactJS 2020 + JSX: 25 tokens
import React from 'react';

const Hello = ({name}) => <div>{name}</div>;

export default Hello;

Future

Planned improvements will bring the minimal ArtReact component module, for a Dom context, which will become @art-suite/components, down to:

# ArtSuite/Components + CaffeineScript: 10 tokens
import &@ArtSuite/DomComponents

class Hello extends Component
  render: -> Div .name

These planned improvements are:

  • CaffeineScript's "dot-reference" which implicitly uses the "value from the last statement" as the base for property access. In the case of the first statement of a function, it refers to the first argument
  • DomComponents will be the version of ArtSuite/Components use for HTML-Dom apps. It'll provide the "Div" method as well as the "Component" class.

updated as-of August 2020

Clone this wiki locally