weft
ir 2.6.0 · warp 1.8.0

A region that lives somewhere else

A shell is a fragment tree whose leaves are regions, and a region is a fragment that happens to render on another deployment.

shell — says search
→
registry: this process · a binding · another pod
→
REGION search
that one region degrades to its declared fallback the other four are untouched
The same region composed in-process and over a binding produces byte-identical markup — the test that fails first if the collapsed monolith becomes a special case.
✓ Valid A region naming itself

REGION carries the name the shell asked for, the contract it believes it serves, and the revision serving it — which is what makes the splice checkable.

✕ Refused a SHELL, COOKIE or PLAN from a region
what you wrote→those frames are the composite’s, not a region’s→E_REGION_FRAME

The refusal names the authority it would have borrowed, and that region degrades to its fallback.

In plain terms

A region is a slot whose renderer might live somewhere else. The shell names it, a registry says what is serving it right now, and what comes back is the same Warp frames every render here already produces. Rolling a region is a registry write, not a redeploy.

Micro-frontend orchestration is a product category with its own runtime, its own registry and its own failure modes. It should not be. A shell is a fragment tree whose leaves are regions, and a region is a fragment that happens to render on another deployment.

There is nothing to add. What crosses the boundary is a warp frame — the protocol every render already produces — so the composite does not learn a second runtime.

output

Results for olive oil, from the search deployment

  • Olive oil, 2L
  • Olive oil, 5L
app/fragments/examples/remote.tsx
import { fragment } from '@weftjs/core'

interface Hit {
  sku: string
  name: string
}

/**
 * A region: a fragment that happens to render on another deployment.
 *
 * There is nothing in this file about being remote, and there is nothing to add. What crosses the
 * boundary is a warp frame — the same protocol every render already produces — so the composite
 * embedding it does not learn a second runtime, and a failure over there degrades this one hole
 * rather than the page.
 */
export default fragment(({ query, hits }: { query: string; hits: Hit[] }) => (
  <section class="region" data-region="search">
    <p class="meta">
      Results for <strong>{query}</strong>, from the search deployment
    </p>
    <ul class="hits">
      {hits.map((hit) => (
        <li data-sku={hit.sku}>{hit.name}</li>
      ))}
    </ul>
  </section>
))
What the compiler knows
Holes2
Escape elided0
Effect setnone — static
Wire formshtml · bundle · split · patch · delta

Holes

BindingHoleEscape
querytextescape
hitslisttrusted-raw

What the client wires on adoption

No wiring: nothing on this template changes after it is painted, so the client attaches nothing to it.

Sealed templates
2
Version
848311be085c69637f7df64cf0323779

Three things that already existed

Already thereWhat it does for a region
ExecutorPort, and that it is a crash domainbinding: and svc: reach another deployment; a failure there degrades one region.
A registry, which is a portResolves the name search to whatever is serving search right now.
Warp frames, which every render already producesWhat comes back over the boundary is the protocol the composite already speaks downward.
New: the region checkFrames arriving from elsewhere are somebody else’s, and a length prefix does not say whose.

So composition is not a second runtime beside this one. It is the pieces already in the framework pointed at each other, plus the one check that a boundary needs and a local call does not.

A contract, and what happens when it breaks

A region declares what it composes and what it needs, and weft verify asks every registry entry what it is serving right now. A remote whose contract has moved is a build-time or deploy-time failure with both sides named, rather than an empty hole at 3am.

sketch — not compiled
weft verify           # what this deployment's registry says about every region a route composes
weft verify --probe   # ask each remote what it is serving right now

Failure is declared, not discovered

Every region says what the page does without it, and the two available answers are different promises. optional() means the failure is invisible and nobody is paged — right for recommendations. A declared placeholder means the page says one part of it is missing — right for a search box. A region marked critical that cannot be served is a refusal, because a checkout that silently loses its payment panel is worse than a 500.