Skip to content

feat: add deprecation warning#35

Open
trueberryless wants to merge 6 commits into
dependents-dev:mainfrom
trueberryless:feat/deprecation-info
Open

feat: add deprecation warning#35
trueberryless wants to merge 6 commits into
dependents-dev:mainfrom
trueberryless:feat/deprecation-info

Conversation

@trueberryless

@trueberryless trueberryless commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds a little warning symbol to deprecated packages near the name of the package in the list. To make it accessible, it also has a <title>Deprecated</title>, which shows on hover and gets picked up by screen readers.

Here is an example in the preview: https://pr-35-dependents-dev.gameroman.workers.dev/?package=qs

Summary by CodeRabbit

  • New Features
    • Added per-package deprecation detection during analysis, with progress updates for the deprecation-check phase.
    • Results now show a warning icon next to deprecated packages.
    • “Copy as Markdown” includes a Notes column with deprecation details when any results are deprecated.
  • Bug Fixes
    • Prevents outdated analysis results from updating the UI when a new analysis run starts.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@trueberryless, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 57 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e6644fec-4c78-429c-bde1-c6de0bce0a9f

📥 Commits

Reviewing files that changed from the base of the PR and between 54da82f and 2b274d8.

📒 Files selected for processing (1)
  • src/components/App.tsx
📝 Walkthrough

Walkthrough

Changes

Package analysis now checks deprecation status in batches, tracks it per result, adds deprecated-package notes to copied Markdown, and displays a warning icon beside deprecated packages in the results table.

Deprecation support and display

Layer / File(s) Summary
Analysis deprecation checks
src/components/App.tsx
Analysis results initialize a deprecated flag, query package deprecation status in batches, report progress, and ignore stale asynchronous updates.
Markdown deprecation notes
src/components/App.tsx
Copied Markdown conditionally includes a Notes column and deprecated-package note values.
Deprecated package indicator
src/components/App.tsx
The results table renders a warning icon beside deprecated package links.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant startAnalysis
  participant getPackageIsDeprecated
  participant copyAsMarkdown
  participant ResultsTable
  startAnalysis->>getPackageIsDeprecated: check package deprecation status in batches
  getPackageIsDeprecated-->>startAnalysis: return status
  startAnalysis->>copyAsMarkdown: provide results with deprecated flags
  copyAsMarkdown-->>copyAsMarkdown: add Notes column when needed
  startAnalysis->>ResultsTable: render results
  ResultsTable-->>ResultsTable: show warning icon for deprecated packages
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding deprecation warnings for packages.
Linked Issues check ✅ Passed The PR satisfies #12 by showing a small deprecated icon next to packages marked as deprecated.
Out of Scope Changes check ✅ Passed The additional Markdown notes and async guard logic support the deprecation feature and are not unrelated scope creep.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown

Preview deployment

✅ Deployment complete!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/components/App.tsx (1)

160-172: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Consider the N+1 API call pattern and silent error handling for deprecation checks.

Each item triggers a separate getPackageIsDeprecated HTTP request — up to 3000 for a full result set. While batching (chunks of 50) and cachedFetch mitigate repeat cost, the first analysis for a large package could be slow and risk registry rate-limiting. Additionally, .catch(() => false) on line 165 silently masks network and rate-limit errors as "not deprecated," which could produce incorrect results under load.

Two things worth considering:

  1. The DependentValueObject type added in api.ts (line 159) includes a deprecated field — if the dependents view data already contains this, you could read r.value.deprecated?.deprecated directly during getSortedDependents processing and avoid the N+1 calls entirely.
  2. If separate fetches remain necessary, consider logging or surfacing a count of failed deprecation checks so users know results may be incomplete.
🤖 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 `@src/components/App.tsx` around lines 160 - 172, The deprecation analysis loop
in App.tsx performs one request per item and silently treats failures as not
deprecated. Reuse the existing deprecated value from DependentValueObject during
getSortedDependents processing when available, removing unnecessary
getPackageIsDeprecated calls; otherwise retain the fetches but track and surface
failed checks instead of mapping errors silently to false.
🤖 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 `@src/components/App.tsx`:
- Around line 534-549: Update the deprecated icon SVG in the pkg.deprecated Show
block to include role="img" and aria-label="Deprecated" alongside its existing
title, matching the accessibility attributes used by the error icon.

---

Nitpick comments:
In `@src/components/App.tsx`:
- Around line 160-172: The deprecation analysis loop in App.tsx performs one
request per item and silently treats failures as not deprecated. Reuse the
existing deprecated value from DependentValueObject during getSortedDependents
processing when available, removing unnecessary getPackageIsDeprecated calls;
otherwise retain the fetches but track and surface failed checks instead of
mapping errors silently to false.
🪄 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 Plus

Run ID: c681d427-3648-4397-9fb4-2f9e3024f310

📥 Commits

Reviewing files that changed from the base of the PR and between 54da82f and 0f4c139.

📒 Files selected for processing (2)
  • src/components/App.tsx
  • src/lib/api.ts

Comment thread src/components/App.tsx

@gameroman gameroman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The icon looks nice

I was thinking about adding an extra column called "Note" instead,
where we would put stuff like "deprecated", "has a replacement", etc,
see example

Also left a couple of comments 😄

