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

treeact

v1.0.3

Published

Delclarative UI with free choice of Template-Engine, super fast and support for components and unopinioned server-side renderings.

Downloads

4

Readme

tReeact

Motivation

With tReeact I have developed a framework, that is inspired by facebooks reactJS, enabling you to use the technologies you already use. The core idea that I found was: "Rerender your entire app, on every data-change." That approach is quite convenient because it is like most websites where developed 5-7 years ago. When every click of the user loaded the next page, executing some scripts on the Server and display the current data. If you realy wanted to see the current data, the user had to refresh the page with [F5].

Description

With tReeact I provide a framework, that allowes you like react, developing your app, in that way. Further more I will discribe how I provide that functionality. If you want to compare to react, check out reactjs.github.com.

I want the developer to use same technologies that are already well tested and used in production. There templating-languages. In January I wrote an TemplateManager, that makes it even more handy to work with templates ever before. Using the templating-engines the developer generates HTML that is representing the view, that is rendered on the screen. The simplest way could be to append that HTML to some innerHTML inside the DOM. With that you re-render the entire page and loose all eventlistener and all changes you made manually (mutations).

Facebooks React as well as tReeact provide a smarter way to render the entire page how his should look at the current moment. The Framework then compares the new view and the last rendered view and applies a minimal set of changes on the DOM. To do so, the HTMLstructure is seen as a data-tree (virtual DOM) and these trees are compared. tReeact is parsing the HTML string into some XML-DOM object and compares it with a previous rendering.

With that approach your eventlistener and other changes on a DOM-node keep avalable. And even if you have a node with an ID, you can append it to an other position, while keeping the listener.

After a while of thinking how to attach organize the event-handling, I developed a component model, based on a new introduced html-attribute called "component" naming a component by a name, that is registered on the rendering tReeact instance. This approach was inspired by the Vue.JS framework.

Code Examles

For an example check out the the indexHTML it uses some ejs template to create the html and adds an click event to some element triggering a rerendering. Because the TempleteManager uses Ajax-requests to load the templates, you need to host the folder on a webserver. I recommend installing PHP, navigate on the console into the folder run "php -S 0.0.0.0:8080" and open "http://localhost:8080/index.html" in your browser.

** Mutation: a mutated view is an view element that was changed by some javascript, that is propably not representing the rendered data.

Tobias Nickel

alt text