Skip to content

Update JSCallResultTypeHelper.cs - #25628

Merged
mkArtakMSFT merged 3 commits into
release/5.0-rc2from
t-mabuc/js-call-result-type-improvement
Sep 9, 2020
Merged

Update JSCallResultTypeHelper.cs#25628
mkArtakMSFT merged 3 commits into
release/5.0-rc2from
t-mabuc/js-call-result-type-improvement

Conversation

@MackinnonBuck

@MackinnonBuck MackinnonBuck commented Sep 4, 2020

Copy link
Copy Markdown
Member

Description

Currently, each .NET->JavaScript interop call results in JSCallResultTypeHelper.FromGeneric<TResult>() comparing TResult with up to three IJSObjectReference types. We can optimize this slightly for the general case by first checking if typeof(TResult).Assembly matches the assembly containing JSCallResultType before performing the other checks.

Customer Impact

Customers may see a slight performance improvement for JS interop calls.

Regression?

No.

Risk

Very small risk. This is a small change and existing tests cover this area.

Addresses #25624

@MackinnonBuck MackinnonBuck added the area-blazor Includes: Blazor, Razor Components label Sep 4, 2020
@MackinnonBuck MackinnonBuck changed the title Update JSCallResultTypeHelper.cs and PublicAPI.Unshipped.txt Update JSCallResultTypeHelper.cs Sep 4, 2020
dougbu
dougbu previously approved these changes Sep 4, 2020

@dougbu dougbu left a comment

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 PR fixes a build break. We need it in ASAP

@halter73

halter73 commented Sep 4, 2020

Copy link
Copy Markdown
Member

@dougbu There's also #25629 that just fixes the build break.

@dougbu

dougbu commented Sep 4, 2020

Copy link
Copy Markdown
Contributor

@Pilchie should I proactively merge this to unbreak the build, letting @SteveSandersonMS and @MackinnonBuck follow up on the C# change if there's something wrong there❔

@halter73

halter73 commented Sep 4, 2020

Copy link
Copy Markdown
Member

@Pilchie There's also #25629 that just fixes the build with the C# change.

@dougbu

dougbu commented Sep 4, 2020

Copy link
Copy Markdown
Contributor

Never mind this PR @Pilchie except for its ask mode aspect. I merged #25629 because that "just" unbreaks the build. Many thanks @MackinnonBuck

Comment thread src/Shared/JSInterop/JSCallResultTypeHelper.cs Outdated
@halter73

halter73 commented Sep 4, 2020

Copy link
Copy Markdown
Member

Can this be tested?

@MackinnonBuck
MackinnonBuck requested a review from a team as a code owner September 4, 2020 20:21
@Pilchie

Pilchie commented Sep 4, 2020

Copy link
Copy Markdown
Member

@MackinnonBuck please ping when CI is green and this is signed off. Dismissing @dougbu's signoff since I presume it was based on just the build fix.

@Pilchie
Pilchie requested a review from dougbu September 4, 2020 20:47
@MackinnonBuck
MackinnonBuck dismissed dougbu’s stale review September 8, 2020 18:38

The initial review was to pull in the build fix (which has been resolved), not the C# change.

@SteveSandersonMS SteveSandersonMS left a comment

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.

Great!

Comment thread src/Shared/JSInterop/JSCallResultTypeHelper.cs Outdated
@mkArtakMSFT mkArtakMSFT added the Servicing-consider Shiproom approval is required for the issue label Sep 9, 2020
@ghost

ghost commented Sep 9, 2020

Copy link
Copy Markdown

Hello human! Please make sure you've included the Shiproom Template in a comment or (preferably) the PR description. Also, make sure this PR is not marked as a draft and is ready-to-merge.

@Pilchie Pilchie added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Sep 9, 2020
@Pilchie

Pilchie commented Sep 9, 2020

Copy link
Copy Markdown
Member

Approved for .NET 5.0 RC2.

@mkArtakMSFT
mkArtakMSFT merged commit 8f46188 into release/5.0-rc2 Sep 9, 2020
@mkArtakMSFT
mkArtakMSFT deleted the t-mabuc/js-call-result-type-improvement branch September 9, 2020 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants