-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Create flag for packages to detect which platform is being used. #106
Comments
closes #106 This allows package developers to create branching code to support different SSB server types.
Each package needs to declare which platforms they suppport. This value needs to match the running server type. * `pkg.supportedPlatforms = ["nodejs-ssb"]` * `ssb.serverType = "nodejs-ssb" All packages patched to include this property. closes #106
This issue is done! There is both if (ssb.serverType === "nodejs-ssb") {
// do something that is supported only on that server.
} All packages have been patched to include a |
This flag has been changed from |
Soon there will be multiple platforms inside
platforms/
each providing the samessb.*
high-level API with internals tweaked for specific SSB server implementations.The plan is to have the following platforms:
nodejs-ssb
: which is a refactor of the current available codebase. Cue Improveplatforms/nodejs-ssb
#105go-ssb
: future implementation for go-ssb based server.browser-ssb
: future implementation based on client-side only ssb-browser-core.Each package will declare which platforms it is compatible with, and won't be loaded when an incompatible platform is used.
The package declaration will include a new property
supportedPlatforms
which is an array of platform identifiers. Example:The running platform will be available at runtime as
ssb.serverType
so that code can branch.supportedPlatforms
package flag.ssb.serverType
runtime property.The text was updated successfully, but these errors were encountered: