-
Notifications
You must be signed in to change notification settings - Fork 1
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
JS SDK needs to support library makers better #155
Comments
cc @asadovsky |
FWIW: with browserify 10.2.5 and up, if modules A and B require the same symlinked module, they will share the same, single instance of that module. Apparently this is how things work in Node, too. That doesn't solve the core issue described here, but it helps in some cases. For example, todosapp depends on both syncbase and vanadium, and syncbase itself depends on vanadium. Since we use "npm link" to set up vanadium (as well as syncbase), with browserify 10.2.5 and up, todosapp and syncbase end up sharing the same instance of the vanadium module. |
I just ran into this as well. It manifests as a an error log in the console and no error is propagated to the callback, for instance:
Generates the log:
I was installing the vanadium and syncbase dependencies the same way that npm would by making copies in the correct node_modules directory. My previous target looked like this:
Once I moved to linking the modules as a temporary workaround things started working properly. This is a pretty serious bug, it will need to be resolved before any kind of release so our modules don't break for users in unexpected ways. |
I think there's a few things we should do:
|
I like option one. We may want to add a version check as well to ensure the API will work where there might be drift between the different versions... Another option might be to move syncbase into the vanadium module, then they will be guaranteed to use the same version (not sure how practical this is though...). |
In npm and browserify, each module gets its own copy of the modules that it depends. This is an issue for the vanadium module because we have many singletons that expect there to be only one copy of vanadium in the process space. So far the ones that i've come across is:
ContextKey
Error Catalog
VOM constructor map.
Also #147
The text was updated successfully, but these errors were encountered: