[PR #943] [MERGED] fix: add next/offline shim with useOffline() hook #970

Closed
opened 2026-05-06 13:11:19 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/943
Author: @Divkix
Created: 4/28/2026
Status: Merged
Merged: 4/29/2026
Merged by: @james-elicx

Base: mainHead: fix/701-use-offline-shim


📝 Commits (3)

  • ef829af fix: add next/offline shim with useOffline() hook (#701)
  • 6913643 fix: address review feedback for next/offline shim
  • c2a4692 Apply suggestion from @james-elicx

📊 Changes

5 files changed (+36 additions, -0 deletions)

View changed files

📝 packages/vinext/src/check.ts (+4 -0)
📝 packages/vinext/src/index.ts (+1 -0)
📝 packages/vinext/src/shims/next-shims.d.ts (+4 -0)
packages/vinext/src/shims/offline.ts (+13 -0)
📝 tests/shims.test.ts (+14 -0)

📄 Description

Fixes #701

Summary

  • Added next/offline shim exporting useOffline() hook (returns false as no-op)
  • Registered in shim resolution map, type declarations, and import support check
  • Full offline retry behavior (navigation retry, prefetch pause/resume, OfflineProvider) deferred until the feature stabilizes upstream
  • Added unit tests for the shim export

Test plan

  • tests/shims.test.ts — 2 new tests verifying useOffline export exists and returns false
  • Full suite: 135 passed, 1 pre-existing flaky timeout in pages-router cleanup

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/943 **Author:** [@Divkix](https://github.com/Divkix) **Created:** 4/28/2026 **Status:** ✅ Merged **Merged:** 4/29/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `fix/701-use-offline-shim` --- ### 📝 Commits (3) - [`ef829af`](https://github.com/cloudflare/vinext/commit/ef829afa4dcc2eba0897116094a240132c186ab0) fix: add next/offline shim with useOffline() hook (#701) - [`6913643`](https://github.com/cloudflare/vinext/commit/6913643fbc346c9f9ca83333390aee2ede916165) fix: address review feedback for next/offline shim - [`c2a4692`](https://github.com/cloudflare/vinext/commit/c2a46924f2c644743d1d717dc482f0c22a02e10e) Apply suggestion from @james-elicx ### 📊 Changes **5 files changed** (+36 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/check.ts` (+4 -0) 📝 `packages/vinext/src/index.ts` (+1 -0) 📝 `packages/vinext/src/shims/next-shims.d.ts` (+4 -0) ➕ `packages/vinext/src/shims/offline.ts` (+13 -0) 📝 `tests/shims.test.ts` (+14 -0) </details> ### 📄 Description Fixes #701 ## Summary - Added `next/offline` shim exporting `useOffline()` hook (returns `false` as no-op) - Registered in shim resolution map, type declarations, and import support check - Full offline retry behavior (navigation retry, prefetch pause/resume, `OfflineProvider`) deferred until the feature stabilizes upstream - Added unit tests for the shim export ## Test plan - `tests/shims.test.ts` — 2 new tests verifying `useOffline` export exists and returns `false` - Full suite: 135 passed, 1 pre-existing flaky timeout in pages-router cleanup --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:11:19 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#970
No description provided.