Compared to v1, v2 is not as good in terms of both efficiency and code writing. Moreover, its performance is far from satisfactory. Just like the getContainerData declaration has been deprecated but no alternative solutions have been suggested, it is unclear why the library author decided to make the second version more complex.
Checking the npm statistics, the acceptance rate of version 2 is seriously insufficient.
Have you considered redesigning and eliminating the shadow dom? For many frameworks, the support for shadow dom is not good [10-17 09:57:15] [Uncaught Error: ] SecurityError: Failed to execute 'toBlob' on 'HTMLCanvasElement': Tainted canvases may not be exported.