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

fragmentui

v0.0.0

Published

Fragment is a JavaScript library for building user interfaces.

Downloads

3

Readme

Fragment

Fragment is a JavaScript library for building user interfaces.

Fragment is similar to React, but can be used without compilation. Your plain JavaScript projects served as static files can use Fragment to benefit from the ability to update UIs by constructing new trees á la React, but without bundling.

Fragment doesn't support JSX, but does provide a set of helpers for easy tree building, which attempts to bridge the gap. Unfortunately, JSX is not supportable in plain JavaScript. (Everyone loves to have on E4X, but it would have been a great fit for something like this.)

Installing

You can use Fragment as an ES module:

import reconcile, { div } from 'https://cdn.jsdelivr.net/gh/TomasHubelbauer/fragment/lib.js';

We're also working on providing an NPM library for the project.

# Work in progress… Do not use the package name now
npm install fragment

Using

// Basic tags like `div`, `p` etc. come with the library, this is how you add support for any tag
const tag = create('tag'); // Use like `tag(...attributesAndOrChildren)`

function render() {
    reconcile(
        // The target DOM node to apply the changes to
        document.body,
        // The rest of the arguments are the top-level nodes in the new rootless tree
        div(
            'Hello, world!',
            p('This is Fragment!'),
        )
    );
}

Testing

Running

See the online demo

Contributing

The project is in its early stages, please check with me in case of interest: [email protected].

Roadmap

  • [ ] Consider making this a straight-up TypeScript project because JSDoc is just too unwieldy for something like this
    • It all depends on if I can get the GitHub releases & NPM pipeline to work as well as JSDelivr from npmjs.or for the lib file
  • [ ] Fix TypeScript errors in the pipeline
  • [ ] Set up an NPM release pipeline when they are available through YAML: https://stackoverflow.com/a/52323336/2715716
    • [ ] Until then do it in a build pipeline
    • [ ] Create a GitHub release as well
  • [ ] When we've exhausted target node count and still have fragment nodes, add all in bulk using DocumentFragment for perf
  • [ ] Obtain and publish an NPM package for Fragment
    • [ ] Await donation answer for fragment
    • [ ] Await donation answer for fragmentjs
  • [ ] Add support for keys
    • Will fix chart in showcase sliding attributes from one to another instead of just removing first then appending a new div
    • Will fix input focus not moving with an element in a line if it changes within its set
  • [ ] Create a demo comparing Fragment with React and Vue
  • [ ] See if there is a good way to recognize binary attributes and allow setting them using booleans (setAttribute?)
    • [ ] Use Element methods instead of setAttribute to make binary attributes work - days later: which is it?
  • [ ] Add a mechanism for rendering raw HTML
  • [ ] Use a mutation observer to be able to tell the DOM has changed while reconciling but not by us and restart reconciliation
    • https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
  • [ ] Document performance monitoring approaches used to determine the performance characteristics of Fragments (space & time)