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

lovevanilla

v0.9.5

Published

Celebrating the Art of Simplicity in Web Development

Downloads

49

Readme

Vanilla Lovers' Project

Celebrating the Art of Simplicity in Web Development

Introduction

Welcome to the Vanilla Lovers' Project! This initiative is a tribute to developers who cherish the elegance and freedom of plain JavaScript. It's for those who prefer the clarity and control of building applications without relying on frameworks like React or Angular.

If you’re passionate about simplicity and want to explore the raw power of JavaScript, this project is your playground.

Example in Action: Check out Clan Sports, a real-world project utilizing concepts from Vanilla Lovers' Project.

What's Inside

This project is a showcase of how much can be achieved with pure JavaScript. No frameworks, no libraries—just clean, efficient, and well-documented code to inspire and empower developers. It's designed to help you:

  • Understand core JavaScript concepts better.
  • Build applications that are lightweight and efficient.
  • Appreciate the beauty of coding from scratch.

Technical Details

BaseApp: The Core Framework

The BaseApp is the heart of this project, designed to manage different pages in your application. It leverages JavaScript's simplicity while enabling you to create dynamic and responsive applications.

Lifecycle Hooks

The BaseApp uses a lifecycle model with the following methods:

  1. beforeRender(): Prepares the page before rendering.
  2. render(): Renders the main content of the page.
  3. afterRender(): Executes post-render logic, such as API calls or DOM manipulation.

Data Management

Two core methods ensure seamless data handling:

  • setData(): Updates the data and triggers a re-render. When this method is called, the beforeRender() and render() methods are executed. Instead of running afterRender() again, the updatedData() method is called to avoid infinite loops.
  • getData(): Retrieves the current data for the page or component.

Handling Dynamic Pages

BaseApp enables dynamic page rendering based on:

  • URL Parameters
  • Query Strings

This dynamic system makes it easy to handle multi-page applications with minimal overhead.

Typical Workflow

  1. During the first render:

    • beforeRender(): Prepares and initializes the page.
    • render(): Displays a progress loader or initial UI.
    • afterRender(): Handles API calls or other asynchronous tasks to fetch and display data.
  2. When calling setData():

    • beforeRender(): Prepares for the update.
    • render(): Re-renders the UI with the updated state.
    • updatedData(): Updates specific components or parts of the page without restarting the entire lifecycle.

Benefits

This approach provides a lightweight yet powerful framework that allows you to:

  • Maintain full control over the rendering process.
  • Avoid endless rendering loops with clear lifecycle management.
  • Handle API calls efficiently, displaying loaders during asynchronous operations.

If you love vanilla JavaScript, you'll enjoy this simple yet versatile approach. It strikes the perfect balance between control and complexity, enabling you to build sophisticated applications with excellent results.

Contributing

We welcome contributions from fellow vanilla enthusiasts! If you have ideas, suggestions, or improvements, feel free to submit a pull request. Let's continue to make this project a haven for those who love the simplicity and elegance of vanilla JavaScript.

License

This project is licensed under the MIT License.

Acknowledgements

We would like to express our gratitude to the entire vanilla JavaScript community for their unwavering dedication to simplicity and elegance in web development.