Skip to content

Need updated topology dependencies #274

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

Closed
jpinsonneau opened this issue Feb 13, 2025 · 7 comments
Closed

Need updated topology dependencies #274

jpinsonneau opened this issue Feb 13, 2025 · 7 comments

Comments

@jpinsonneau
Copy link
Collaborator

@patternfly/react-topology is not updated since 6.1.0 and imports the old core dependency which uses useId hook that is not supported by React 17

See patternfly/patternfly-react#11351 (comment)

@nicolethoen
Copy link
Contributor

@jpinsonneau
Topology has the following dependencies all using a ^ for semantic versioning:

        "@patternfly/react-core": "^6.0.0",
        "@patternfly/react-icons": "^6.0.0",
        "@patternfly/react-styles": "^6.0.0",

which should mean that you can use any 6.x version of @patternfly/react-core.
Have you tried explicitly using the latest 6.1.0 version of @patternfly/react-core? You might have to force your package manager to pull in the higher version.

We use semver this way because it means that people can pull in changes to extensions like topology without needing to necessarily bump to higher versions of @patternfly/react-core but if you need a particular version of @patternfly/react-core, it should work as long as its the same major version required by topology.

@jpinsonneau
Copy link
Collaborator Author

Digging into react-topology dependency, you can see that it's actually calling 6.1.0 version of react-core whatever the version mentionned in my package.json is:
Image

Which contains a React.useId call in card header:
Image

$ npm explain @patternfly/react-core
@patternfly/[email protected]
node_modules/@patternfly/react-core
  @patternfly/react-core@"^6.2.0-prerelease.18" from the root project
  @patternfly/react-core@"^6.2.0-prerelease.18" from @patternfly/[email protected]
  node_modules/@patternfly/react-drag-drop
    @patternfly/react-drag-drop@"^6.2.0-prerelease.20" from the root project
  @patternfly/react-core@"^6.2.0-prerelease.18" from @patternfly/[email protected]
  node_modules/@patternfly/react-table
    @patternfly/react-table@"^6.2.0-prerelease.19" from the root project

@patternfly/[email protected]
node_modules/@patternfly/react-topology/node_modules/@patternfly/react-core
  @patternfly/react-core@"^6.0.0" from @patternfly/[email protected]
  node_modules/@patternfly/react-topology
    @patternfly/react-topology@"^6.2.0-prerelease.3" from the root project

FYI I'm using npm version 9.3.1 and node 16.14.2
"@patternfly/react-core": "^6.1.1-prerelease.1" (also tried with 6.2.0-prerelease)
"@patternfly/react-topology": "^6.1.0" (also tried with 6.2.0-prerelease)

@jpinsonneau
Copy link
Collaborator Author

Comparing to other @patternfly packages you can see that react-topology is not importing the right dependencies:

Image

@nicolethoen
Copy link
Contributor

Ah - I think I see.

If you are trying to pull in a patternfly prerelease to your codebase, I think semver is going to run into some problems.
@patternfly/react-drag-drop is in a mono-repo with @patternfly/react-core so it's prerelease versions are going to increment differently than @patternfly/react-topology which is not in that same mono-repo.

PatternFly is approaching a code freeze and release of 6.2.0 at the end of March and if you pull in the @patternfly/react-drag-drop: "6.2.0" at that point, then semver will have fewer problems.

This is something we see often - when we are testing prereleases as release candidates in product code bases, we often have to add a resolution to the package.json file in order to avoid this exact issue with multiple versions of patternfly packages. Semver is doing some sort of version pattern matching and is not able to determine that 6.2.0-prerelease.X versions are the same major version as ^6.0.0 versions because of the -prerelease.x suffix.

Once all the patternfly dependency versions in a codebase are updated to drop any -prerelease.x versions, the multiple versions of the same patternfly packages resolves itself.

@jpinsonneau
Copy link
Collaborator Author

I'm sorry @nicolethoen but this is not related to prerelease. I followed your suggestion and changed all my dependencies to PF 6.1.0:

    "@patternfly/patternfly": "^6.1.0",
    "@patternfly/react-charts": "^8.1.0",
    "@patternfly/react-core": "^6.1.0",
    "@patternfly/react-drag-drop": "^6.1.0",
    "@patternfly/react-icons": "^6.1.0",
    "@patternfly/react-styles": "^6.1.0",
    "@patternfly/react-table": "^6.1.0",
    "@patternfly/react-tokens": "^6.1.0",
    "@patternfly/react-topology": "^6.1.0",

And the result is still the same:
Image

  • on the left, react-drad-drop dependency is importing react-core 6.1.0 which is the expected behavior
  • on the right, react-topology is importing react-core 6.0.0 which is wrong

So I confirm there is a dependecy versions issue, only with react-topology package.

@dlabaj
Copy link
Contributor

dlabaj commented Mar 11, 2025

Hi @jpinsonneau. It looks like you are looking at the package.json for the topology release in the node_modules directory. Having the ^6.0.0 is fine it will use anything that is a patch release greater then 6.0.0. This should resolve to 6.1.0 if the other packages you have are require that. If you look at the version in the package.json is pulling down 6.1.0 for topology. Here is a vite app that will pull down react-core, react-topology, and patternfly 6.1.0.

https://github.com/dlabaj/myPFTestApp

If you do an npm install and look at the version of the packages that where pull down they are 6.1.0 for all packages. Thanks.

@dlabaj
Copy link
Contributor

dlabaj commented Mar 24, 2025

Closing for now based on the an example above. If this is still an issue, feel free to reopen it with some additional comments. It should be pulling in the correct version, if not we can reevaluate what's causing the problem.

@dlabaj dlabaj closed this as completed Mar 24, 2025
@github-project-automation github-project-automation bot moved this from Needs triage to Done in PatternFly Issues Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants