Skip to content

[master] Update dependencies from aspnet/Extensions#1234

Merged
dotnet-maestro[bot] merged 1 commit intomasterfrom
darc-master-06db6701-1701-41d9-813e-5238c1ee42ed
Oct 13, 2019
Merged

[master] Update dependencies from aspnet/Extensions#1234
dotnet-maestro[bot] merged 1 commit intomasterfrom
darc-master-06db6701-1701-41d9-813e-5238c1ee42ed

Conversation

@dotnet-maestro
Copy link
Contributor

This pull request updates the following dependencies

From https://github.com/aspnet/Extensions

  • Build: 20191012.1
  • Date Produced: 10/13/2019 5:44 AM
  • Commit: 1dfe8bc2af511822677789c29a0c800f7cca1d7b
  • Branch: refs/heads/master
  • Updates:
    • Microsoft.AspNetCore.BenchmarkRunner.Sources -> 5.0.0-alpha1.19512.1
    • Microsoft.AspNetCore.Testing -> 5.0.0-alpha1.19512.1
    • Microsoft.Extensions.CommandLineUtils.Sources -> 5.0.0-alpha1.19512.1
    • Microsoft.Extensions.HashCodeCombiner.Sources -> 5.0.0-alpha1.19512.1
    • Microsoft.Extensions.NonCapturingTimer.Sources -> 5.0.0-alpha1.19512.1
    • Microsoft.Extensions.Logging -> 5.0.0-alpha1.19512.1

…0191012.1

- Microsoft.AspNetCore.BenchmarkRunner.Sources - 5.0.0-alpha1.19512.1
- Microsoft.AspNetCore.Testing - 5.0.0-alpha1.19512.1
- Microsoft.Extensions.CommandLineUtils.Sources - 5.0.0-alpha1.19512.1
- Microsoft.Extensions.HashCodeCombiner.Sources - 5.0.0-alpha1.19512.1
- Microsoft.Extensions.NonCapturingTimer.Sources - 5.0.0-alpha1.19512.1
- Microsoft.Extensions.Logging - 5.0.0-alpha1.19512.1
@dotnet-maestro dotnet-maestro bot requested a review from dougbu as a code owner October 13, 2019 12:12
@dotnet-maestro
Copy link
Contributor Author

dotnet-maestro bot commented Oct 13, 2019

Auto-Merge Status

This pull request has been merged because the following merge policies have succeeded.

  • ✔️ Standard Merge Policies Succeeded - Successful checks: AspNetCore-Tooling-ci, AspNetCore-Tooling-ci (Build macOS release), AspNetCore-Tooling-ci (Build macOS debug), AspNetCore-Tooling-ci (Build Linux release), AspNetCore-Tooling-ci (Build Linux debug), AspNetCore-Tooling-ci (Build Windows release), AspNetCore-Tooling-ci (Build Windows debug), AspNetCore-Tooling-ci (Build Code check), AspNetCore-Tooling-ci (Build Test: Linux Source Build)
  • ✔️ Standard Merge Policies Succeeded - No reviews have requested changes.

@dotnet-maestro dotnet-maestro bot merged commit debe2d2 into master Oct 13, 2019
@dotnet-maestro dotnet-maestro bot deleted the darc-master-06db6701-1701-41d9-813e-5238c1ee42ed branch October 13, 2019 13:07
DustinCampbell added a commit that referenced this pull request Sep 8, 2025
> [!TIP]
> I strongly recommend reviewing this commit-by-commit. The commit
history represents a progression of changes, and each commit has a
detailed message describing its purpose.

This change overhauls the HTML character entity reference decoding
performed by `ComponentMarkupEncodingPass`. The Razor compiler makes a
best effort to decode HTML content for code generation. If it determines
that the content is suitable as raw text and all character entity
references can be decoded (if any), the compiler's code gen will call
`RenderTreeBuilder.AddContent(...)`. If not, it'll call
`RenderTreeBuilder.AddMarkupContent(...)`, which can have an impact on
the runtime performance of the compiled application. So, the goal is to
call `AddContent(...)` as much as possible.

While tuning the performance of `ComponentMarkupEncodingPass` to reduce
allocations and avoid unnecessary work, I encountered two bugs:

1. The Razor compiler doesn't implement hexadecimal HTML character
entity references correctly. Hex character entity references are
supposed to be in the form, `&#xhhhh;`. However, the compiler's
implementation only supports an illegal form, `&#0xhhhh;` and doesn't
actually support the legal form. So, if content contains legal hex
numeric character entity references, they will fail to decode and
`RenderTreeBuilder.AddMarkupContent(...)` will be code-gen'd.
2. When decoding a decimal character entity reference, such as `&#1234`,
a lookup table is used to retrieve the code point value. However, the
lookup table isn't complete and doesn't include very simple values. For
example, it doesn't include `/` which translates to a `/` character.
So, if the content contains decimal numeric character entity references
that aren't included in the lookup table, they will fail to decode and
`RenderTreeBuilder.AddMarkupContent(...)` will be code-gen'd.

I've gone ahead and fixed both of these issues in
6f23ef0.

In addition, there are several performance and allocation fixes in this
commit. These changes resulted in the creation of a handful of useful
helpers for building and creating strings using a
`MemoryBuilder<ReadOnlyMemory<char>>`. Those helpers and tests are
included in e266160.

Many thanks to Copilot for help with writing all of the tests. 🤖🧪❤️

----
CI Build:
https://dev.azure.com/dnceng/internal/_build/results?buildId=2786521&view=results
Test Insertion:
https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/667364
Toolset Run:
https://dev.azure.com/dnceng/internal/_build/results?buildId=2786524&view=results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants