tinylibs / tinybench

🔎 A simple, tiny and lightweight benchmarking library!
MIT License
1.73k stars 36 forks source link

Circular dependency #53

Open sirenkovladd opened 1 year ago

sirenkovladd commented 1 year ago

https://github.com/tinylibs/tinybench/blob/v2.5.0/src/bench.ts#L11

https://github.com/tinylibs/tinybench/blob/v2.5.0/src/task.ts#L4

I suggest leaving only the import Task in the branch

After approval, I can create a PR (with backward compatibility, of course, as far as possible)

kibertoad commented 1 year ago

Can you elaborate on what you are suggesting? But yeah, circular dependencies should be avoided

sirenkovladd commented 1 year ago

in Task to receive an interface with the necessary parameters and implement this interface in Bench

sirenkovladd commented 1 year ago

and make deprecated https://github.com/tinylibs/tinybench/blob/v2.5.1/src/task.ts#L19

and next step, (maybe in v3.0.0) remove this column