Skip to main content

Functions

Functions by entry point

The functions each of the package's four entry points exports.

Outline
  • Sections:
    • @fairgarden/indicators
    • @fairgarden/indicators/withFairGardenIndicators
    • @fairgarden/indicators/link
    • @fairgarden/indicators/proxy

Read more

createIndicators

Declare what goes into the path.

Outline
  • Sections:
    • Config
    • An indicator
    • The result
    • Types

Read more

generateStaticParams

The variants to prerender, ready to export from a layout or page.

Outline
  • Sections:
    • What a segment list holds

Read more

read

What a route's params name.

Outline
  • Sections:
    • Not found
    • Notes

Read more

layout and page

read as a wrapper.

Outline
  • Sections:
    • Notes

Read more

encode and decode

The segment encoding, for an app that spells a segment itself: a custom generateStaticParams, a route directory that switches on a flag, a test.

Read more

href, splitLocale, negotiate

Locale-aware paths without React, for server code.

Outline
  • Sections:
    • href
    • splitLocale
    • negotiate

Read more

Helpers

The pieces createIndicators is built from, exported for tests and tooling.

Outline
  • Sections:
    • Negotiation
    • Paths
    • Routes
    • Constants

Read more

withFairGardenIndicators

Adds the rewrites, the redirects, the headers of the stylesheet indicators, and Accept-CH for the client hints they read.

Outline
  • Sections:
    • Options
    • Hard flags
    • What it detects
    • Why a separate entry point
    • In a monolith

Read more

createNavigation

Links and hooks that know which locale the page is in.

Outline
  • Sections:
    • Options
    • Link
    • useHref
    • useSetLocale
    • useIndicators and useLocale
    • usePref
    • Notes

Read more

createLocaleProxy

A proxy.ts that negotiates the locale at the site root, and matches nothing else.

Outline
  • Sections:
    • What it does at the root
    • Mounted
    • Notes

Read more