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

limbo-ts

v0.1.3

Published

Typescript library that offers a simple way to create a SPA with a MVC approach

Downloads

221

Readme

What is Limbo-Ts?

Limbo-Ts is a web framework designed for vanilla developers who still find some resistance to embracing some other more famous web frameworks or developers who are tired of feeling constrained by these other web frameworks. It has the goal of offering you an MVC-like approach for your single-page applications that are simple to learn and implement.

How to get started?

In theory, you can use any local development server in NodeJs to serve your SPA using Limbo-Ts, but because I started this development from a Vite Vanilla Typescript project (https://vite.dev/guide), to minimize any unexpected issues, I advise you to get started from there. To create an empty Vite Vanilla Typescript project you can use this comand.

npm create vite@latest my-limbo-app -- --template vanilla-ts

After you have your project created you just have to get the Limbo-Ts library from npm.

npm i limbo-ts

After installing, you can start by creating some component add the reference to the Limbo-Ts framework.

Example

index.html

<body>
    <div id="app">
      <div id="SomeComponent" data-limbo-component="SomeComponent"></div>
    </div>
    <script
      type="module"
      src="/src/main.ts"
    ></script>
  </body>

src/main.ts

import { SomeComponent } from "./components/SomeComponent/SomeComponent";
import Limbo from "./lib";
import "./style.css";

(() => {
  const appElement = document.querySelector<HTMLDivElement>("#app");
  if (!appElement) {
    throw new Error("div with id 'app' is necessary to start the Limbo Application");
  }

  Limbo.Bootstrap(appElement, {
    components: {
      SomeComponent,
    },
    limboRoutes: [],
  });
})();

src/components/SomeComponent/SomeComponent.ts

import { LimboComponent, LimboComponentOptions } from "limbo-ts";
import "./SomeComponent.css";
import html from "./SomeComponent.html?raw";

type SomeComponentModel = {
	title: string;
}

export class SomeComponent extends LimboComponent<SomeComponentModel> {

	constructor(componentId: string, options?: LimboComponentOptions<SomeComponentModel>) {
		super(componentId, html, options);	
	}
	
	protected override onMount(): void {
		this.setModelData({
			title: "Hello World!"
		});
		console.log("SomeComponent mounting...");
	}
	
	protected override onUnmount(): void {
	console.log("SomeComponent unmounting...");
	}
}

src/components/SomeComponent/SomeComponent.html

<h1>{{model.title}}</h1>

for more docs you can go to Getting Started

Contributions

I don't want the library to get too complicated or have a lot of features and tools that in the future could potentially turn into some kind of limitation or bottleneck on the development side. Having said this, additional code to handle Dependencies Injections, HTTP request calls, and others will be not taken into account for this library. I will add in the docs some suggestions to be followed but the purpose is to implement Front End applications your way, so I will only give attention to contributions or requests that will make the current Limbo-Ts library better.

Support

If you appreciate my work and want to support me: