Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency react-docgen to v6.0.4 #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Dec 29, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
react-docgen (source) 6.0.0-alpha.3 -> 6.0.4 age adoption passing confidence

Release Notes

reactjs/react-docgen (react-docgen)

v6.0.4

Compare Source

Patch Changes

v6.0.3

Compare Source

Patch Changes

v6.0.2

Compare Source

Patch Changes

v6.0.1

Compare Source

Patch Changes

v6.0.0

Compare Source

Major Changes
  • 96d6e9e
    Thanks @​danez! - Rename flowTypeHandler to
    codeTypeHandler because it handles Flow and TypeScript

  • #​719
    d7a39af
    Thanks @​danez! - Refactored
    resolveComponentDefinition utility.

    • Renamed to findComponentDefinition
    • Removed named export isComponentDefinition
    • The utility now does a lot more than previously, check out the commit to see
      the changes in detail.
  • #​761
    dfc2f85
    Thanks @​danez! - Renamed propDocBlockHandler to
    propDocblockHandler for consistency

  • 96d6e9e
    Thanks @​danez! - Simplify
    resolveObjectValuesToArray and remove type handling. None of the code that
    was handling types was used.

  • caae6bf
    Thanks @​danez! - The return values of
    resolveObjectValuesToArray are now in the order they are defined in the
    source code.

  • #​744
    e956802
    Thanks @​danez! - Removed match utility.

    The utility can be replaced by babel helpers and is not needed anymore. Also
    using explicit checks like path.isMemberExpression() is better for type
    safety and catching potential bugs.

  • 96d6e9e
    Thanks @​danez! - Migrate react-docgen to ES
    modules. Please read
    this

  • #​693
    3b28f6e
    Thanks @​danez! - The CLI was removed from
    react-docgen into its own package @react-docgen/cli.

    Check out https://react-docgen.dev/docs/getting-started/cli for the
    documentation.

  • 96d6e9e
    Thanks @​danez! - The main parse API had some
    breaking changes.

    • The arguments were changed from previously 5 to just 2. The following diff
      illustrates how to migrate:

      -parse(src, resolver, handlers, importer, options: { filename, ...babelOptions})
      +parse(src, { resolver, handlers, importer, filename, babelOptions: {} })
    • The return type is now always an array, independent of the resolver, even if
      only one component was found in the file.

  • #​786
    0a2481d
    Thanks @​danez! - Renamed the method toObject to
    build in the DocumentationBuilder.

    This method might be used by integrations.

  • 96d6e9e
    Thanks @​danez! - Renamed some of the main exports
    for clarity.

    Renamed handlers to builtinHandlers Renamed resolver to
    builtinResolvers Renamed importers to builtinImporters

  • #​743
    5215bab
    Thanks @​danez! - Removed support for the
    @extends React.Component annotation on react class components.

    Instead, you can use the new @component annotation or define your own
    annotation by creating a custom FindAnnotatedDefinitionsResolver instance

  • #​714
    80e4c74
    Thanks @​danez! - Renamed and migrated built-in
    resolvers to classes.

    • findAllComponentDefinitions was renamed to FindAllDefinitionsResolver
      and is now a class.

      -const resolver = builtinResolvers.findAllComponentDefinitions
      +const resolver = new builtinResolvers.FindAllDefinitionsResolver()
    • findAllExportedComponentDefinitions was renamed to
      FindExportedDefinitionsResolver and is now a class.

      -const resolver = builtinResolvers.findAllExportedComponentDefinitions
      +const resolver = new builtinResolvers.FindExportedDefinitionsResolver()
    • findExportedComponentDefinition was removed. Use
      FindExportedDefinitionsResolver with the limit option instead.

      This is still the default resolver.

      -const resolver = builtinResolvers.findExportedComponentDefinition
      +const resolver = new builtinResolvers.FindExportedDefinitionsResolver({ limit: 1 })
  • 96d6e9e
    Thanks @​danez! - Migrated to babel toolchain

    This is one of the big changes in this new version of react-docgen. It made
    the code a lot more robust because there are now finally working TypeScript
    types for the ASTs.

    Another benefit from this change is that react-docgen is now a lot faster. 🚀
    In some tests an improvement of nearly 50% was seen in comparison to
    version 5.

  • #​707
    d4c27d4
    Thanks @​danez! - Improve performance of file
    system importer.

    The file system importer now also caches the resolving of files in addition to
    parsing files. If the importer is used in an environment where files do change
    at runtime (like a watch command) then the caches will need to be cleared on
    every file change.

  • 96d6e9e
    Thanks @​danez! - Changed the minimum Node.js
    version to 14.18.0

