Skip to content

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

Merged
merged 2 commits into from
Mar 4, 2019
Merged

Always load NodeHttpClient to fix SSR #8047

merged 2 commits into from
Mar 4, 2019

Conversation

BrennanConroy
Copy link
Member

@BrennanConroy BrennanConroy added the area-signalr Includes: SignalR clients and servers label Feb 28, 2019
@@ -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"),
Copy link
Member Author

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

Copy link
Member

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.

Copy link
Contributor

@muratg muratg left a 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)

@analogrelay
Copy link
Contributor

@BrennanConroy reeeeeeeemixbase

@BrennanConroy BrennanConroy merged commit 508256d into master Mar 4, 2019
@BrennanConroy BrennanConroy deleted the brecon/node branch March 4, 2019 17:26
@BrennanConroy BrennanConroy mentioned this pull request Mar 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-signalr Includes: SignalR clients and servers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants