Skip to content

feat(ui): use FunctionSignature component#637

Open
avivkeller wants to merge 6 commits intomainfrom
functionsignature
Open

feat(ui): use FunctionSignature component#637
avivkeller wants to merge 6 commits intomainfrom
functionsignature

Conversation

@avivkeller
Copy link
Member

@avivkeller avivkeller commented Mar 3, 2026

cc @canerakdas


This PR changes the createPropertyTable function into a function that generates a FunctionSignature component layout

image

Copilot AI review requested due to automatic review settings March 3, 2026 14:40
@avivkeller avivkeller requested a review from a team as a code owner March 3, 2026 14:40
@vercel
Copy link

vercel bot commented Mar 3, 2026

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

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Mar 4, 2026 9:39pm

Request Review

@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 98.94907% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.90%. Comparing base (439cfad) to head (7f93929).

Files with missing lines Patch % Lines
src/generators/jsx-ast/utils/signature.mjs 71.42% 6 Missing ⚠️
src/generators/jsx-ast/utils/types.mjs 97.41% 3 Missing and 1 partial ⚠️
src/generators/jsx-ast/utils/buildContent.mjs 62.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #637      +/-   ##
==========================================
+ Coverage   73.87%   75.90%   +2.03%     
==========================================
  Files         145      145              
  Lines       12867    13735     +868     
  Branches      923      992      +69     
==========================================
+ Hits         9505    10426     +921     
+ Misses       3357     3303      -54     
- Partials        5        6       +1     

☔ 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.

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

web Generator