Minor Changes
  • 96d6e9e
    Thanks @​danez! - Add support for .cts and .mts
    extension when using typescript

  • 96d6e9e
    Thanks @​danez! - Treat functions returning
    React.Children.map as components

  • 96d6e9e
    Thanks @​danez! - Improve performance by creating
    all visitors only once

  • 96d6e9e
    Thanks @​danez! - Support all possible kinds of
    functions in the displayNameHandler

  • #​786
    0a2481d
    Thanks @​danez! - Export the type for the
    DocumentationBuilder.

  • #​786
    0a2481d
    Thanks @​danez! - The types NodePath and
    babelTypes are now exported.

    These types are useful when building integrations in TypeScript.

    babelTypes includes all types from @babel/types.

  • #​714
    80e4c74
    Thanks @​danez! - Add the new ChainResolver which
    allows multiple resolvers to be chained.

    import { builtinResolvers } from 'react-docgen';
    
    const { ChainResolver } = builtinResolvers;
    const resolver = new ChainResolver([resolver1, resolver2], {
      chainingLogic: ChainResolver.Logic.ALL, // or ChainResolver.Logic.FIRST_FOUND,
    });
  • 96d6e9e
    Thanks @​danez! - Support all literal types in
    typescript

  • 96d6e9e
    Thanks @​danez! - Support flow qualified type names

  • 96d6e9e
    Thanks @​danez! - Support class and function
    declarations without identifier

  • 96d6e9e
    Thanks @​danez! - Support resolving of
    destructuring in resolveToValue

  • #​714
    80e4c74
    Thanks @​danez! - Allow resolvers to be classes in
    addition to functions.

    import type { ResolverClass, ResolverFunction } from 'react-docgen';
    
    // This was the only option until now
    const functionResolver: ResolverFunction = (file: FileState) => {
      //needs to return array of found components
    };
    
    // This is the new class resolver
    class MyResolver implements ResolverClass {
      resolve(file: FileState) {
        //needs to return array of found components
      }
    }
    
    const classResolver = new MyResolver();
  • 96d6e9e
    Thanks @​danez! - Improve performance drastically
    by making changes to AST traversal

    Visitors are now pre-exploded and are cached in the module scope instead of
    creating them on every call. This change brought the benchmark from 170ops/s
    to 225ops/sec

  • 96d6e9e
    Thanks @​danez! - Add codes to errors to be able to
    easily detect them

    There is a new export ERROR_CODES that contains all possible error codes.
    The two errors that have codes right now are:

    • MISSING_DEFINITION: No component found in a file
    • MULTIPLE_DEFINITIONS: Multiple components found in one file
  • 96d6e9e
    Thanks @​danez! - Support handling
    useImperativeHandle correctly

  • #​743
    5215bab
    Thanks @​danez! - Added a new resolver that finds
    annotated components. This resolver is also enabled by default.

    To use this feature simply annotated a component with @component.

    // @​component
    class MyComponent {}
Patch Changes

v6.0.0-rc.9

Compare Source

Patch Changes

v6.0.0-rc.8

Compare Source

Patch Changes

v6.0.0-rc.7

Compare Source

Major Changes
  • #​786
    0a2481d
    Thanks @​danez! - Renamed the method toObject to
    build in the DocumentationBuilder.

    This method might be used by integrations.

