Skip to content

Conversation

@AugustinMauroy
Copy link
Member

Description

I'm back here 😁

I was reading this page using beta so need to fix this issue

Validation

Capture d’écran 2025-12-13 à 11 46 47

Related Issues

close #419

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format & node --run lint.
  • I have build locally and see the changes
  • I've covered new added functionality with unit tests if necessary.

Copilot AI review requested due to automatic review settings December 13, 2025 10:48
@AugustinMauroy AugustinMauroy requested a review from a team as a code owner December 13, 2025 10:48
@vercel
Copy link

vercel bot commented Dec 13, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
api-docs-tooling Ready Ready Preview Jan 23, 2026 5:37pm

Request Review

Copy link
Contributor

Copilot AI left a comment

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 enhances the deprecation documentation generator to display different alert box colors based on the deprecation type. Instead of showing all deprecation types with a red "danger" alert, the system now maps "Documentation" and "End-of-Life (Compilation)" types to blue "info" alerts, "Runtime" and "Runtime (Application)" types to orange "warning" alerts, and falls back to red "danger" for other types.

  • Extracts and parses deprecation type text from various node types (text, inlineCode, links)
  • Implements conditional logic to map deprecation types to appropriate AlertBox severity levels
  • Adds comprehensive unit tests to verify the type-to-level mapping behavior

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/generators/jsx-ast/utils/buildContent.mjs Adds text extraction and type matching logic to determine AlertBox level based on deprecation type keywords
src/generators/jsx-ast/utils/tests/transformHeadingNode.test.mjs New test suite covering the three main code paths: info level (documentation), warning level (runtime), and danger level (fallback)

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

@codecov
Copy link

codecov bot commented Dec 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.72%. Comparing base (eefa365) to head (df57c7a).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #518      +/-   ##
==========================================
+ Coverage   79.97%   80.72%   +0.74%     
==========================================
  Files         127      128       +1     
  Lines       12276    12378     +102     
  Branches      866      887      +21     
==========================================
+ Hits         9818     9992     +174     
+ Misses       2455     2383      -72     
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@avivkeller
Copy link
Member

@AugustinMauroy Can you rebase so that #517 compares the build size here?

@github-actions
Copy link

github-actions bot commented Dec 15, 2025

web Generator

File Base Head Diff
deprecations.html 471.63 KB 471.57 KB -59.00 B (-0.01%)
deprecations.js 256.87 KB 256.81 KB -59.00 B (-0.02%)

Copy link
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

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

I'm putting an explicit blocker on this until:

  1. Either transformNodeToString is used, or nodes[0].value is used. nodes[0].value should be sufficient, since the node immediately following the prefix slicing is the deprecation type.

  2. getLevelFromDeprecationType does not use .includes to find words. This is extremely prone to false positives. I'd prefer using nodes[0].value.startsWith or similar, since we know the nodes should start with the type.

    • While it's possible (and I haven't checked) that some nodes don't follow this rule due to inconsistencies in core, I'd much rather fix those inconsistencies in core, than make a too-loose check here.

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

SGTM but left some comments.

ovflowd

This comment was marked as resolved.

@ovflowd

This comment was marked as resolved.

@AugustinMauroy

This comment was marked as resolved.

@AugustinMauroy

This comment was marked as resolved.

@ovflowd

This comment was marked as resolved.

@AugustinMauroy

This comment was marked as resolved.

@ovflowd

This comment was marked as resolved.

@ovflowd

This comment was marked as resolved.

Co-Authored-By: Aviv Keller <me@aviv.sh>
Co-Authored-By: Claudio Wunder <cwunder@gnome.org>
@ovflowd ovflowd force-pushed the augustin/deprecation-alert-box-level branch from d9dae9f to df57c7a Compare January 23, 2026 17:36
@ovflowd ovflowd dismissed their stale review January 23, 2026 17:36

Rebased

@ovflowd
Copy link
Member

ovflowd commented Jan 23, 2026

I was able to fix it,

  • Removed the merge commit
  • Squashed original commits
  • Rebased with main

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

SGTM!

cc @avivkeller could you give a re-review?

@avivkeller avivkeller merged commit 19ee2df into main Jan 23, 2026
21 checks passed
@avivkeller avivkeller deleted the augustin/deprecation-alert-box-level branch January 23, 2026 18:01
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.

Depreacation page is "to red"

4 participants