feat(unist): simplify and optimize#929
Conversation
PR SummaryMedium Risk Overview Metadata parsing ( JSX/HAST transformer visits all node types so Layout is found for MDX; tables get GitHub alerts plugin is more defensive (requires parent/index) with clearer marker stripping; behavior unchanged. Legacy Shiki rehype plugin is refactored into Type annotation utilities and tests swap Reviewed by Cursor Bugbot for commit b10aa78. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #929 +/- ##
==========================================
+ Coverage 84.89% 85.34% +0.44%
==========================================
Files 193 193
Lines 17512 17846 +334
Branches 1551 1566 +15
==========================================
+ Hits 14867 15230 +363
+ Misses 2639 2610 -29
Partials 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8d89b04. Configure here.
|
| Metric | Base | Head | Diff |
|---|---|---|---|
| Elapsed time | 1.37 s | 1.36 s | -10.00 ms (-0.73%) |
| User CPU time | 2.83 s | 2.65 s | -180.00 ms (-6.36%) |
| System CPU time | 320.00 ms | 380.00 ms | +60.00 ms (+18.75%) |
| Peak resident memory | 351.20 MB | 356.81 MB | +5.61 MB (+1.60%) |
legacy-html Generator
Output size
| File | Base | Head | Diff |
|-|-|-|-|
| buffer.html | 1.09 MB | 1.07 MB | -17.58 KB (-1.58%) |
| fs.html | 1.06 MB | 1.04 MB | -16.77 KB (-1.55%) |
| process.html | 702.32 KB | 688.78 KB | -13.54 KB (-1.93%) |
| crypto.html | 1.09 MB | 1.07 MB | -11.61 KB (-1.04%) |
| http2.html | 770.96 KB | 763.74 KB | -7.21 KB (-0.94%) |
| events.html | 555.98 KB | 549.65 KB | -6.33 KB (-1.14%) |
| stream_iter.html | 464.96 KB | 458.80 KB | -6.15 KB (-1.32%) |
| assert.html | 473.18 KB | 467.02 KB | -6.15 KB (-1.30%) |
| test.html | 928.08 KB | 922.10 KB | -5.98 KB (-0.64%) |
| vm.html | 430.83 KB | 425.73 KB | -5.10 KB (-1.18%) |
| child_process.html | 443.89 KB | 438.79 KB | -5.10 KB (-1.15%) |
| diagnostics_channel.html | 323.68 KB | 318.58 KB | -5.10 KB (-1.57%) |
| stream.html | 854.55 KB | 849.61 KB | -4.94 KB (-0.58%) |
| module.html | 344.89 KB | 340.38 KB | -4.51 KB (-1.31%) |
| worker_threads.html | 402.11 KB | 397.67 KB | -4.44 KB (-1.10%) |
| http.html | 639.60 KB | 636.25 KB | -3.34 KB (-0.52%) |
| quic.html | 424.09 KB | 420.91 KB | -3.18 KB (-0.75%) |
| webstreams.html | 285.51 KB | 282.51 KB | -2.99 KB (-1.05%) |
| v8.html | 338.17 KB | 335.18 KB | -2.99 KB (-0.88%) |
| perf_hooks.html | 360.52 KB | 357.89 KB | -2.64 KB (-0.73%) |
| util.html | 742.60 KB | 740.02 KB | -2.58 KB (-0.35%) |
| async_hooks.html | 224.27 KB | 221.81 KB | -2.46 KB (-1.10%) |
| repl.html | 217.31 KB | 215.03 KB | -2.29 KB (-1.05%) |
| readline.html | 210.90 KB | 208.97 KB | -1.94 KB (-0.92%) |
| async_context.html | 238.19 KB | 236.26 KB | -1.93 KB (-0.81%) |
| zlib.html | 325.42 KB | 323.49 KB | -1.93 KB (-0.59%) |
| ffi.html | 91.43 KB | 89.66 KB | -1.77 KB (-1.93%) |
| sqlite.html | 231.71 KB | 229.95 KB | -1.76 KB (-0.76%) |
| url.html | 331.77 KB | 330.02 KB | -1.76 KB (-0.53%) |
| tls.html | 278.37 KB | 276.96 KB | -1.41 KB (-0.51%) |
| cluster.html | 200.71 KB | 199.31 KB | -1.41 KB (-0.70%) |
| dns.html | 225.69 KB | 224.28 KB | -1.41 KB (-0.62%) |
| vfs.html | 55.59 KB | 54.35 KB | -1.24 KB (-2.22%) |
| https.html | 158.72 KB | 157.49 KB | -1.23 KB (-0.78%) |
| timers.html | 92.44 KB | 91.21 KB | -1.23 KB (-1.33%) |
| net.html | 251.83 KB | 250.77 KB | -1.06 KB (-0.42%) |
| dgram.html | 171.89 KB | 170.83 KB | -1.05 KB (-0.61%) |
| deprecations.html | 288.42 KB | 287.54 KB | -905.00 B (-0.31%) |
| inspector.html | 119.04 KB | 118.16 KB | -903.00 B (-0.74%) |
| modules.html | 157.71 KB | 156.83 KB | -903.00 B (-0.56%) |
| tracing.html | 90.98 KB | 90.10 KB | -900.00 B (-0.97%) |
| packages.html | 152.89 KB | 152.19 KB | -724.00 B (-0.46%) |
| globals.html | 130.85 KB | 130.32 KB | -542.00 B (-0.40%) |
| cli.html | 323.05 KB | 322.52 KB | -541.00 B (-0.16%) |
| string_decoder.html | 41.20 KB | 40.67 KB | -540.00 B (-1.28%) |
| errors.html | 396.07 KB | 395.72 KB | -362.00 B (-0.09%) |
| console.html | 99.20 KB | 98.85 KB | -360.00 B (-0.35%) |
| dtls.html | 87.95 KB | 87.66 KB | -292.00 B (-0.32%) |
| addons.html | 354.98 KB | 354.80 KB | -181.00 B (-0.05%) |
| esm.html | 133.75 KB | 133.57 KB | -181.00 B (-0.13%) |
| single-executable-applications.html | 94.87 KB | 94.70 KB | -181.00 B (-0.19%) |
| webcrypto.html | 360.80 KB | 360.62 KB | -181.00 B (-0.05%) |
| os.html | 89.16 KB | 88.99 KB | -180.00 B (-0.20%) |
| path.html | 99.47 KB | 99.30 KB | -180.00 B (-0.18%) |
| wasi.html | 46.40 KB | 46.22 KB | -180.00 B (-0.38%) |
Performance
| Metric | Base | Head | Diff |
|---|---|---|---|
| Elapsed time | 20.14 s | 19.41 s | -730.00 ms (-3.62%) |
| User CPU time | 62.86 s | 65.24 s | +2.38 s (+3.79%) |
| System CPU time | 2.64 s | 2.48 s | -160.00 ms (-6.06%) |
| Peak resident memory | 2.17 GB | 2.23 GB | +66.08 MB (+2.98%) |
legacy-json Generator
Performance
| Metric | Base | Head | Diff |
|---|---|---|---|
| Elapsed time | 9.46 s | 8.58 s | -880.00 ms (-9.30%) |
| User CPU time | 27.76 s | 26.93 s | -830.00 ms (-2.99%) |
| System CPU time | 1.87 s | 1.90 s | +30.00 ms (+1.60%) |
| Peak resident memory | 1.58 GB | 1.64 GB | +63.01 MB (+3.89%) |
llms-txt Generator
Performance
| Metric | Base | Head | Diff |
|---|---|---|---|
| Elapsed time | 6.87 s | 8.40 s | +1.53 s (+22.27%) |
| User CPU time | 19.03 s | 23.01 s | +3.98 s (+20.91%) |
| System CPU time | 1.53 s | 1.94 s | +410.00 ms (+26.80%) |
| Peak resident memory | 1.71 GB | 1.64 GB | -66.90 MB (-3.83%) |
orama-db Generator
Output size
| File | Base | Head | Diff |
|-|-|-|-|
| orama-db.json | 8.90 MB | 8.90 MB | +1.00 B (+0.00%) |
Performance
| Metric | Base | Head | Diff |
|---|---|---|---|
| Elapsed time | 6.63 s | 8.35 s | +1.72 s (+25.94%) |
| User CPU time | 19.23 s | 25.31 s | +6.08 s (+31.62%) |
| System CPU time | 1.66 s | 1.85 s | +190.00 ms (+11.45%) |
| Peak resident memory | 1.82 GB | 1.67 GB | -159.46 MB (-8.55%) |
web Generator
Output size
| File | Base | Head | Diff |
|-|-|-|-|
| all.html | 21.28 MB | 21.28 MB | -202.00 B (-0.00%) |
Performance
| Metric | Base | Head | Diff |
|---|---|---|---|
| Elapsed time | 79.07 s | 76.33 s | -2.74 s (-3.47%) |
| User CPU time | 166.52 s | 161.78 s | -4.74 s (-2.85%) |
| System CPU time | 4.79 s | 4.83 s | +40.00 ms (+0.84%) |
| Peak resident memory | 5.56 GB | 6.30 GB | +755.92 MB (+13.27%) |

Description
This PR removes unnecessary
unist-util-find-afterandunist-util-selectdependencies by replacing their usage with existingunist-util-visittraversal logic.The changes include:
The overall goal is to reduce dependencies, simplify tree processing, and make AST transformations more predictable.
Validation
Validated by:
node --run test.node --run formatandnode --run lint.Reviewers should verify:
data-labelattributes.Related Issues
No related issue
Check List
node --run testand all tests passed.node --run format&node --run lint.Additional note