Minor Changes
  • #​786
    0a2481d
    Thanks @​danez! - Export the type for the
    DocumentationBuilder.

  • #​786
    0a2481d
    Thanks @​danez! - The types NodePath and
    babelTypes are now exported.

    These types are useful when building integrations in TypeScript.

    babelTypes includes all types from @babel/types.

Patch Changes

v6.0.0-beta.6

Compare Source

Major Changes
  • dfc2f85: Rename propDocBlockHandler to propDocblockHandler for consistency
Patch Changes
  • cc94da2: Fix using react-docgen in browsers
  • 98a1138: Add displayName and description to Documentation type

v6.0.0-beta.5

Compare Source

Major Changes
  • d7a39af: Refactored resolveComponentDefinition utility.

    • Renamed to findComponentDefinition
    • Removed named export isComponentDefinition
    • The utility now does a lot more than previously, check out the commit to see
      the changes in detail.
  • e956802: Remove match utility.

    The utility can be replaced by babel helpers and is not needed anymore. Also
    using explicit checks like path.isMemberExpression() is better for type
    safety and catching potential bugs.

  • 5215bab: Removed support for the @extends React.Component annotation on
    react class components.

    Instead you can use the new @component annotation.

  • 80e4c74: Renamed and migrated built-in resolvers to classes.

    • findAllComponentDefinitions was renamed to FindAllDefinitionsResolver
      and is now a class.

      -const resolver = builtinResolvers.findAllComponentDefinitions
      +const resolver = new builtinResolvers.FindAllDefinitionsResolver()
    • findAllExportedComponentDefinitions was renamed to
      FindExportedDefinitionsResolver and is now a class.

      -const resolver = builtinResolvers.findAllExportedComponentDefinitions
      +const resolver = new builtinResolvers.FindExportedDefinitionsResolver()
    • findExportedComponentDefinition was removed. Use
      FindExportedDefinitionsResolver with the limit option instead.

      This is still the default resolver.

      -const resolver = builtinResolvers.findExportedComponentDefinition
      +const resolver = new builtinResolvers.FindExportedDefinitionsResolver({ limit: 1 })
Minor Changes
  • 80e4c74: Add the new ChainResolver which allows multiple resolvers to be
    chained.

    import { builtinResolvers } from 'react-docgen';
    
    const { ChainResolver } = builtinResolvers;
    const resolver = new ChainResolver([resolver1, resolver2], {
      chainingLogic: ChainResolver.Logic.ALL, // or ChainResolver.Logic.FIRST_FOUND,
    });
  • 80e4c74: Allow resolvers to be classes in addition to functions.

    import type { ResolverClass, ResolverFunction } from 'react-docgen';
    
    // This was the only option until now
    const functionResolver: ResolverFunction = (file: FileState) => {
      //needs to return array of found components
    };
    
    // This is the new class resolver
    class MyResolver implements ResolverClass {
      resolve(file: FileState) {
        //needs to return array of found components
      }
    }
    
    const classResolver = new MyResolver();
  • 5215bab: Added a new resolver that finds annotated components. This resolver
    is also enabled by default.

    To use this feature simply annotated a component with @component.

    // @​component
    class MyComponent {}
Patch Changes
  • 8fe3dbf: Fix crash when using TypeScript mapped types
  • ea25b16: Handle cyclic references in PropTypes shape() and exact()
    methods.
  • 1aa0249: Handle typeof import('...') and typeof MyType.property correctly
    in TypeScript
  • 050313d: Correctly add LICENSE file to published packages
  • f6e4fe7: Update dependency strip-indent to v4

v6.0.0-alpha.4

Compare Source