File Base Head Diff
fs.js 1.33 MB 1.18 MB -157.48 KB (-11.54%)
fs.html 1.28 MB 1.39 MB +110.51 KB (+8.43%)
crypto.js 1.24 MB 1.15 MB -86.51 KB (-6.82%)
crypto.html 982.99 KB 1.02 MB +64.64 KB (+6.58%)
http2.js 863.38 KB 803.22 KB -60.16 KB (-6.97%)
stream.js 909.94 KB 854.92 KB -55.02 KB (-6.05%)
http.js 742.94 KB 690.45 KB -52.50 KB (-7.07%)
quic.js 220.25 KB 169.25 KB -51.00 KB (-23.15%)
buffer.html 851.96 KB 901.86 KB +49.90 KB (+5.86%)
webcrypto.js 464.93 KB 421.98 KB -42.96 KB (-9.24%)
util.js 797.04 KB 754.46 KB -42.58 KB (-5.34%)
buffer.js 1.13 MB 1.09 MB -40.58 KB (-3.50%)
test.js 902.85 KB 862.58 KB -40.27 KB (-4.46%)
process.js 747.62 KB 709.55 KB -38.07 KB (-5.09%)
util.html 652.37 KB 689.83 KB +37.45 KB (+5.74%)
stream.html 818.67 KB 855.61 KB +36.94 KB (+4.51%)
test.html 698.88 KB 735.66 KB +36.79 KB (+5.26%)
net.js 321.67 KB 286.16 KB -35.51 KB (-11.04%)
webstreams.js 320.77 KB 285.65 KB -35.12 KB (-10.95%)
http2.html 732.85 KB 767.21 KB +34.37 KB (+4.69%)
perf_hooks.js 406.03 KB 374.36 KB -31.67 KB (-7.80%)
http.html 703.16 KB 733.33 KB +30.17 KB (+4.29%)
net.html 351.02 KB 379.49 KB +28.47 KB (+8.11%)
tls.js 349.36 KB 321.41 KB -27.96 KB (-8.00%)
diagnostics_channel.js 255.87 KB 228.45 KB -27.42 KB (-10.72%)
events.js 575.77 KB 550.02 KB -25.74 KB (-4.47%)
dns.js 292.44 KB 269.27 KB -23.17 KB (-7.92%)
tls.html 348.70 KB 371.57 KB +22.88 KB (+6.56%)
vm.js 465.46 KB 442.98 KB -22.48 KB (-4.83%)
vm.html 349.03 KB 368.91 KB +19.88 KB (+5.70%)
child_process.js 489.12 KB 469.27 KB -19.85 KB (-4.06%)
v8.js 355.28 KB 335.57 KB -19.72 KB (-5.55%)
worker_threads.js 420.88 KB 401.48 KB -19.40 KB (-4.61%)
webstreams.html 336.88 KB 355.64 KB +18.76 KB (+5.57%)
module.js 356.06 KB 337.48 KB -18.58 KB (-5.22%)
sqlite.js 253.13 KB 234.57 KB -18.56 KB (-7.33%)
child_process.html 362.32 KB 380.83 KB +18.51 KB (+5.11%)
sqlite.html 248.01 KB 266.44 KB +18.43 KB (+7.43%)
url.js 354.93 KB 336.89 KB -18.04 KB (-5.08%)
events.html 435.48 KB 453.14 KB +17.66 KB (+4.06%)
process.html 649.45 KB 665.15 KB +15.70 KB (+2.42%)
v8.html 304.12 KB 319.65 KB +15.53 KB (+5.11%)
zlib.js 334.44 KB 319.44 KB -15.00 KB (-4.49%)
diagnostics_channel.html 219.49 KB 234.19 KB +14.71 KB (+6.70%)
readline.js 238.88 KB 225.20 KB -13.68 KB (-5.73%)
module.html 311.51 KB 325.19 KB +13.68 KB (+4.39%)
url.html 333.41 KB 346.47 KB +13.07 KB (+3.92%)
readline.html 238.79 KB 250.49 KB +11.70 KB (+4.90%)
worker_threads.html 351.89 KB 363.30 KB +11.42 KB (+3.24%)
zlib.html 276.71 KB 288.02 KB +11.31 KB (+4.09%)
dgram.js 185.13 KB 173.86 KB -11.27 KB (-6.09%)
dns.html 282.66 KB 293.89 KB +11.23 KB (+3.97%)
perf_hooks.html 367.04 KB 378.19 KB +11.15 KB (+3.04%)
inspector.js 132.83 KB 122.14 KB -10.69 KB (-8.05%)
assert.js 467.59 KB 457.00 KB -10.59 KB (-2.27%)
cluster.js 206.89 KB 197.63 KB -9.26 KB (-4.48%)
os.js 116.35 KB 107.17 KB -9.18 KB (-7.89%)
styles.css 128.22 KB 137.01 KB +8.79 KB (+6.85%)
dgram.html 184.07 KB 192.35 KB +8.28 KB (+4.50%)
path.js 105.32 KB 97.48 KB -7.84 KB (-7.45%)
timers.js 107.83 KB 100.34 KB -7.48 KB (-6.94%)
webcrypto.html 520.66 KB 527.96 KB +7.30 KB (+1.40%)
timers.html 124.84 KB 131.96 KB +7.12 KB (+5.70%)
modules.js 158.25 KB 151.40 KB -6.85 KB (-4.33%)
assert.html 321.73 KB 328.46 KB +6.73 KB (+2.09%)
console.js 114.73 KB 108.50 KB -6.24 KB (-5.44%)
errors.js 413.90 KB 407.81 KB -6.08 KB (-1.47%)
os.html 135.54 KB 141.39 KB +5.85 KB (+4.32%)
console.html 139.68 KB 145.12 KB +5.44 KB (+3.89%)
path.html 132.36 KB 137.70 KB +5.33 KB (+4.03%)
tty.html 88.55 KB 93.87 KB +5.32 KB (+6.00%)
repl.js 215.37 KB 210.16 KB -5.21 KB (-2.42%)
async_context.js 194.18 KB 189.00 KB -5.18 KB (-2.67%)
tty.js 54.22 KB 49.24 KB -4.98 KB (-9.19%)
https.js 166.45 KB 161.70 KB -4.74 KB (-2.85%)
globals.js 141.34 KB 136.72 KB -4.62 KB (-3.27%)
inspector.html 165.18 KB 169.80 KB +4.62 KB (+2.80%)
cluster.html 189.82 KB 194.42 KB +4.60 KB (+2.42%)
repl.html 176.00 KB 180.18 KB +4.18 KB (+2.38%)
https.html 144.55 KB 148.67 KB +4.12 KB (+2.85%)
async_hooks.js 201.30 KB 197.25 KB -4.05 KB (-2.01%)
async_context.html 158.18 KB 162.04 KB +3.86 KB (+2.44%)
async_hooks.html 155.25 KB 158.37 KB +3.12 KB (+2.01%)
quic.html 354.05 KB 356.78 KB +2.74 KB (+0.77%)
wasi.js 44.80 KB 42.42 KB -2.38 KB (-5.32%)
single-executable-applications.js 88.42 KB 86.36 KB -2.06 KB (-2.33%)
querystring.js 33.03 KB 31.10 KB -1.93 KB (-5.84%)
domain.js 93.08 KB 91.16 KB -1.92 KB (-2.07%)
esm.js 139.78 KB 137.88 KB -1.90 KB (-1.36%)
punycode.js 30.24 KB 28.37 KB -1.87 KB (-6.19%)
single-executable-applications.html 103.87 KB 105.61 KB +1.75 KB (+1.68%)
querystring.html 61.01 KB 62.67 KB +1.66 KB (+2.73%)
wasi.html 66.59 KB 68.24 KB +1.64 KB (+2.47%)
domain.html 102.23 KB 103.74 KB +1.50 KB (+1.47%)
packages.js 126.24 KB 124.76 KB -1.48 KB (-1.17%)
tracing.js 78.85 KB 77.49 KB -1.36 KB (-1.72%)
modules.html 175.77 KB 176.86 KB +1.09 KB (+0.62%)
globals.html 225.84 KB 226.83 KB +1008.00 B (+0.44%)
string_decoder.html 53.34 KB 54.28 KB +964.00 B (+1.76%)
string_decoder.js 32.33 KB 31.45 KB -898.00 B (-2.71%)
errors.html 456.16 KB 456.71 KB +569.00 B (+0.12%)
punycode.html 61.39 KB 61.90 KB +522.00 B (+0.83%)
tracing.html 82.48 KB 82.98 KB +511.00 B (+0.61%)
esm.html 152.24 KB 152.66 KB +431.00 B (+0.28%)
packages.html 153.49 KB 153.11 KB -396.00 B (-0.25%)
cli.js 325.74 KB 325.40 KB -343.00 B (-0.10%)
addons.html 263.11 KB 262.88 KB -236.00 B (-0.09%)
debugger.html 53.61 KB 53.38 KB -236.00 B (-0.43%)
deprecations.html 495.03 KB 494.80 KB -236.00 B (-0.05%)
documentation.html 37.15 KB 36.92 KB -236.00 B (-0.62%)
embedding.html 58.52 KB 58.29 KB -236.00 B (-0.39%)
environment_variables.html 43.02 KB 42.79 KB -236.00 B (-0.54%)
index.html 35.24 KB 35.01 KB -236.00 B (-0.65%)
intl.html 57.19 KB 56.96 KB -236.00 B (-0.40%)
n-api.html 803.76 KB 803.53 KB -236.00 B (-0.03%)
report.html 174.89 KB 174.66 KB -236.00 B (-0.13%)
synopsis.html 41.74 KB 41.51 KB -236.00 B (-0.55%)
typescript.html 52.51 KB 52.28 KB -236.00 B (-0.44%)
permissions.html 54.08 KB 53.92 KB -162.00 B (-0.29%)
permissions.js 28.46 KB 28.57 KB +117.00 B (+0.40%)
addons.js 299.72 KB 299.74 KB +15.00 B (+0.00%)
debugger.js 31.09 KB 31.11 KB +15.00 B (+0.05%)
deprecations.js 313.75 KB 313.77 KB +15.00 B (+0.00%)
documentation.js 9.73 KB 9.74 KB +15.00 B (+0.15%)
environment_variables.js 15.13 KB 15.15 KB +15.00 B (+0.10%)
n-api.js 721.30 KB 721.32 KB +15.00 B (+0.00%)
report.js 188.54 KB 188.55 KB +15.00 B (+0.01%)
typescript.js 25.36 KB 25.38 KB +15.00 B (+0.06%)
embedding.js 37.28 KB 37.29 KB +10.00 B (+0.03%)
intl.js 37.07 KB 37.08 KB +10.00 B (+0.03%)
synopsis.js 15.71 KB 15.72 KB +10.00 B (+0.06%)
cli.html 488.10 KB 488.09 KB -5.00 B (-0.00%)
index.js 9.69 KB 9.69 KB -5.00 B (-0.05%)

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 updates the JSX AST generator to render typed Markdown lists using the FunctionSignature UI component layout instead of generating a raw HTML property table, aligning the output with the shared UI component library.

