Stop using bluebird but keep in release for extenders - #682
Open
1000TurquoisePogs wants to merge 7 commits into
Open
Stop using bluebird but keep in release for extenders#6821000TurquoisePogs wants to merge 7 commits into
1000TurquoisePogs wants to merge 7 commits into
Conversation
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
Member
Author
|
I'm aware of extenders that use bluebird due to our history of including it, so I won't remove it from the package, just mark it as a 'devdep' in that WE dont use it anymore in this PR. It'll still ship. |
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Proposed changes
Remove the
bluebirdlibrary (3.7.2) from production dependencies and replace all usages with native Node.js async/await and the built-inPromise. Node.js 18+ provides a standards-compliantPromiseimplementation that covers all of the functionality bluebird was being used for in this codebase.What changed
Files with coroutine conversions (19
Promise.coroutine/ generator functions converted toasync/await)lib/plugin-loader.jsloadPlugins,installPluginslib/index.jsstart,loadPluginslib/util.jsuniqueIpslib/webserver.jsvalidateAndPreprocessConfig,startListeninglib/webapp.jsinstallPlugin,_makeRouter,_installDataServiceslib/webauth.jsrestorePluginHaSession,_doLogoutInner,_passwordResetInner,_authenticateOrRefresh,semiAuthenticatedMiddleware.authenticate,middleware.authenticatelib/swagger-catalog.jsgetSwaggerDocslib/reader.jsunitTest(dead code block)lib/apiml.jssetBestIpFromConfiglib/auth-manager.tsloadAuthenticatorsplugins/sso-auth/lib/zssHandler.jsauthorizedFiles with import-only removals (bluebird was imported but unused)
lib/jsonUtils.jslib/javaManager.tslib/javaTypes.tsutils/packaging-utils.jsutils/install-app.jsplugins/sso-auth/lib/apimlHandler.jsplugins/sso-auth/lib/ssoAuth.jsplugins/config/lib/configService.jsplugins/terminal-proxy/lib/terminalProxy.jstest/webapp/agent-connectivity.jsSupporting changes
lib/auth-manager.ts: Addedconfiguration: any;class field declaration. Previously set viaObject.assign(this, options)which hid it from TypeScript; now required since the coroutine (which usedthisvia the bluebird coroutine binding) became a proper class method.package.json: Removed"bluebird": "3.7.2"fromdependencies.Conversion pattern applied
Consequences
Performance
PromiseArrayorPromisesubclass. Node.js native Promises are allocated and collected by V8's built-in garbage collector using optimized internal paths.async/await(using microtask queue intrinsics). bluebird coroutines run through generator protocol machinery, which prevents certain V8 optimizations such as inlining and escape analysis on the returned promise objects.Capabilities / behavior changes
Promise.coroutineremoved: This is bluebird's generator-based async primitive. All call sites have been converted to nativeasync/await— no functionality is lost.Promise.map,.each,.promisify,.promisifyAll, cancellation, progress callbacks, or any other bluebird extension.Testing
loadAuthenticators) or plugin installation (installPlugins).webauth.jsasync paths (_authenticateOrRefresh,middleware, etc.).webapp.jsrouter installation (installPlugin,_makeRouter,_installDataServices).zssHandler.jsauthorizedandapiml.jssetBestIpFromConfig).