is it possible to avoid circular dependencies?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 5.8k
- Forks
- 734
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I am using rollup to bundle the source code which uses ssh2. However the tool complains that ssh2 contains circular dependencies.
Specifically, these files are relevant:
Although these lines are valid code in commonjs, is it possible to remove circular dependencies? Potential benefits are avoiding potential bugs and making downstream bundler like rollup webpack work.
Thank you so much! :-)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the dependency relationships around lib/protocol/utils.js:174, lib/protocol/handlers.js:5, and lib/protocol/kex.js:1743, then trace how CommonJS requires form the reported cycle. Done means the relevant circular dependencies are removed without breaking ssh2, and Rollup and webpack no longer report them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, rollup, webpack
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100