Skip to content

Replace ng5-slider with @angular-slider/ngx-slider#89

Open
weilixiong wants to merge 1 commit into
BAWES-Universe:masterfrom
weilixiong:upgrade/ngx-slider
Open

Replace ng5-slider with @angular-slider/ngx-slider#89
weilixiong wants to merge 1 commit into
BAWES-Universe:masterfrom
weilixiong:upgrade/ngx-slider

Conversation

@weilixiong
Copy link
Copy Markdown

@weilixiong weilixiong commented May 16, 2026

Summary

  • Replace abandoned ng5-slider with maintained fork @angular-slider/ngx-slider
  • Same API, drop-in replacement — no behavioral changes
  • Updates all imports, module registrations, HTML selectors, and SCSS class names

Files changed

  • package.json — package swap
  • 2 module files — Ng5SliderModuleNgxSliderModule
  • 3 component .ts files — Options import source
  • 2 HTML templates — <ng5-slider><ngx-slider>
  • global.scss — CSS class prefix

Closes #33

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Upgraded slider library and updated slider components across the application with corresponding style adjustments.

Review Change Stack

ng5-slider is abandoned and unsupported on Angular 16+.
Upgrade to the maintained fork with identical API.

Closes BAWES-Universe#33

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

📝 Walkthrough

Walkthrough

This PR replaces the abandoned ng5-slider package with the maintained fork @angular-slider/ngx-slider. Package dependency is swapped, module registrations are updated across three refinement components, templates swap slider elements while preserving bindings and event handlers, type imports reference the new package, and global styling selectors are renamed to match the new component.

Changes

Slider Library Upgrade

Layer / File(s) Summary
Dependency upgrade
package.json
Add @angular-slider/ngx-slider@^17.0.0 and remove deprecated ng5-slider@^1.2.6.
Age refinement component slider migration
src/app/components/age-refinement-list/age-refinement-list.component.ts, src/app/components/age-refinement-list/age-refinement-list.component.html, src/app/components/age-refinement-list/age-refinement-list.module.ts
Import Options from new package, register NgxSliderModule, and replace <ng5-slider> with <ngx-slider> in template while keeping [(value)], [(highValue)], event bindings, and [options] intact.
Range refinement component slider migration
src/app/components/range-refinement-list/range-refinement-list.ts, src/app/components/range-refinement-list/range-refinement-list.html, src/app/components/range-refinement-list/range-refinement-list.module.ts
Import Options from new package, register NgxSliderModule, and replace <ng5-slider> with <ngx-slider> in template while preserving dual-knob range bindings and handlers.
Date-range refinement component slider migration
src/app/components/date-range-refinement-list/date-range-refinement-list.component.ts
Update Options type import to @angular-slider/ngx-slider.
Slider component styling updates
src/global.scss
Rename CSS selectors from .ng5-slider, .ng5-slider-pointer, .ng5-slider-selection, and .ng5-slider-bubble to their .ngx-slider-* equivalents.

🎯 2 (Simple) | ⏱️ ~8 minutes

🐰 A library once five, now versioned at seventeen,
The sliders slide smoothly across all our scenes,
No logic did change, just the names took a turn,
From ng5 to ngx, old dependencies burn! 🎚️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: replacing ng5-slider with @angular-slider/ngx-slider.
Linked Issues check ✅ Passed All objectives from issue #33 are addressed: ng5-slider removed, ngx-slider installed, imports updated, template tags changed, and global styles adjusted.
Out of Scope Changes check ✅ Passed All changes are directly related to replacing ng5-slider with ngx-slider; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Line 63: The package.json currently adds "`@angular-slider/ngx-slider`" at
"^17.0.0" which is incompatible with this project's Angular 15; update the
dependency declaration for "`@angular-slider/ngx-slider`" to use the major-15
range (for example "^15.0.0") so it matches Angular 15 peer requirements; modify
the dependency entry in package.json (the "`@angular-slider/ngx-slider`" line) and
then run your package manager install to refresh lockfile and verify no
peer-dependency conflicts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 71dc7514-0b3a-4760-83ae-18c2537d9dff

📥 Commits

Reviewing files that changed from the base of the PR and between 39a33ff and 45cc622.

📒 Files selected for processing (9)
  • package.json
  • src/app/components/age-refinement-list/age-refinement-list.component.html
  • src/app/components/age-refinement-list/age-refinement-list.component.ts
  • src/app/components/age-refinement-list/age-refinement-list.module.ts
  • src/app/components/date-range-refinement-list/date-range-refinement-list.component.ts
  • src/app/components/range-refinement-list/range-refinement-list.html
  • src/app/components/range-refinement-list/range-refinement-list.module.ts
  • src/app/components/range-refinement-list/range-refinement-list.ts
  • src/global.scss

Comment thread package.json
"mixpanel-browser": "^2.45.0",
"moment": "^2.30.1",
"ng5-slider": "^1.2.6",
"@angular-slider/ngx-slider": "^17.0.0",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Project Angular core version range:"
jq -r '.dependencies["`@angular/core`"]' package.json

echo "Configured ngx-slider range:"
jq -r '.dependencies["`@angular-slider/ngx-slider`"]' package.json

echo "Peer dependencies for ngx-slider 17.0.0:"
curl -s https://registry.npmjs.org/@angular-slider/ngx-slider/17.0.0 | jq '.peerDependencies'

Repository: BAWES-Universe/studenthub-staff

Length of output: 293


🏁 Script executed:

#!/bin/bash

# Check if ngx-slider 15.0.0 exists and its peer dependencies
echo "Peer dependencies for ngx-slider 15.0.0:"
curl -s https://registry.npmjs.org/@angular-slider/ngx-slider/15.0.0 | jq '.peerDependencies'

# Also check available versions for ngx-slider
echo -e "\nAvailable ngx-slider versions (last 10):"
curl -s https://registry.npmjs.org/@angular-slider/ngx-slider | jq -r '.versions | keys | reverse | .[0:10]'

Repository: BAWES-Universe/studenthub-staff

Length of output: 372


Downgrade ngx-slider to major version 15.

Line 63 adds @angular-slider/ngx-slider@^17.0.0, but this project uses Angular 15 (see Lines 21-26). ngx-slider majors are aligned with Angular majors—version 17.0.0 requires @angular/core@^17.1.1, which will cause peer-dependency resolution failures. Downgrade to ^15.0.0:

Proposed fix
-    "`@angular-slider/ngx-slider`": "^17.0.0",
+    "`@angular-slider/ngx-slider`": "^15.0.0",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"@angular-slider/ngx-slider": "^17.0.0",
"`@angular-slider/ngx-slider`": "^15.0.0",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 63, The package.json currently adds
"`@angular-slider/ngx-slider`" at "^17.0.0" which is incompatible with this
project's Angular 15; update the dependency declaration for
"`@angular-slider/ngx-slider`" to use the major-15 range (for example "^15.0.0")
so it matches Angular 15 peer requirements; modify the dependency entry in
package.json (the "`@angular-slider/ngx-slider`" line) and then run your package
manager install to refresh lockfile and verify no peer-dependency conflicts.

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.

[UPGRADE] Replace ng5-slider with @angular-slider/ngx-slider

1 participant