Skip to content

fix: ssr compatibility (#DS-3964)#1108

Merged
artembelik merged 3 commits into
mainfrom
fix/DS-3964
Nov 12, 2025
Merged

fix: ssr compatibility (#DS-3964)#1108
artembelik merged 3 commits into
mainfrom
fix/DS-3964

Conversation

@artembelik

Copy link
Copy Markdown
Contributor

No description provided.

@artembelik artembelik self-assigned this Nov 10, 2025
@artembelik artembelik added the bug Something isn't working label Nov 10, 2025
@github-actions

github-actions Bot commented Nov 10, 2025

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit e0781e2):

https://koobiq-next--prs-1108-gkfgfc4n.web.app

(expires Mon, 17 Nov 2025 13:43:27 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c9e37e518febda70d0317d07e8ceb35ac43c534c

@artembelik artembelik marked this pull request as ready for review November 11, 2025 08:09
@artembelik artembelik requested a review from NikGurev as a code owner November 11, 2025 08:09
Copilot AI review requested due to automatic review settings November 11, 2025 08:09

Copilot AI 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.

Pull Request Overview

This PR adds Server-Side Rendering (SSR) compatibility to multiple components by ensuring browser-specific APIs are not accessed during SSR. The changes include:

  • Adding an isFunction utility to check for DOM API availability
  • Wrapping DOM API calls with SSR-safe checks
  • Deferring browser-specific operations using afterNextRender

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/components/core/utils/utils.ts Adds new isFunction utility for checking if a value is a function
packages/components/core/option/option.ts Adds SSR checks to getHeight() and renames element to elementRef for consistency
packages/components/tree/tree-selection.component.ts Adds SSR compatibility check in getHeight() method
packages/components/tree/tree-option.component.ts Adds SSR compatibility check in getHeight() method and @docs-private annotation
packages/components/list/list-selection.component.ts Adds SSR compatibility checks in getHeight() methods for both selection and option components
packages/components/navbar/navbar.component.ts Adds SSR compatibility check in width getter
packages/components/scrollbar/scrollbar.directive.ts Refines ESLint disable comments to be more specific
packages/components/filter-bar/pipes/base-pipe.ts Defers isMac() call to afterNextRender and improves documentation
packages/components/filter-bar/pipes/pipe-title.ts Moves MutationObserver initialization to afterNextRender for SSR compatibility
packages/components/modal/modal-util.ts Makes document parameter optional and adds conditional checks for SSR
Comments suppressed due to low confidence (1)

packages/components/filter-bar/pipes/pipe-title.ts:92

  • The mutationSubscription may be EMPTY when ngOnDestroy is called if the component is destroyed before afterNextRender executes (SSR scenario). While Subscription.EMPTY.unsubscribe() is safe, the code assumes subscription is initialized. Consider adding a nullish check or ensuring mutationSubscription is properly initialized.
        this.mutationSubscription.unsubscribe();

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@artembelik artembelik merged commit 959c8c4 into main Nov 12, 2025
8 checks passed
@artembelik artembelik deleted the fix/DS-3964 branch November 12, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants