[CORRUPTED] Synthetic Benchmark PR #30803 - refactor(web): extract isServer/isClient utility & upgrade Node.js to 22.12.0#359
Open
ofir-frd wants to merge 11 commits intobase_pr_30803_20260120_5105from
Conversation
…onment detection Centralize server/client environment detection by introducing a dedicated utility file instead of repeating `typeof window === 'undefined'` checks across the codebase. This improves code maintainability and consistency across 8 files with 15 occurrences. Closes langgenius#30802
Missed migration from the initial refactoring - removes local isClient variable definition and imports from the centralized utility.
- Update .nvmrc from 22.11.0 to 22.20.0 (lts-latest) - Update web/package.json engines from >=v22.11.0 to >=22.12.0 This fixes jsdom 27.3.0 + parse5 8.0.0 ESM compatibility issues. Node.js 22.12.0+ has require(esm) enabled by default, which allows CommonJS modules to require ES modules. Closes langgenius#30807
Removed documentation comments for server and client detection utilities.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Benchmark PR langgenius#30803
Type: Corrupted (contains bugs)
Original PR Title: refactor(web): extract isServer/isClient utility & upgrade Node.js to 22.12.0
Original PR Description: ## Summary
isServer/isClientutility at/web/utils/client.tstypeof window === 'undefined'across 9 files to use the new utilityWhy not use TanStack Query's
isServer?TanStack Query exports:
We don't need Deno detection because:
Changes
New File
web/utils/client.ts- ExportsisServerandisClientboolean constantsMigrated Files
featured-tools.tsxfeatured-triggers.tsxrag-tool-recommendations/index.tsxembedded-chatbot/header/index.tsxquery-client.tsxuse-trigger-events-limit-modal.tslist.tsxgtag.tsuse-query-params.tsNode.js Version Update
.nvmrc22.11.0→22.20.0web/package.jsonengines>=v22.11.0→>=22.12.0This fixes jsdom 27.3.0 + parse5 8.0.0 ESM compatibility. Node.js 22.12.0+ has
require(esm)enabled by default.Benefits
if (isServer)is clearer thanif (typeof window === 'undefined')'undefined'Test plan
pnpm lint:fixpassespnpm type-check:tsgopassespnpm testpasses (27/27 tests)Closes langgenius#30802
Closes langgenius#30807
Original PR URL: langgenius#30803
Compliance Violation