Comment thread src/lib/api.ts Outdated
Comment thread src/lib/api.ts Outdated
Comment thread src/lib/api.ts Outdated
Comment thread src/lib/api.ts Outdated
@trueberryless

Copy link
Copy Markdown
Contributor Author

I was thinking about adding an extra column called "Note" instead,
where we would put stuff like "deprecated", "has a replacement", etc,
see e18e/ecosystem-issues#261 (comment)

For now, I was deciding against this idea (because I was also thinking about it), because deprecated packages are very rare, which means we would have a column that is mostly empty. And I also wonder how often such a column would actually be filled with some info, even if we add more stuff like "has a replacement", "last updated...", etc.

IMHO a column should only be added if every package has associated info with it, which isn't the case here. That's why I am a little hesitant. Especially, because tables with many rows quickly become inaccessible on smaller devices as well...

trueberryless and others added 2 commits July 12, 2026 19:56
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@gameroman

Copy link
Copy Markdown
Member

I was thinking about adding an extra column called "Note" instead,
where we would put stuff like "deprecated", "has a replacement", etc,
see e18e/ecosystem-issues#261 (comment)

For now, I was deciding against this idea (because I was also thinking about it), because deprecated packages are very rare, which means we would have a column that is mostly empty.

I think it depends on the package, packages that have a replacement are more likely to have deprecated or replaceable dependents too

What I think we could do is keep the icon in the ui, but when "Copying as Markdown table", then, if a package has a note, add a Notes column, instead of copying an emoji

And I also wonder how often such a column would actually be filled with some info, even if we add more stuff like "has a replacement", "last updated...", etc.

IMHO a column should only be added if every package has associated info with it, which isn't the case here. That's why I am a little hesitant.

If no package in the table has any note, we could hide the column maybe? Don't know if that's a good idea though

Especially, because tables with many rows quickly become inaccessible on smaller devices as well...

Yeah, it's currently not very good on mobile, I think mobile needs some more improvements, maybe on mobile make it into cards or several rows instead of simple table

@gameroman

Copy link
Copy Markdown
Member

I think the best approach is to have icons, similar to npmx next to dependencies, and when "copied as markdown", then add a Notes column

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/components/App.tsx (1)

105-112: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Prevent race conditions from concurrent analysis executions.

The addition of the batched deprecation-check loop significantly increases the execution time of this function. Because there is no concurrency control, triggering the analysis multiple times (e.g., rapidly pressing Enter or toggling the devDependencies checkbox during an active load) will spawn concurrent executions. This can cause the progress bar to jump erratically and may lead to a race condition where a stale, slower request overwrites the final UI state.

Consider tracking the current request ID to abort stale executions.

🛠️ Proposed fix to ignore stale requests

Add a variable to track the active request at the top of your component (e.g., near line 38):

  const [copyBtnLabel, setCopyBtnLabel] = createSignal("Copy as Markdown");
+ let activeAnalysisId = 0;

Then, update startAnalysis to track and verify the ID before updating state:

   async function startAnalysis(replaceState = false) {
     const pkg = pkgInput().trim();
     if (!pkg) return;
 
+    const currentAnalysisId = ++activeAnalysisId;
     setLoading(true);
     setError("");
     setState({ status: "no-results" });
     onProgress(10, "Initializing...");
 
     try {
       // ... existing analysis and chunking logic ...
 
+      if (currentAnalysisId !== activeAnalysisId) return;
       setState(
         items.length > 0
           ? { status: "results", items }
           : { status: "no-results" },
       );
       onProgress(100, "Analysis complete");
     } catch (err) {
+      if (currentAnalysisId !== activeAnalysisId) return;
       console.error(err);
       setError((err as Error).message);
     } finally {
+      if (currentAnalysisId === activeAnalysisId) {
         setLoading(false);
+      }
     }
   }
🤖 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 `@src/components/App.tsx` around lines 105 - 112, Prevent concurrent
startAnalysis executions from updating shared UI state by adding an active
analysis ID variable in the component and incrementing it when a run begins.
Capture the run’s ID and guard all subsequent progress, loading, error, and
result updates so stale executions exit without overwriting the latest analysis
state.
🤖 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.

Nitpick comments:
In `@src/components/App.tsx`:
- Around line 105-112: Prevent concurrent startAnalysis executions from updating
shared UI state by adding an active analysis ID variable in the component and
incrementing it when a run begins. Capture the run’s ID and guard all subsequent
progress, loading, error, and result updates so stale executions exit without
overwriting the latest analysis state.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2481cf0d-a337-4c2a-8d7d-1548b97e9e04

📥 Commits

Reviewing files that changed from the base of the PR and between 0f4c139 and 82184db.

📒 Files selected for processing (1)
  • src/components/App.tsx

@trueberryless

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 58 minutes.

@gameroman gameroman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like our getPackageIsDeprecated is always returning 404 error for scoped packages

@trueberryless

Copy link
Copy Markdown
Contributor Author

Looks like our getPackageIsDeprecated is always returning 404 error for scoped packages

Seems to be an upstream bug? Even encoded URL is not_found: https://npm.devminer.xyz/live_registry/@astro%2Fstarlight

@TheDevMinerTV Could you maybe confirm this?

@gameroman gameroman added blocked Blocked due to an external factor feature New feature or request labels Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked Blocked due to an external factor feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show deprecated packages in list

2 participants