Changes:

  • Adds FunctionSignature to the web generator’s JSX import map.
  • Replaces the old property-table builder with new typed-list parsing utilities (types.mjs) and a createSignatureTable renderer that emits a FunctionSignature JSX element.
  • Renames/reshapes signature insertion utilities and updates call sites; bumps @node-core/ui-components to ^1.6.1.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/generators/web/constants.mjs Registers FunctionSignature for generated JSX imports.
src/generators/jsx-ast/utils/types.mjs New utilities to parse typed Markdown lists into structured items (name/type/description/children).
src/generators/jsx-ast/utils/signature.mjs Exposes insertSignatureCodeBlock and adds createSignatureTable that renders FunctionSignature.
src/generators/jsx-ast/utils/buildPropertyTable.mjs Removes the previous HTML table implementation.
src/generators/jsx-ast/utils/buildContent.mjs Switches typed-list transforms to createSignatureTable and updates signature insertion import/usage.
src/generators/jsx-ast/utils/buildBarProps.mjs Updates getFullName import to the new signature module.
package.json Bumps @node-core/ui-components to ^1.6.1.
npm-shrinkwrap.json Lockfile updates reflecting the dependency bump.
Files not reviewed (1)
  • npm-shrinkwrap.json: Language not supported

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

Copy link
Member

