Skip to content

Conversation

@avivkeller
Copy link
Member

@avivkeller avivkeller commented Dec 19, 2025

Ref: https://gist.github.com/avivkeller/6bcb5fc17d72a3bed77744d4094949bd

The changes are backwards compared to the legacy implementation.

Copilot AI review requested due to automatic review settings December 19, 2025 22:40
@avivkeller avivkeller requested a review from a team as a code owner December 19, 2025 22:40
@vercel
Copy link

vercel bot commented Dec 19, 2025

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

Project Deployment Review Updated (UTC)
api-docs-tooling Ready Ready Preview Dec 19, 2025 10:43pm

@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.86%. Comparing base (e6e3f43) to head (5c99dd6).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/generators/jsx-ast/utils/buildContent.mjs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #524   +/-   ##
=======================================
  Coverage   79.86%   79.86%           
=======================================
  Files         121      121           
  Lines       11995    11995           
  Branches      839      839           
=======================================
  Hits         9580     9580           
  Misses       2412     2412           
  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.

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 attempts to fix the order of changes to match the legacy implementation by reversing the sort order. The changes modify the sorting logic to return newest-first order directly, eliminating the need for a separate .reverse() call.

Key changes:

  • Modified sortChanges function to swap comparison arguments, changing from ascending to descending sort order
  • Removed .reverse() call in buildContent.mjs since the sort order is now inverted at the source

Reviewed changes

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

File Description
src/utils/generators.mjs Swapped comparison arguments in sortChanges to produce descending order (newest first) instead of ascending
src/generators/jsx-ast/utils/buildContent.mjs Removed .reverse() call since sortChanges now returns newest-first order directly

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

@avivkeller
Copy link
Member Author

Note: The comparator could not run for this PR, as the diff (20k+ lines) was simply too large for a comment:
https://github.com/nodejs/doc-kit/actions/runs/20384428064/job/58582289227#step:6:4

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!

@avivkeller avivkeller changed the title fix(changes): reverse change order fix(legacy-json): reduce diff Dec 19, 2025
@avivkeller
Copy link
Member Author

@ovflowd Would you like me to make seperate PRs, or have all my changes regarding lessening the diff here?

@ovflowd
Copy link
Member

ovflowd commented Dec 19, 2025

@ovflowd Would you like me to make seperate PRs, or have all my changes regarding lessening the diff here?

Nah, one by one, easier to review!

@avivkeller avivkeller added the fast track This PR can land before the typical review time, with a :+1: from collaborators label Dec 19, 2025
@avivkeller
Copy link
Member Author

In that case, I'm fast-tracking this

@avivkeller avivkeller merged commit 053ab86 into main Dec 19, 2025
20 checks passed
@avivkeller avivkeller deleted the reverse-change-order branch December 19, 2025 23:41
@ovflowd
Copy link
Member

ovflowd commented Dec 20, 2025

In that case, I'm fast-tracking this

Please keep in mind you cannot self-fast-track PRs!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fast track This PR can land before the typical review time, with a :+1: from collaborators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants