dmonad / lib0

Monorepo of isomorphic utility functions
MIT License
353 stars 63 forks source link

Circular dependency between buffer.js, encoding.js, and decoding.js #16

Closed danny-andrews closed 3 years ago

danny-andrews commented 3 years ago

Describe the bug I was running yjs code through rollup and got the following error:

(!) Circular dependencies
node_modules/lib0/encoding.js -> node_modules/lib0/buffer.js -> node_modules/lib0/encoding.js
node_modules/lib0/buffer.js -> node_modules/lib0/decoding.js -> node_modules/lib0/buffer.js

Not sure of the best way to go about fixing these since I'm not familiar with the codebase, but thought I'd make you aware of it if you weren't already. :)

dmonad commented 3 years ago

Hi @danny-andrews ,

nothing to worry about. I try to suppress these warnings whenever possible, but in this case, it is justified and won't lead to issues ;)

danny-andrews commented 3 years ago

Everything I've read seems to suggest it's advisable to avoid circular dependencies wherever possible, as they can lead to really confusing bugs, but to each their own.