Repository navigation
fix(hotkeys): Skip the server label warning on runtimes without process - #223
Conversation
- The warning checks for `process` before reading NODE_ENV, so Workers no longer throw, and production builds still drop it. - The React client-only snippet formats inside a child component, so a Server Component parent can't pass in the server's label. - Quick starts mention setting the provider platform from the request.
🦋 Changeset detectedLatest commit: 21e35ef The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
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 |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Worker-safe server warning .changeset/server-warning-workers.md, .intent/review-state.json, packages/hotkeys/src/_server.ts, packages/hotkeys/tests/server-platform.test.ts |
warnServerPlatform checks that process exists before reading NODE_ENV. A test verifies that formatForDisplay('Mod+S') returns Ctrl+S when process is undefined. |
Provider platform guidance .intent/review-state.json, docs/framework/angular/quick-start.md, docs/framework/octane/quick-start.md, docs/framework/react/quick-start.md, docs/framework/solid/quick-start.md |
The server-rendering guidance in each quick start now says to set the provider’s platform from the request. |
React formatting example .intent/review-state.json, docs/framework/react/guides/formatting-display.md |
The example formats a hotkey in ShortcutLabel inside ClientOnly. The guidance notes that a parent may be a Next.js Server Component. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- TanStack/hotkeys#221: Adds the server-platform detection and formatter path that this change updates.
- TanStack/hotkeys#204: Changes React Server Component package boundaries; this change updates a formatting example for that boundary.
Suggested reviewers: schiller-manuel
Merge Risk: 
Minimal · up to 21e35
-
No actionable merge-blocking risk is identified in this change.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files. (7 skipped: 7 unsupported.)
-
Full details: Description check
-
Explanation
The description explains the implementation, test coverage, documentation updates, and changeset. It does not use the required
## 🎯 Changes,## ✅ Checklist, and## 🚀 Release Impactsections, and it omits the checklist items and explicit release-impact selection.Resolution
Reformat the description with all required template sections. Complete each checklist item and explicitly select the applicable release-impact option, including the generated changeset confirmation.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks the server’s gate,
No process? It can still format.
“Ctrl+S,” the shortcut hops,
Through client paths and platform props.
Quick-start pages mark the way.
🚀 Changeset Version Preview1 package(s) bumped directly, 17 bumped as dependents. 🟩 Patch bumps
|
@tanstack/alpine-hotkeys
@tanstack/angular-hotkeys
@tanstack/angular-hotkeys-devtools
@tanstack/ember-hotkeys
@tanstack/hotkeys
@tanstack/hotkeys-devtools
@tanstack/lit-hotkeys
@tanstack/octane-hotkeys
@tanstack/preact-hotkeys
@tanstack/preact-hotkeys-devtools
@tanstack/react-hotkeys
@tanstack/react-hotkeys-devtools
@tanstack/solid-hotkeys
@tanstack/solid-hotkeys-devtools
@tanstack/svelte-hotkeys
@tanstack/svelte-hotkeys-devtools
@tanstack/vue-hotkeys
@tanstack/vue-hotkeys-devtools
commit: |
Follow-up to #221.
warnServerPlatformcheckstypeof processbefore readingNODE_ENV. On runtimes withoutprocess, such as Cloudflare Workers without a bundler define, formatting a label during server rendering used to throw aReferenceError.NODE_ENVis still checked before the server check, so production builds still drop the warning (verified with an esbuild production bundle).process.ShortcutLabelchild. AformatForDisplaycall written directly as aClientOnlychild runs in the parent, which can be a Next.js Server Component.@tanstack/hotkeys.Summary by CodeRabbit
processglobal, including Cloudflare Workers.