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

@spearwolf/shadow-objects

v0.6.0

Published

a slightly different component framework

Downloads

167

Readme

Welcome to shadow-ents :wave:

shadow-objects is a JavaScript library that's all about making your life easier when dealing with components and web workers. It's like having a superpower for your web development! :muscle:

architecture overview

ents is short for latin "entitatis", which translates to "shadow entities"

Quick Tour

Offloading to Web Workers :construction_worker:

shadow-objects takes the heavy lifting off your main thread and moves it to web workers. This means your components stay light and breezy, just like a hibiscus flower in the wind. :hibiscus:

Entities :ghost:

Yes, we've got entities too! In shadow-objects, an entity belongs to a view-component, but it lives in a web worker. That's why we call them shadow-entities. They're like the secret agents of your app, working behind the scenes in their own separate world.

Shadow Objects :package:

The shadow-objects are simple functions or classes created by the user (you!) and form logical units of code in which the real work is done behind the scenes.

Shadow-objects reside within the context of an entity and have access to the entity's properties and events, which mirror the properties and events of the view-components.

Any number of independent shadow-objects can be attached to an entity.

Shadow-objects can also provide any context to other shadow-objects:

  • a context has a name and can consist of any JavaScript value or object.
  • a context is inherited by subtrees through the hierarchy of entities.

View Components :eyes:

A <view-component/> is a virtual component in the view that serves as an access point for the entities.

The shadow-ents package provides the custom element <shadow-objects> as view component. As a HTML element in the DOM, these might form their own hierarchy. This hierarchy is mirrored by the entities in the worker, keeping everything in sync.

In the future, implementations as react or angular components are also conceivable.

Component Context :brain:

The component-context is the root of a view-component hierarchy. It's like the conductor of an orchestra, creating a web worker and making sure the entities and their components are in harmony.

Kernel :nut_and_bolt:

Inside the worker, there's the kernel. It's the counterpart to the component-context, taking care of the lifecycle of the entities and their shadow-objects.

Tokens :label:

When a view-component is created, you can apply a string-based token. The kernel uses these to decide which shadow-objects to create within each entity. It's like giving your components a secret handshake!

Event and Property Synchronization :arrows_counterclockwise:

View-components can send events to their entities, which are then passed on to the shadow-objects. This also works the other way around. However, property synchronization only goes one way, from view-components to entities.


So, that's a quick tour of shadow-objects! It's all about making your web ui faster and more responsive, and assembling your code in a more structured and streamlined way. Give it a try and see the difference it can make in your projects! :rocket:

More in-depth documentation here:

but dear adventurer, be warned: everything here is highly experimental and in active development and constant flux!