Skip to content

feat(banner): add maintenance-mode banner to Amplify JavaScript v5 pages - #8620

Merged
soberm merged 2 commits into
aws-amplify:mainfrom
soberm:feat/js-v5-maintenance-banner
Aug 31, 2026
Merged

feat(banner): add maintenance-mode banner to Amplify JavaScript v5 pages#8620
soberm merged 2 commits into
aws-amplify:mainfrom
soberm:feat/js-v5-maintenance-banner

Conversation

@soberm

@soberm soberm commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Description of changes

Amplify JavaScript v5 is in maintenance mode, but the v5 documentation pages currently give readers no in-page signal of that, and no pointer to the upgrade path. Readers can land on a v5 page from search and follow deprecated guidance without realizing a newer major version exists.

This adds a maintenance-mode banner to all Amplify JavaScript v5 pages, linking to the v5 → v6 migration guide.

Banner copy:

JavaScript v5 — Amplify JavaScript v5 has entered maintenance mode. We recommend upgrading to v6. A migration guide is available to help you upgrade from v5 to v6.

Screenshot 2026-08-31 at 13 29 53

Implementation

  • src/components/JsV5MaintenanceBanner/ — new component. Follows Gen1Banner's conventions: takes currentPlatform and builds a root-relative, platform-aware link, so a reader on /gen1/vue/prev/... goes to the Vue guide and stays within the current environment (no jump to production docs from a preview build).
  • src/utils/isJsV5Page.ts — route detection. v5 pages live under /gen1/<platform>/prev/..., and which version prev resolves to is read from PLATFORM_VERSIONS (v5 for JS platforms, v1 for Android/Swift/Flutter) rather than inferred from the platform, so the banner can't outlive v5 when a platform's prev rolls forward.
  • src/components/Layout/Layout.tsx — renders the banner alongside the existing Gen1Banner / Gen2MaintenanceBanner calls.
  • src/styles/global-nav.scss — extracted shared %page-banner placeholders now used by all three banners (the styles were about to be duplicated a third time). The v5 banner is a deliberately lighter left-accented variant with an outlined badge, so it reads as a version-specific sub-notice beneath the Gen1 banner instead of a second identical amber banner. Net compiled CSS: 79,336 → 78,250 bytes.

Verification

Unit tests (9, new) — yarn test:unit:

PASS src/utils/__tests__/isJsV5Page.test.ts
PASS src/components/JsV5MaintenanceBanner/__tests__/JsV5MaintenanceBanner.test.tsx
Test Suites: 2 passed, 2 total
Tests:       9 passed, 9 total

Against a running dev server (next dev), inspecting rendered HTML:

  • Banner present on /gen1/react/prev/... and /gen1/javascript/prev/..., with a platform-correct root-relative href:
    <div class="js-v5-banner"><span class="js-v5-banner__badge">JavaScript v5</span><span class="js-v5-banner__text">Amplify JavaScript v5 has entered maintenance mode. We recommend upgrading to v6. A <a class="js-v5-banner__link" href="/gen1/react/build-a-backend/troubleshooting/migrate-from-javascript-v5-to-v6/">migration guide</a> is available to help you upgrade from v5 to v6.</span></div>
  • Banner absent (0 occurrences) on /gen1/react/build-a-backend/... (Gen 1, v6), /gen1/swift/prev/... (non-JS prev = v1), and /react/build-a-backend/... (Gen 2).
  • Link target returns HTTP 200 for all six JS platforms.
  • Refactor safety: compiled styles.scss before/after and compared effective declarations for every pre-existing banner selector (including dark-mode variants) — all identical; only declaration order changed.

eslint clean on changed files; prettier reports no changes wanted on any added line.

Not verified: no rendered screenshot — Playwright isn't available in my environment, so the visual claims come from compiled CSS + rendered HTML. Worth an eyeball on the preview build.

One open product question: unlike the Gen 1 banner, this copy names no end-of-life date, because I found no published EOL date for JS v5. If one is committed, that sentence should be added.

Checklist

  • PR description included
  • yarn test:unit passes
  • No documentation content changes (presentation/component change only)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Amplify JavaScript v5 is in maintenance mode, but v5 docs pages gave no
in-page signal or upgrade path. This adds a banner to all Amplify
JavaScript v5 pages pointing users at the v5 -> v6 migration guide.

v5 pages are the 'prev' version of the JS-family platforms and live under
/gen1/<js-platform>/prev/... (PLATFORM_VERSIONS maps prev -> v5 for every
JS platform), so detection is route-based and mirrors the existing
isGen1 check in Layout.

- JsV5MaintenanceBanner mirrors the existing Gen1Banner markup/styling
- isJsV5Page util for route detection, with unit tests
- rendered from Layout alongside the Gen1 banner
@soberm
soberm requested a review from a team as a code owner August 31, 2026 09:50
cadivus
cadivus previously approved these changes Aug 31, 2026

@osama-rizk osama-rizk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, well-scoped change and the detection logic is correct — I verified isJsV5Page returns true for all six JS platforms' prev routes and false for non-JS prev (v1), v6, gen2, and empty paths, and that Layout feeds it the real URL (consistent with isGen1). Test coverage is genuinely good for a banner.

One note on the description: it says this "mirrors the existing Gen 1 maintenance banner mechanism." It mirrors Gen1Banner's markup, but not its link style (Gen1Banner uses relative links) or its platform-awareness (Gen1Banner takes currentPlatform) — see the inline notes on the link.

Findings inline are all low-to-medium: one that matters for the next version cycle (route detection derives v5 from a proxy rather than PLATFORM_VERSIONS), a link-portability one (absolute prod URL for a same-site page), plus a few consistency/UX nits.

Comment thread src/utils/isJsV5Page.ts Outdated
Comment thread src/components/JsV5MaintenanceBanner/JsV5MaintenanceBanner.tsx Outdated
Comment thread src/components/JsV5MaintenanceBanner/JsV5MaintenanceBanner.tsx Outdated
Comment thread src/styles/global-nav.scss
Comment thread src/components/Layout/Layout.tsx Outdated
- isJsV5Page now reads PLATFORM_VERSIONS instead of inferring v5 from
  (gen1 + prev + JS platform), so the banner cannot outlive v5 when a
  platform's prev rolls forward. The 'prev' segment check is retained, as
  PLATFORM_VERSIONS alone cannot distinguish a prev route from a current one.
- Migration guide link is now root-relative, so preview/staging/localhost no
  longer jump to production docs, and navigation stays client-side.
- Banner takes currentPlatform and links within the reader's platform, matching
  Gen1Banner, rather than sending every reader to the javascript guide.
- Extracted %page-banner placeholders shared by the Gen1, Gen2 and v5 banners,
  collapsing the styles that were duplicated 3x. Computed styles for the two
  pre-existing banners are byte-identical (verified against compiled CSS).
- v5 banner is now a lighter left-accented variant with an outlined badge so it
  no longer reads as a second identical amber banner beneath the Gen1 banner.
@soberm

soberm commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review — all five inline findings are addressed in 6870fe2, with a reply on each thread.

@mergify

mergify Bot commented Aug 31, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@soberm
soberm merged commit 910ba2f into aws-amplify:main Aug 31, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants