close
Skip to content

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

Merged
BrennanConroy merged 6 commits into
masterfrom
brecon/json2
Apr 18, 2019
Merged

Make System.Text.Json the default for SignalR and remove Newtonsoft from shared framework#9476
BrennanConroy merged 6 commits into
masterfrom
brecon/json2

Conversation

@BrennanConroy
Copy link
Copy Markdown
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
Copy Markdown
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
const complexObject = {
ByteArray: protocol.name === "json"
? "aGVsbG8="
? new Array(0x68, 0x65, 0x6c, 0x6c, 0x6f)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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


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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Services.AddSingleton<HubConnection>();
Services.AddLogging();
this.AddNewtonsoftJsonProtocol();
this.AddJsonProtocol();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

😨

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

😀

const complexObject = {
ByteArray: protocol.name === "json"
? "aGVsbG8="
? new Array(0x68, 0x65, 0x6c, 0x6c, 0x6f)
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

8 participants