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

luminate

v0.2.5

Published

A system for creating and managing interactive components for websites. While not exactly being an MV* framework, it takes inspiration from frameworks such as [Vue.js](http://vuejs.org/).

Downloads

6

Readme

Luminate

A lightweight and minimal Javascript UI component system.

A system for creating and managing interactive components for websites. While not exactly being an MV* framework, it takes inspiration from frameworks such as Vue.js.

Why does this exist?

For the most part, interactive components on websites are usually simple things modal windows or drop down menus, but they are not necessarily simple to implement. You generally have three choices when it comes to building sites with interactive micro-components:

  1. Use a web framework such as Bootstrap. These are great as they come packaged with everything you need. The downside is that usually their CSS and Javascript are tightly coupled, and it's not very easy to say, implement only the accordion component Javascript and use your own CSS rules and class names. This isn't a problem if you're using the whole framework, but when you're using pure CSS frameworks like Starlight or Pure, it'd be nice to be able to magically drop in Bootstrap's Javascript and have it just work.
  2. Use an MV* framework such as Vue.js. These are also great as they give you a huge amount of flexibility. The downside is usually they're either overkill in terms of performance or file size for a simple website, or they don't play nicely with other frameworks or jQuery plugins.
  3. Implement the Javascript yourself. This gets around the downsides of the above two options, but it's not a scalable or maintainable solution, so when you're in the business of building a couple of sites a week it's not a good idea.

This is where Luminate comes in. It's a component system that is intended to be used alongside any old existing Javascript or CSS framework or plugin, but feel like an MV* framework. This description may be a little abstract, so...

Show me something.

Toggle display of an element with fade in/out

<button toggler-action:target="toggle">Toggle</button>
<div class="box" ref="target" toggler="is:open transition">Hello world</div>
.box { transition: opacity 0.5s; }
.box.is-closing { opacity: 0; }
.box.is-closed { display: none; }

Register a new module

<div class="box" hello="phrase:hello">
  <button hello-action="say">Say hello</button>
</div>
import Lum from 'lum'
import Base from 'modules/base'
import Action from 'modules/action'

const Hello = Base.extend({
  directive: 'hello',
  modules: {
    actions: Action
  },
  defaults: {
    phrase: 'hi'
  },
  methods: {
    say() {
      alert(this.$settings.phrase)
    }
  }
})

Lum.register(Hello)

But why is this better than just using React?

Well, it's not really better, but it does come with some benefits. Most MV* frameworks introduce some sort of complicated system for keeping the data and DOM in sync. React, for example, uses something called the virtual DOM, where they keep a copy of the entire DOM in memory and perform all changes on that, then use that to track changes and update the real DOM. This problem here is that if I wanted to load some jQuery plugin like slick on top of a React application, weird behaviour would happen as there'd be no copy of it in the virtual DOM. To fix this, you'd have to create a React component that would act as a wrapper for slick, but you still couldn't be sure how slick will behave and whether it'd break something important and cause a nuclear meltdown.

Luminate doesn't include any rendering system of any sort, as there is no "two-way data binding". This means it's essentially fully compatible with any old jQuery plugin you throw on top.

Also, there's really not much to know about Luminate, so you'll be up and running quickly, and if you decide it's not for you, then you wouldn't have wasted much time.