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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@flyos/boot-overlay

v1.1.0

Published

Canonical FlyOS pre-bootstrap boot region for index.html — Native Federation stale-cache self-heal plus a three-state (waiting/stuck/failed) boot overlay — with a sync CLI that writes it into an app's index.html and verifies it in CI.

Downloads

436

Readme

@flyos/boot-overlay

The canonical FlyOS pre-bootstrap region for an app's index.html, plus a CLI that writes it into your file and verifies it in CI.

It carries two things that must exist before the first module loads:

  1. Native Federation stale-cache self-heal (window.__flyNfCacheHeal) — NF hashes shared singleton filenames by version, not content, so after a redeploy an immutable-cached _angular_core.<hash>.js imports a now-deleted @nf-internal/chunk-* and bootstrap dies. Only a {cache:'reload'} re-fetch defeats an already-cached entry, and the bundle that failed to import is exactly where a post-bootstrap handler would have lived. The same version-hashed filename also produces a second, quieter symptom: a cached bundle that predates the app chunk importing it resolves and fetches fine and merely lacks a symbol — does not provide an export named 'X'. isCacheError matches that wording too (Chrome, Safari and Firefox each phrase it differently).
  2. A three-state boot overlay (window.__flyBoot) covering polyfills → initFederation → shared bundles → the APP_INITIALIZER chain → blocking initial navigation.

Why a generated region instead of an import

This code cannot be a module: it exists to cover the wait for the modules, and to recover from an import that already failed. It has to be in the HTML the browser already has. What can be centralised is authorship — so the text lives here, each repo carries a generated copy between markers, and --check turns silent drift into a loud CI failure.

That drift was real, not hypothetical: before this package the same "PLATFORM CONTRACT — do not drop" block existed in four repos at three different revisions.

Install

npm i -D @flyos/boot-overlay

Add the markers to index.html — the CLI fills everything between them:

<head>
  <!-- fly-boot:head:start -->
  <!-- fly-boot:head:end -->
</head>
<body>
  <!-- fly-boot:body:start -->
  <!-- fly-boot:body:end -->
  <fly-root ngCspNonce="__CSP_NONCE__"></fly-root>
</body>
npx fly-boot-sync src/index.html            # write
npx fly-boot-sync --check src/index.html    # CI: exit 1 when stale

A file with no markers is an error, never a silent skip.

Wire the teardown — required

Nothing removes the overlay on its own. On your root component (not your authenticated shell — public routes must clear it too):

afterNextRender(() => window.__flyBoot?.done());

Forgetting it is survivable but not free: at 15s the watchdog checks whether <fly-root> has children and tears itself down if the app actually rendered, rather than covering a live UI for ever.

API

| Call | Effect | |------|--------| | done() | Fade and remove the node (not just hide it — a transparent full-screen layer swallows clicks). | | stuck() | Swap the spinner for "taking longer than usual" + Reload. | | fail(detail) | The same, plus the technical detail in a <pre>. |

window.onerror / unhandledrejection handlers are included and call maybeHeal first, staying silent when a heal reload is already in flight so the overlay covers the reload.

Behaviour worth knowing

  • 250ms delayed reveal. A boot faster than that paints nothing — a spinner glimpsed for 150ms reads as slower than a brief blank.
  • 15s watchdog. A splash with no way out is worse than the white screen it replaces: a dead bootstrap would spin for ever and read as "still working".
  • Theme before first paint from localStorage['user_settings'].theme. Apps that persist nothing get light, the platform default. Hardcoding a background reintroduces the white→dark flash for dark-mode users, because every app applies its persisted theme from an APP_INITIALIZER — the very end of the gap this covers.
  • Locale from user_settings.language, then <html lang>, then en. ar/ur render RTL.
  • The Reload button ships with static Reload text, which the script immediately replaces with the localised label. Nothing paints it — .fly-boot__panel is display:none until JS sets data-state — but an empty <button> is an error under @angular-eslint/template/elements-content, and every consumer lints index.html as an Angular template via the **/*.html block in @flyos/code-style. Deliberately not an aria-label: that would leave an English accessible name over an Arabic/French/Urdu visible one (WCAG 2.5.3).
  • The heal is a prod fix; in dev it costs one reload. ng serve bundles a shared singleton once at server start and never regenerates it on a watch rebuild, so adding an export to a shared package makes the app chunk import a symbol the served bundle lacks — the same wording the heal now matches. There the staleness is server-side, so the reload cannot fix it: expect one wasted reload (the 10-minute guard blocks a loop), then the failure panel. Restart the dev server.
  • CSP. Both blocks carry nonce="__CSP_NONCE__", which the platform nginx rewrites per request. Dropping the nonce is invisible in dev (no CSP) and fatal in prod.
  • Embedded mode. A federated remote's index.html is never loaded — the host document governs — so this is standalone-only in effect. In-shell, the equivalent wait is covered by the shell's own <fly-window-loading>.