-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Always load NodeHttpClient to fix SSR #8047
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
Conversation
@@ -40,7 +40,10 @@ module.exports = function (modulePath, browserBaseName, options) { | |||
}, | |||
resolve: { | |||
extensions: [".ts", ".js"], | |||
alias: options.alias, | |||
alias: { | |||
"./NodeHttpClient": path.resolve(__dirname, "signalr/src/empty.ts"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review: This saves 3kb for the browser .js files
We could just remove this and not save the bytes if we want
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the right amount of clever 👍
Of course, I'd like a more first-class way to do this so we wouldn't even have to to waste bytes on a not-implemented NodeHttpClient, but this is certainly better than bundling the real thing in the browser dist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Will you be sending a PR patch as well? (2.2)
@BrennanConroy reeeeeeee |
dfcf17f
to
771e0c0
Compare
#7823