Skip to content

feat(micro-frontend): canonicalize global registry compatibility - #362

Merged
gronxb merged 15 commits into
v2from
codex/canonical-micro-frontend-global-compat
Aug 21, 2026
Merged

feat(micro-frontend): canonicalize global registry compatibility#362
gronxb merged 15 commits into
v2from
codex/canonical-micro-frontend-global-compat

Conversation

@gronxb

@gronxb gronxb commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR makes global.__MICRO_FRONTEND__ the only micro-frontend global registry.

The canonical global has exactly three enumerable fields:

  • __INSTANCES__
  • __SHARED__
  • __CONTAINERS__

The retired private-global identifier has 0 occurrences across the repository and the packed artifact.

Internal Lifecycle Fields

The canonical context also owns internal lifecycle state through non-enumerable fields:

  • dispose
  • disposeCallbacksByApp
  • pendingHostComponentStore

There is no standalone pending-host store global.

Terminology

Legacy means the indexed registry contract composed of __INSTANCES__ and __SHARED__. It does not mean a separate global.

Compatible means code that bootstraps and uses the canonical global.__MICRO_FRONTEND__ registry.

Support Matrix

Host Remote Status Notes
legacy legacy Supported Uses the indexed registry contract.
compatible compatible Supported Uses canonical global.__MICRO_FRONTEND__.
compatible legacy Supported Same app name is required.
legacy compatible Supported Same app name is required.

Product-specific app-name remapping is unsupported.

Runtime Lifecycle

  • Last-session close runs registered dispose callbacks.
  • Evaluation, container, and module state are retained after last close.
  • Reopening the same app reuses the retained evaluation; the observed evaluation count remains 1.

Compatibility Highlights

  • Shared module and container registration are transactional: failed writes roll back without leaving half-visible registry state.
  • Direct runtime and generated bundle paths share the same atomicity rules.
  • Immutable, frozen, symbol-keyed, non-enumerable, callable, and nullish-default module exports are preserved through legacy-compatible facades without mutating the original module object.
  • Duplicate shared modules or independently registered same-name containers are rejected deterministically instead of being silently overwritten.

Verification

  • @granite-js/micro-frontend scoped tests: 27 files / 147 tests.
  • Legacy @granite-js/plugin-micro-frontend scoped tests: 4 files / 13 tests.
  • Mpack resolver tests: 1 file / 1 test.
  • @granite-js/micro-frontend tests, typecheck, and build passed.
  • Legacy package tests, typecheck, and build passed.
  • Mpack typecheck passed.
  • Built banner verification confirmed exactly the three canonical enumerable keys and the non-enumerable lifecycle fields.
  • Packed artifact SHA-256: 7702eb99e9ef9fbe3c931007d331e3fd66c1dee061f251720f2420905e6cba22.
  • Packed artifact stale fixture and pre-compatibility entries: 0.
  • Runtime lifecycle verification confirmed last-session dispose callbacks run while evaluation, container, and modules are retained, with reopen evaluation count 1.

@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
granite-docs Ready Ready Preview Aug 21, 2026 2:20am

Request Review

@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5657c58

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 29 packages
Name Type
@granite-js/micro-frontend Patch
babel-preset-granite Patch
create-granite-app Patch
@granite-js/blur-view Patch
@granite-js/brownfield-module Patch
@granite-js/cli Patch
@granite-js/cookies Patch
@granite-js/screen Patch
@granite-js/image Patch
@granite-js/jest Patch
@granite-js/lottie Patch
@granite-js/mpack Patch
@granite-js/native Patch
@granite-js/naver-map Patch
@granite-js/plugin-core Patch
@granite-js/plugin-env Patch
@granite-js/plugin-hermes Patch
@granite-js/plugin-micro-frontend Patch
@granite-js/plugin-router Patch
@granite-js/plugin-rozenite Patch
@granite-js/plugin-sentry Patch
@granite-js/react-native Patch
@granite-js/style-utils Patch
@granite-js/utils Patch
@granite-js/video Patch
@granite-js/vitest Patch
@granite-js/deployment-manager Patch
@granite-js/forge-cli Patch
@granite-js/pulumi-aws Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Aug 20, 2026

Copy link
Copy Markdown
@granite-js/deployment-manager

yarn add https://pkg.pr.new/@granite-js/deployment-manager@362.tgz

@granite-js/forge-cli

yarn add https://pkg.pr.new/@granite-js/forge-cli@362.tgz

@granite-js/pulumi-aws

yarn add https://pkg.pr.new/@granite-js/pulumi-aws@362.tgz

babel-preset-granite

yarn add https://pkg.pr.new/babel-preset-granite@362.tgz

@granite-js/blur-view

yarn add https://pkg.pr.new/@granite-js/blur-view@362.tgz

@granite-js/brownfield-module

yarn add https://pkg.pr.new/@granite-js/brownfield-module@362.tgz

@granite-js/cli

yarn add https://pkg.pr.new/@granite-js/cli@362.tgz

@granite-js/cookies

yarn add https://pkg.pr.new/@granite-js/cookies@362.tgz

create-granite-app

yarn add https://pkg.pr.new/create-granite-app@362.tgz

@granite-js/screen

yarn add https://pkg.pr.new/@granite-js/screen@362.tgz

@granite-js/image

yarn add https://pkg.pr.new/@granite-js/image@362.tgz

@granite-js/jest

yarn add https://pkg.pr.new/@granite-js/jest@362.tgz

@granite-js/lottie

yarn add https://pkg.pr.new/@granite-js/lottie@362.tgz

@granite-js/micro-frontend

yarn add https://pkg.pr.new/@granite-js/micro-frontend@362.tgz

@granite-js/mpack

yarn add https://pkg.pr.new/@granite-js/mpack@362.tgz

@granite-js/native

yarn add https://pkg.pr.new/@granite-js/native@362.tgz

@granite-js/naver-map

yarn add https://pkg.pr.new/@granite-js/naver-map@362.tgz

@granite-js/plugin-core

yarn add https://pkg.pr.new/@granite-js/plugin-core@362.tgz

@granite-js/plugin-env

yarn add https://pkg.pr.new/@granite-js/plugin-env@362.tgz

@granite-js/plugin-hermes

yarn add https://pkg.pr.new/@granite-js/plugin-hermes@362.tgz

@granite-js/plugin-micro-frontend

yarn add https://pkg.pr.new/@granite-js/plugin-micro-frontend@362.tgz

@granite-js/plugin-router

yarn add https://pkg.pr.new/@granite-js/plugin-router@362.tgz

@granite-js/plugin-rozenite

yarn add https://pkg.pr.new/@granite-js/plugin-rozenite@362.tgz

@granite-js/plugin-sentry

yarn add https://pkg.pr.new/@granite-js/plugin-sentry@362.tgz

@granite-js/react-native

yarn add https://pkg.pr.new/@granite-js/react-native@362.tgz

@granite-js/style-utils

yarn add https://pkg.pr.new/@granite-js/style-utils@362.tgz

@granite-js/utils

yarn add https://pkg.pr.new/@granite-js/utils@362.tgz

@granite-js/video

yarn add https://pkg.pr.new/@granite-js/video@362.tgz

@granite-js/vitest

yarn add https://pkg.pr.new/@granite-js/vitest@362.tgz

commit: 5657c58

@gronxb
gronxb merged commit 975c8cf into v2 Aug 21, 2026
9 checks passed
@gronxb
gronxb deleted the codex/canonical-micro-frontend-global-compat branch August 21, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants