Skip to main content

Overview

What mounting an app does

A monolith is an ordinary Next app whose route trees are assembled from other apps.

Outline
  • Sections:
    • It mounts each app
    • It merges each app's config
    • It tells each app where it is
    • It checks they can live together
    • It refuses what it cannot serve
    • What an app has to give up

Read more

Starting a repository

These commands live in @fairgarden/distribution, which owns repository shape, submodules and versioning.

Outline
  • Sections:
    • A monolith repository
    • A module repository
    • Adding a module
    • Editing the config
    • Submodule URLs
    • Being cloneable is more than being https

Read more

Mounting

The committed symlinks under src/app/, src/pages/ and public/ are the source of truth.

Outline
  • Sections:
    • The two routers behave differently
    • Strategies
    • Assets
    • Two consequences worth knowing
    • Self-reference
    • When a module cannot be cloned

Read more

Routing

Each app's rewrites, redirects and headers are merged into the monolith's, with every source and destination moved under the app's mount.

Outline
  • Sections:
    • API routes move differently
    • Config that cannot be merged
    • Links are not rewritten

Read more

What a monolith can serve

Every mounted app's routes have to fit in one tree, and a path can only belong to one of them.

Outline
  • Sections:
    • An app at the site root
    • Collisions are refused, not resolved
    • Links are not prefixed for you

Read more

Next versions

A mounted app is not built on its own.

Outline
  • Sections:
    • The rule
    • What gets compared
    • Upgrading

Read more

Dependencies

Listing an app as a dependency of the monolith gets you most of the way.

Outline
  • Sections:
    • Merging
    • What gets taken
    • Other commands

Read more

Keeping modules up to date

Submodules and versions are handled by fg-dist, in @fairgarden/distribution.

Outline
  • Sections:
    • sync
    • bump
    • What counts as a version
    • Safety

Read more

Portability

An app does not have to know it is in a monolith, but it does have to avoid a few things.

Outline
  • Sections:
    • Config and conventions
    • Imports

Read more