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

@animuz/embed

v0.0.26

Published

Embeddable chat widget for Rudi by Animuz

Downloads

397

Readme

Animuz Embed

React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Viewing Bundle Size

npx vite-bundle-visualizer

SVGR + SVGO

https://www.npmjs.com/package/vite-plugin-svgr

Import svg with ?react pattern and also use @svgr/plugin-svgo for optimization.

CSS Mangler

Currently we use this tool from sonofmagic for obfuscating TailwindCSS classes:

https://github.com/tailwindlabs/tailwindcss/discussions/11179

This is the instructions to use it:

https://github.com/sonofmagic/tailwindcss-mangle/tree/main/packages/unplugin-tailwindcss-mangle

Use npx tw-patch extract for extracting the css classes.

Somehow this makes the SVGs that we use broken (?) not sure if it is this or SVGO. Solving this is to define the width and height in the CSS, and remove the width and height property of the SVG file itself (or set both to 100%).

TODO

CSS Flash of Unstyled Content (FOUC)

Currently we are having problems with CSS Flickering. So I need to move some of the code to styles instead so it loads first.

Our CSS Flickers because of dynamic imports. However, I don't think that it should be dynamic because we're already know the name of the css to import. I just don't know how to inject the css to the js.

Relative references:

But, since you import your CSS dynamically, there is no way to avoid FOUC. Because the CSS is loaded after JS and after the DOM loaded

Currently we're building with vite as js and css file, but I don't know enough configurations to work around it. vite - How to bundle as a single JS and a single CSS file

One hack to do is SO - Eliminate flash of unstyled content

<style>
  html {
    visibility: hidden;
    opacity: 0;
  }
</style>

Then, at the end of your last .css stylesheet file, set the visibility and opacity styles to 'visible' and '1', respectively:

html {
  visibility: visible;
  opacity: 1;
}

Dev Problems

VIVO Android viewport height is half

Some SO questions also face the same problem