Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .changeset/ast-proptypes-imports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@react-docgen/core': patch
---

Recognize PropTypes imports from the parsed AST instead of scanning source text
with a potentially slow regular expression. Comments and string literals no
longer count as module imports.
3 changes: 3 additions & 0 deletions .changeset/calm-types-travel.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
---

Preserve function types wrapped in parentheses when parsing TypeScript unions.

Thanks [@sean0407](https://github.com/sean0407) for
[#1142](https://github.com/reactjs/react-docgen/pull/1142).
8 changes: 6 additions & 2 deletions .changeset/giant-worlds-swim.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
'react-docgen': major
---

Drop support for Node.js 20, 21 and 23
Drop support for Node.js 20, 21, 23, 25 and pre-LTS Node.js 26 releases.

Minimum Supported Node.js version is now 22.13.0
Supported Node.js versions are now:

- Node.js 22.13.0 or newer 22.x releases
- Node.js 24.11.0 or newer 24.x releases
- Node.js 26.13.0 (the first Node.js 26 LTS release) or newer stable releases
14 changes: 14 additions & 0 deletions .changeset/mixin-class-props.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'react-docgen': patch
'@react-docgen/typescript': patch
---

Extract TypeScript props from React class components extending mixin calls,
including aliased component bases and wrapped props. Preserve declared props
when a mixin receives unrelated generic arguments.

Ported from [#1145](https://github.com/reactjs/react-docgen/pull/1145) by
[@mfazekas](https://github.com/mfazekas), merged with follow-up fixes in
[#1157](https://github.com/reactjs/react-docgen/pull/1157). Shared regression
fixtures cover the legacy parser, TypeScript adapter, and TypeScript handlers
composed with the normalized Babel adapter.
10 changes: 10 additions & 0 deletions .changeset/neutral-imperative-callbacks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@react-docgen/core': patch
---

Document methods wrapped in React `useCallback` and exposed through
`useImperativeHandle`, preserving their parameters, return types, descriptions,
and async/generator modifiers across parser adapters.

Ported from [#1139](https://github.com/reactjs/react-docgen/pull/1139) by
[@askalf](https://github.com/askalf).
4 changes: 4 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"mode": "pre",
"tag": "alpha"
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Portable fixtures have one canonical source representation on every platform.
packages/integration-tests/cases/** text eol=lf
17 changes: 10 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@ on:
permissions: {}

env:
NODE_VERSION: 24
NODE_VERSION: 24.11.0

jobs:
tests:
strategy:
fail-fast: false
matrix:
node: ["22.13.0", "24", "25", "26"]
node: ["22.13.0", "24.11.0", "26.13.0", "^27.0.0-0"]
os: ["ubuntu"]
include:
- os: macos
node: "24"
node: "24.11.0"
- os: windows
node: "24"
node: "24.11.0"

name: Tests (Node.js v${{ matrix.node }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}-latest
Expand All @@ -38,16 +39,17 @@ jobs:
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version: ${{ matrix.node }}
check-latest: ${{ startsWith(matrix.node, '^') }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Unit tests with coverage
- name: Tests with coverage
if: "${{ matrix.node == env.NODE_VERSION }}"
run: pnpm test -- --coverage
run: pnpm test:coverage

- name: Unit tests
- name: Tests
if: "${{ matrix.node != env.NODE_VERSION }}"
run: pnpm test

Expand All @@ -57,6 +59,7 @@ jobs:
uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2
with:
parallel: true
file: coverage/lcov.info
flag-name: test-${{ matrix.os }}

finish:
Expand Down
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ We actively welcome your pull requests.
4. Ensure the test suite passes.
5. Make sure your code lints and typechecks.

## Tests and coverage

Run `pnpm test` for the package suites. Run `pnpm test:coverage` for the CI
coverage report at `coverage/lcov.info`. Coverage runs all package projects in
one Vitest process and resolves parser packages to their sources, so shared core
code exercised by adapter tests is included. The legacy coverage thresholds
remain enforced.

## Issues
We use GitHub issues to track public bugs. Please ensure your description is
clear and has sufficient instructions to be able to reproduce the issue.
Expand Down
Loading
Loading