Major Changes
  • 96d6e9e: Rename flowTypeHandler to codeTypeHandler because it handles Flow
    and TypeScript

  • 96d6e9e: Simplify resolveObjectValuesToArray and remove type handling. None
    of the code that was handling types was actually used.

  • caae6bf: The return values of resolveObjectValuesToArray are now in the
    order they are defined in the source code.

  • 96d6e9e: Migrate react-docgen to ES modules. Please read
    this

  • 3b28f6e: The CLI was removed from react-docgen into its own package
    @react-docgen/cli.

    Check out https://react-docgen.dev/docs/getting-started/cli/ for the
    documentation.

  • 96d6e9e: Main parse API was changed

    The main API changed and now includes only 2 arguments.

    -parse(src, resolver, handlers, importer, options)
    +parse(src, { resolver, handlers, importer, ... })
  • 96d6e9e: Renamed some of the main exports for clarity.

    Renamed handlers to builtinHandlers Renamed resolver to
    builtinResolvers Renamed importers to builtinImporters

  • 96d6e9e: Migrated to babel toolchain

    This is one of the big changes in this new version of react-docgen. It made
    the code a lot more robust because there are now finally working TypeScript
    types for the ASTs.

    Another benefit from this change that react-docgen is now a lot faster. 🚀 In
    some tests an improvement of nearly 50% was seen in comparison to version 5.

  • d4c27d4: Improve performance of file system importer.

    The file system importer now also caches resolving of files in addition to
    parsing files. If the importer is used in an environment where files do change
    at runtime (like a watch command) then the caches will need to be cleared on
    every file change.

  • 96d6e9e: Changed the minimum Node.js version to 14.18.0

Minor Changes
  • 96d6e9e: Add support for .cts and .mts extension when using typescript

  • 96d6e9e: Treat functions returning React.Children.map as components

  • 96d6e9e: Improve performance by creating all visitors only once

  • 96d6e9e: Support all possible kinds of functions in the displayNameHandler

  • 96d6e9e: Support all literal types in typescript

  • 96d6e9e: Support flow qualified type names

  • 96d6e9e: Support class and function declarations without identifier

  • 96d6e9e: Support resolving of destructurings in resolveToValue

  • 96d6e9e: Improve performance drastically by making changes to AST traversal

    Visitors are now pre-exploded and are cached in the module scope instead of
    creating them on every call. This change brought the benchmark from 170ops/s
    to 225ops/sec

  • 96d6e9e: Add codes to errors to be able to easily detect them

    There is a new export ERROR_CODES that contains all possible error codes.
    The two errors that have codes right now are:

    • MISSING_DEFINITION: No component found in file
    • MULTIPLE_DEFINITIONS: Multiple components found in one files
  • 96d6e9e: Support handling useImperativeHandle correctly

Patch Changes
  • 96d6e9e: Handle React.forwardRef calls without a function
  • 96d6e9e: Handle some edge cases in resolveToValue
  • 96d6e9e: Remove trailing commas and semicolons from raw values in the
    documentation
  • 96d6e9e: Parse jsdoc comments for TypeScript structs
  • 96d6e9e: Correctly handle ObjectProperties in isReactComponentMethod
  • 96d6e9e: Add support for TSAsExpressions when trying to stringify expressions

Configuration

📅 Schedule: Branch creation - "every weekend" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/react-docgen-6.x branch from 406f826 to 22a26fb Compare January 21, 2025 02:06
Copy link

trag-bot bot commented Jan 21, 2025

@trag-bot didn't find any issues in the code! ✅✨

Copy link

trag-bot bot commented Jan 21, 2025

Pull request summary

  • Updated the react-docgen package version from 6.0.0-alpha.3 to 6.0.4 in package.json and pnpm-lock.yaml.
  • Adjusted the peer dependency requirements for react in @mdx-js/react and @mdx-js/util to support versions >=16.
  • Removed the deprecated [email protected] package from pnpm-lock.yaml.
  • Updated the strip-indent package version from 3.0.0 to 4.0.0 in pnpm-lock.yaml.
  • Added new optional dependencies for various esbuild packages, updating their versions to 0.15.18.
  • Updated the storybook dependencies to include [email protected] in multiple places within pnpm-lock.yaml.
  • Removed the [email protected] package from pnpm-lock.yaml and updated to [email protected].
  • Updated the yargs package version from 16.2.0 to 17.7.1 in pnpm-lock.yaml.
  • Updated the esbuild version from 0.17.19 to 0.18.20 in pnpm-lock.yaml.
  • Cleaned up unused dependencies and ensured compatibility with Node.js versions across various packages.

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.

0 participants