Skip to content
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

Make System.Text.Json the default for SignalR and remove Newtonsoft from shared framework #9476

Merged
merged 6 commits into from
Apr 18, 2019

Conversation

BrennanConroy
Copy link
Member

Fixes #9439
Fixes #4260

Review: How do we want to expose json options? I'm currently wrapping the serializer options and passing the values through.

@BrennanConroy BrennanConroy added the area-signalr Includes: SignalR clients and servers label Apr 17, 2019
@BrennanConroy BrennanConroy added this to the 3.0.0-preview5 milestone Apr 17, 2019
@Eilon Eilon removed this from the 3.0.0-preview5 milestone Apr 17, 2019
Copy link
Contributor

@natemcmaster natemcmaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved w.r.t. shared framework changes.

@Eilon Eilon added this to the 3.0.0-preview5 milestone Apr 17, 2019
@@ -457,12 +457,11 @@ describe("hubConnection", () => {

const complexObject = {
ByteArray: protocol.name === "json"
? "aGVsbG8="
? new Array(0x68, 0x65, 0x6c, 0x6c, 0x6f)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -68,7 +68,6 @@

If these are needed as direct dependencies, it is okay to change them to ExternalAspNetCoreAppReference and move up into sections above.
-->
<_TransitiveExternalAspNetCoreAppReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pranavkm @rynowak Is MVC good with this change? We are making the switch to System.Text.Json in SignalR by default now.

@ryanbrandenburg Do our templates reference Newtonsoft anywhere or did we already remove all that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do?

Do our templates reference Newtonsoft anywhere or did we already remove all that?

MVC's templates still do. We were waiting for https://github.com/dotnet/corefx/issues/36024 to land since it affects quite a few of our tests

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removes Newtonsoft.Json from the shared framework. We can't do that if MVC isn't ready to do it though.

My concern is that this is going to land super hot for preview 5 and I want everybody on the same page. Maybe we should leave Newtonsoft in the shared framework, even though we're changing the default.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, if we can land this soon that would be best. We need to try our templates after this change and make sure we haven't broken the immediate experience.

@@ -25,7 +25,7 @@ public HubConnectionBuilder()
Services = new ServiceCollection();
Services.AddSingleton<HubConnection>();
Services.AddLogging();
this.AddNewtonsoftJsonProtocol();
this.AddJsonProtocol();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😨

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😀

@@ -457,12 +457,11 @@ describe("hubConnection", () => {

const complexObject = {
ByteArray: protocol.name === "json"
? "aGVsbG8="
? new Array(0x68, 0x65, 0x6c, 0x6c, 0x6f)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment linking to the issue you filed for this.

options.AllowTrailingCommas = false;
options.IgnoreNullValues = false;
options.IgnoreReadOnlyProperties = false;
// TODO: camelCase
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracking this somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in my head. I'll be doing this today so no need to track it.

Copy link
Contributor

@mikaelm12 mikaelm12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File an issue for reviewing the options.

@BrennanConroy
Copy link
Member Author

Filed #9519 for options review

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.

Make System.Text.Json SignalR Protocol package the default Remove Newtonsoft.Json from the shared framework
7 participants