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

legendary-pancake

v0.1299709.0

Published

Static site generator based on React and webpack with emphasis on customizability

Downloads

7

Readme

legendary-pancake

Great repository names are short and memorable. Need inspiration? How about legendary-pancake. —GitHub

legendary-pancake is an advanced static site generator based on webpack, React and React Router.

How it looks like

You define each of your page programmatically:

const pages = {
  '/': (callback) => {
    callback(<Layout><HomePage /></Layout>)
  },
  '/profile/': (callback) => {
    callback(<Layout><ProfilePage /></Layout>)
  }
}

for (const article of require('./articles')) {
  pages[`/articles/${article.slug}/`] = (callback) => {
    article.loadContent().then((content) => {
      callback(<Layout><ArticlePage content={content} /></Layout>)
    })
  }
}

export default pages

Then legendary-pancake renders these pages into static HTML and also generates a client side bundle to further enhance the experience.

About

It has been extracted from Taskworld’s marketing site which requires:

  • Localization. The entire site may be translated into multiple languages.

  • A/B testing. We sometimes must generate more than one version of the same page to be able to perform A/B testing.

  • Prerendering. As a marketing site, web page performance is very important. The page must appear as quickly as possible. We need to prerender every page into static HTML files, so that they can be served quickly.

  • Code splitting. With many pages, it’s too slow to download the entire site’s content. It’s also not good to load each page on demand. We must be able to group related pages together to make navigation between related pages instantaneous.

Therefore, it has been designed for advanced users and gives you total control of:

  • Your site structure. Unlike Gatsby, it doesn’t generate routes based on filesystem layout. You define every route programmatically.

  • How you write CSS. PostCSS? PreCSS? cssnext? Sass? LESS? Stylus? CSS Modules? Autoprefixer? Inline Styles? legendary-pancake has no preference on this.

  • The prerendering process. You decide how your React element gets turned into an HTML file.

    You can use libraries like react-document-title, react-helmet to help with <head> elements, or roll your own solution. Inline your critical CSS or JS in your HTML file, or just use normal <script> tags. It’s all up to you.

  • Route loading. legendary-pancake has no preference on how to load your page contents. For small sites, you can package the entire site content in a single bundle.

    Or you can use webpack’s code splitting or bundle-loader to split your contents into multiple chunks which are loaded asynchronously, either eagerly or on-demand. Create a chunk for every page, or group related pages together based on analytics data, like we do at Taskworld. You’re in total control.

  • Your deployment process. legendary-pancake can be configured to render pages into a different directory from the webpack assets. This allows for some advanced use-cases, such as A/B testing a static site.

But legendary-pancake will take care of these for you:

  • Development and building workflow. It comes with a CLI tool to run the development server and generate the static site.

  • Managing URLs and route transitions. legendary-pancake preconfigures React Router to support asynchronous routing and prerendering at the same time.

Examples