-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating FRP from separate lib #50
Comments
Feels like there is two sodium libraries both with their own global scope. Mixing sodium objects across two different global scopes can cause issues with ranks and memory management, leading to leaks and streams firing in the wrong order. Could UMD modules be used so both pieces of code are talking to the same sodium in the same global scope? |
What I have in mind is if the sodium library was loaded into window.sodium and .d.ts type definition files are constructed to access that same global sodium from separate packaged pieces of code. Similar to threeJS. You can just install the type definitions without the library "@types/threejs". And have all independent packaged code access the same threejs included 1st via a script tag. |
Better late than never: |
I ran into a quirky bug in the following scenario:
Core app imports 2 libs:
sodium
andhelpers
helpers
also importssodium
, but uses rollup to exclude it on the build (e.g. when the app runs, the only instantiation of sodium itself should be via the one that's bundled into the core app)However, if
helpers
creates new primitives, like a newStreamSink
and sends it back to the core app for use - things get wonky.Is this expected behavior? As a casual observation, it makes sense since Sodium does all the memory management, and an external lib is somehow still external - but I just wanted to kick the tires and see if maybe there's something wrong in the packaging system.
On a practical level, I changed the helpers to expect a pre-created sink as an argument - so it's not a big deal. Though we should document it if these are the genuine mechanics.
The text was updated successfully, but these errors were encountered: