Skip to content

Components.js has a problematic dependency loop with Comunica #157

@joachimvh

Description

@joachimvh

Issue type:

  • 🐛 Bug

Description:

Components.js depends on rdf-parse. rdf-parse, as many of the rdf-* libraries depends on Comunica. Comunica depends on Components.js.

At the time of writing Components.js depends on rdf-parse v2, wich depends on Comunica v2, which means that Comunica v4 depends on Comunica v2.

Components.js finds components by looking through all node_modules folders. A consequence of this is that any library that depends on the latest versions of Comunica and Components.js has no guarantee which Comunica components will be found as both the v4 and the v2 components could be found. Which ones are found depend on the order the package manager installs the depends, which, for example, differs between npm and yarn.

In a project where I have this issue, the workaround I had to do, to force my package manager to install in the "correct order", was to add both rdf-parse v4 and @comunica/bus-rdf-parse-html v4.4.0 to my package.json. No idea why the latter was needed but if I didn't Components.js would somehow still find the v2 of that one instead of the v4.

A quick fix might be to resolve #147, although there are also some other rdf-* dependencies and some of these might also cause issues if not updated, I did not verify. The Components.js generator might also have dependencies that cause issues and would have to be updated.

A more comprehensive solution would be to not have Components.js or the generator depend on any libraries that depend on Comunica, or even broader, on any library that exports its own components, as the moment these versions differ again this could potentially lead to conflicts. As an added bonus, it would probably be nice for Comunica to not depend on an older version of itself and thereby being in its own package twice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions