luistak/windowed-observable

Why does package.json includes react and react-dom?

webJose opened this issue · 2 comments

Hello. I want to add the ability to provide the global object that will be used as the communication foundation as opposed to have the code assume it is the window object. This because I have been unable to fiddle around with this code in NodeJS, and window mocks and replacements haven't proved fruitful for me.

Anyway, back to my question: If there's a specialized package for React, why does this one (the generic version) has React in its dependencies? Can those packages be removed?

Hi @webJose, thank you for your question ❤️

If there's a specialized package for React, why does this one (the generic version) has React in its dependencies?

Nice question but since react and react-dom are devDependencies it won't affect the final build on windowed-observable, and given this repository is a monorepo managed by Lerna, if we add only at the root package.json Lerna will optimize every subpackage dependencies and won't download the same version several times.

So it's ok to have these dependencies in the root package.json, as it will not affect the main package output.

Hello. I want to add the ability to provide the global object that will be used as the communication foundation as opposed to have the code assume it is the window object. This because I have been unable to fiddle around with this code in NodeJS, and window mocks and replacements haven't proved fruitful for me.

windowed-observable is only compatible with browser environments, so I don't recommend using it with NodeJs I suggest you look for other options more suitable like RxJs