@canerakdas canerakdas left a comment

Choose a reason for hiding this comment

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

Looks great, thank you Aviv! I'm testing the design across different pages, but from an implementation standpoint, everything looks good to me 🐢

@ovflowd
Copy link
Member

ovflowd commented Mar 4, 2026

image

Missing the Attributes heading?

@ovflowd
Copy link
Member

ovflowd commented Mar 4, 2026

image

Shouldn't in this case it be considered a constructor? maybe not cause of no new qualifier, but I think the signature should be there before any text.

image

Still seeing cases of only return

@ovflowd
Copy link
Member

ovflowd commented Mar 4, 2026

image

When a method has no return, we should add : void

@avivkeller
Copy link
Member Author

Missing the Attributes heading?

Still seeing cases of only return

Fixed in the latest commit! I had my ternary backwards xD

When a method has no return, we should add : void

Added in the latest commit.

Shouldn't in this case it be considered a constructor? maybe not cause of no new qualifier, but I think the signature should be there before any text.

The source code of that entry is:

### `Resolver([options])`

<!-- YAML
...
-->

Create a new resolver.

* `options` {Object}
  * `timeout` {integer} Query timeout in milliseconds, or `-1` to use the
    default timeout.
  * `tries` {integer} The number of tries the resolver will try contacting
    each name server before giving up. **Default:** `4`
  * `maxTimeout` {integer} The max retry timeout, in milliseconds.
    **Default:** `0`, disabled.

Without the new quantifier, it's treated as a method. "Typed lists", as I call them, aren't processed immediately after the method heading, rather they are processed in the order in which they are received, so because the text appears before the list, it's shown before. This should be rectified in the source docs. I can probably add a rule to @node-core/remark-lint in the future.

@ovflowd
Copy link
Member

ovflowd commented Mar 4, 2026

This should be rectified in the source docs. I can probably add a rule to @node-core/remark-lint in the future.

I wonder if we can scan how common text before options happens and if yes, we could render it in some special thing to make it clear this a brief description about the thing. Or just a rule to not allow that 🤷

@ovflowd
Copy link
Member

ovflowd commented Mar 4, 2026

image image

Since the text on ToC for methods/classes/etc are in the IBM font, shouldn't they also be on the headings? 👀

@avivkeller
Copy link
Member Author

Since the text on ToC for methods/classes/etc are in the IBM font, shouldn't they also be on the headings? 👀

Extracted into #643, since that might require changes in other parts of the codebase

@ovflowd
Copy link
Member

ovflowd commented Mar 4, 2026

Just looked at the latest preview. Man, these docs look gorgeous... Except the index page lol

@avivkeller
Copy link
Member Author

Except the index page lol

#620

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.

Remodel (or remove) our parameter tables

4 participants