npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

reback-js

v1.0.0

Published

A framework to define encapsulated components that make up a render tree.

Downloads

6

Readme

Reback

A framework to define encapsulated components that make up a render tree.

Reback combines some of the ideas of React and Backbone.js.

Goals

Reback provides a unified way to define various components, e.g. in the implementation of a notebook interface (notebooks, cells, boxes, options, dynamic values, etc). They all have in common that

  • they need to be aware of their lifecycle (when they appear, disappear, etc),
  • there is a parent-child relationship between components, resulting in a render tree,
  • they need a way to define how to render themselves,
  • there is a context being passed through all levels of the render tree (e.g. current styles).

Instead of managing the lifecycle of boxes and parent-child relationships explicitly (which would be error-prone), we "declare" the dependencies during render and everything follows from that. Rendering a component B during another component A's render pass automatically makes B the child of A, and when B is not rendered anymore as part of A, we know that B disappeared. There's often no need to attach event handlers explicitly (which poses a risk for memory leaks), instead events and render requests propagate automatically through the render tree.

This is very much like React, except that

  • we need a more generalized form of render(), where we can pass in certain arguments (e.g. the layout width) and can return results that are not (ReactDOM) elements (e.g. the dimensions of the returned nodes),
  • we need to be able to render a particular child multiple times during its parent's rendering (e.g. a GridBox "probes" its children multiple times to find the ideal column widths),
  • we want to manage instantiation of components ourselves, e.g. so that a cell is not re-instantiated when the group structure changes (which would happen in React due to the way reconciliation works).

Read more about the differences to React.

Furthermore, we want a way to express asynchronous preparation of components. While a component is being prepared, it can define a certain way to render in this pending state, and we can also express things like "render a parent as pending as long as any of its children are pending".

Installation

Assuming you are using a package manager such as npm or Yarn, just install this package from the npm repository:

npm install reback-js

Then you can import Component and other members in your JavaScript code:

import {Component} from 'reback-js';

Usage & Documentation

Contributing

Everyone is welcome to contribute. Please read the Contributing agreement and the Development guide for more information, including how to run the tests.

Versioning

We use semantic versioning for this library and its API.

See the changelog for details about the changes in each release.