Skip to content

Commit 79d1236

Browse files
committed
Merge remote-tracking branch 'upstream/main' into BootJs
2 parents a636f36 + 46312f3 commit 79d1236

File tree

49 files changed

+1664
-331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1664
-331
lines changed

.azure/pipelines/localization.yml

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,42 @@ parameters:
2525
variables:
2626
- name: _TeamName
2727
value: AspNetCore
28-
- template: /eng/common/templates/variables/pool-providers.yml
29-
30-
jobs:
31-
- ${{ if and(ne(variables['System.TeamProject'], 'public'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.Reason'], 'Manual'))) }}:
32-
- template: /eng/common/templates/job/onelocbuild.yml
33-
parameters:
34-
CreatePr: ${{ or(ne(variables['Build.Reason'], 'Manual'), eq(parameters.createPr, 'true')) }}
35-
LclPackageId: 'LCL-JUNO-PROD-ASPNETCORE'
36-
LclSource: lclFilesFromPackage
37-
MirrorRepo: aspnetcore
28+
- template: /eng/common/templates-official/variables/pool-providers.yml@self
29+
30+
31+
resources:
32+
repositories:
33+
# Repo: 1ESPipelineTemplates/1ESPipelineTemplates
34+
- repository: 1esPipelines
35+
type: git
36+
name: 1ESPipelineTemplates/1ESPipelineTemplates
37+
ref: refs/tags/release
38+
39+
extends:
40+
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
41+
parameters:
42+
sdl:
43+
sourceAnalysisPool:
44+
name: $(DncEngInternalBuildPool)
45+
image: 1es-windows-2022
46+
os: windows
47+
codeql:
48+
compiled:
49+
enabled: false
50+
justificationForDisabling: "This pipeline doesn't build any code. The product code is already scanned in the main pipeline (aspnetcore-ci)"
51+
pool:
52+
name: $(DncEngInternalBuildPool)
53+
image: 1es-windows-2022
54+
os: windows
55+
56+
stages:
57+
- stage: build
58+
displayName: Build
59+
jobs:
60+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.Reason'], 'Manual'))) }}:
61+
- template: /eng/common/templates-official/job/onelocbuild.yml@self
62+
parameters:
63+
CreatePr: ${{ or(ne(variables['Build.Reason'], 'Manual'), eq(parameters.createPr, 'true')) }}
64+
LclPackageId: 'LCL-JUNO-PROD-ASPNETCORE'
65+
LclSource: lclFilesFromPackage
66+
MirrorRepo: aspnetcore

docs/area-owners.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
The below table lists all the `area-`labels used in the **dotnet/aspnetcore** repository and their owners.
44

5-
65
| area label | Owners | Description |
76
| ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
87
| **[area-auth](https://github.com/dotnet/aspnetcore/issues?q=is%3Aissue+is%3Aopen+label%3Aarea-auth)** | [@joperezr](https://github.com/joperezr) [@mikekistler](https://github.com/mikekistler) [@halter73](https://github.com/halter73) [@mackinnonbuck](https://github.com/mackinnonbuck) | Authn, Authz, OAuth, OIDC, Bearer |

eng/Version.Details.xml

Lines changed: 170 additions & 170 deletions
Large diffs are not rendered by default.

eng/Versions.props

Lines changed: 87 additions & 87 deletions
Large diffs are not rendered by default.

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64"
2222
]
2323
},
24-
"xcopy-msbuild": "17.8.5"
24+
"xcopy-msbuild": "17.13.0"
2525
},
2626
"native-tools": {
2727
"jdk": "latest"

src/BuildAfterTargetingPack/BuildAfterTargetingPack.csproj

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@
3939
</ItemGroup>
4040

4141
<!-- Cannot build in source-build because that does not create an App.Ref layout. -->
42+
<!-- Only build on win-x64 -->
4243
<Target Name="BuildDelayedProjects"
4344
BeforeTargets="Build"
44-
Condition=" '$(DotNetBuildSourceOnly)' != 'true' "
45+
Condition=" '$(DotNetBuildSourceOnly)' != 'true' AND ('$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' == 'x64') "
4546
Returns="@(TargetPathWithTargetPlatformMoniker)">
4647
<MSBuild Projects="@(RequiresDelayedBuild)"
4748
BuildInParallel="$(BuildInParallel)"
@@ -52,13 +53,13 @@
5253
</MSBuild>
5354
</Target>
5455

55-
<Target Name="CleanDelayedProjects" BeforeTargets="Clean" Condition=" '$(DotNetBuildSourceOnly)' != 'true' ">
56+
<Target Name="CleanDelayedProjects" BeforeTargets="Clean" Condition=" '$(DotNetBuildSourceOnly)' != 'true' AND ('$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' == 'x64') ">
5657
<MSBuild Projects="@(RequiresDelayedBuild)" BuildInParallel="$(BuildInParallel)" Targets="Clean" />
5758
</Target>
5859

5960
<Target Name="CreateHelixPayloadDelayedProjects"
6061
BeforeTargets="CreateHelixPayload"
61-
Condition=" '$(DotNetBuildSourceOnly)' != 'true' "
62+
Condition=" '$(DotNetBuildSourceOnly)' != 'true' AND ('$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' == 'x64') "
6263
Returns="@(HelixWorkItem)">
6364
<MSBuild Projects="@(RequiresDelayedBuild)"
6465
BuildInParallel="$(BuildInParallel)"
@@ -76,19 +77,19 @@
7677
</MSBuild>
7778
</Target>
7879

79-
<Target Name="PackDelayedProjects" BeforeTargets="Pack" Condition=" '$(DotNetBuildSourceOnly)' != 'true' ">
80+
<Target Name="PackDelayedProjects" BeforeTargets="Pack" Condition=" '$(DotNetBuildSourceOnly)' != 'true' AND ('$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' == 'x64') ">
8081
<MSBuild Projects="@(RequiresDelayedBuild)" BuildInParallel="$(BuildInParallel)" Targets="Pack" />
8182
</Target>
8283

83-
<Target Name="PublishDelayedProjects" BeforeTargets="Publish" Condition=" '$(DotNetBuildSourceOnly)' != 'true' ">
84+
<Target Name="PublishDelayedProjects" BeforeTargets="Publish" Condition=" '$(DotNetBuildSourceOnly)' != 'true' AND ('$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' == 'x64') ">
8485
<MSBuild Projects="@(RequiresDelayedBuild)" BuildInParallel="$(BuildInParallel)" Targets="Publish" />
8586
</Target>
8687

87-
<Target Name="TestDelayedProjects" BeforeTargets="Test" Condition=" '$(DotNetBuildSourceOnly)' != 'true' ">
88+
<Target Name="TestDelayedProjects" BeforeTargets="Test" Condition=" '$(DotNetBuildSourceOnly)' != 'true' AND ('$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' == 'x64') ">
8889
<MSBuild Projects="@(RequiresDelayedBuild)" BuildInParallel="$(BuildInParallel)" Targets="Test" />
8990
</Target>
9091

91-
<Target Name="VSTestDelayedProjects" BeforeTargets="VSTest" Condition=" '$(DotNetBuildSourceOnly)' != 'true' ">
92+
<Target Name="VSTestDelayedProjects" BeforeTargets="VSTest" Condition=" '$(DotNetBuildSourceOnly)' != 'true' AND ('$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' == 'x64') ">
9293
<MSBuild Projects="@(RequiresDelayedBuild)" BuildInParallel="$(BuildInParallel)" Targets="VSTest" />
9394
</Target>
9495

src/Components/Web.JS/src/Rendering/Renderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export function resetScrollAfterNextBatch(): void {
9595
shouldResetScrollAfterNextBatch = true;
9696
}
9797

98-
function resetScrollIfNeeded() {
98+
export function resetScrollIfNeeded() {
9999
if (shouldResetScrollAfterNextBatch) {
100100
shouldResetScrollAfterNextBatch = false;
101101

src/Components/Web.JS/src/Services/NavigationEnhancement.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import { synchronizeDomContent } from '../Rendering/DomMerging/DomSync';
55
import { attachProgrammaticEnhancedNavigationHandler, handleClickForNavigationInterception, hasInteractiveRouter, isForSamePath, isSamePageWithHash, notifyEnhancedNavigationListeners, performScrollToElementOnTheSamePage } from './NavigationUtils';
6+
import { resetScrollAfterNextBatch, resetScrollIfNeeded } from '../Rendering/Renderer';
67

78
/*
89
In effect, we have two separate client-side navigation mechanisms:
@@ -70,13 +71,19 @@ export function detachProgressivelyEnhancedNavigationListener() {
7071
window.removeEventListener('popstate', onPopState);
7172
}
7273

73-
function performProgrammaticEnhancedNavigation(absoluteInternalHref: string, replace: boolean) {
74+
function performProgrammaticEnhancedNavigation(absoluteInternalHref: string, replace: boolean) : void {
75+
const originalLocation = location.href;
76+
7477
if (replace) {
7578
history.replaceState(null, /* ignored title */ '', absoluteInternalHref);
7679
} else {
7780
history.pushState(null, /* ignored title */ '', absoluteInternalHref);
7881
}
7982

83+
if (!isForSamePath(absoluteInternalHref, originalLocation)) {
84+
resetScrollAfterNextBatch();
85+
}
86+
8087
performEnhancedPageLoad(absoluteInternalHref, /* interceptedLink */ false);
8188
}
8289

@@ -90,13 +97,20 @@ function onDocumentClick(event: MouseEvent) {
9097
}
9198

9299
handleClickForNavigationInterception(event, absoluteInternalHref => {
100+
const originalLocation = location.href;
101+
93102
const shouldScrollToHash = isSamePageWithHash(absoluteInternalHref);
94103
history.pushState(null, /* ignored title */ '', absoluteInternalHref);
95104

96105
if (shouldScrollToHash) {
97106
performScrollToElementOnTheSamePage(absoluteInternalHref);
98107
} else {
108+
let isSelfNavigation = isForSamePath(absoluteInternalHref, originalLocation);
99109
performEnhancedPageLoad(absoluteInternalHref, /* interceptedLink */ true);
110+
if (!isSelfNavigation) {
111+
resetScrollAfterNextBatch();
112+
resetScrollIfNeeded();
113+
}
100114
}
101115
});
102116
}
@@ -106,6 +120,7 @@ function onPopState(state: PopStateEvent) {
106120
return;
107121
}
108122

123+
// load the new page
109124
performEnhancedPageLoad(location.href, /* interceptedLink */ false);
110125
}
111126

src/Components/benchmarkapps/Wasm.Performance/dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ RUN .dotnet/dotnet publish -c Release -r linux-x64 --sc true -o /app ./src/Compo
2929
RUN chmod +x /app/Wasm.Performance.Driver
3030

3131
WORKDIR /app
32-
FROM mcr.microsoft.com/playwright/dotnet:v1.49.0-jammy-amd64 AS final
32+
FROM mcr.microsoft.com/playwright/dotnet:v1.50.0-jammy-amd64 AS final
3333
COPY --from=build ./app ./
3434
COPY ./exec.sh ./
3535

src/Components/test/E2ETest/Infrastructure/WebDriverExtensions/WebDriverExtensions.cs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,70 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using OpenQA.Selenium;
5+
using OpenQA.Selenium.Support.UI;
6+
using System;
57

68
namespace Microsoft.AspNetCore.Components.E2ETest;
79

810
internal static class WebDriverExtensions
911
{
12+
private static string GetFindPositionScript(string elementId) =>
13+
$"return Math.round(document.getElementById('{elementId}').getBoundingClientRect().top + window.scrollY);";
14+
1015
public static void Navigate(this IWebDriver browser, Uri baseUri, string relativeUrl)
1116
{
1217
var absoluteUrl = new Uri(baseUri, relativeUrl);
1318

1419
browser.Navigate().GoToUrl("about:blank");
1520
browser.Navigate().GoToUrl(absoluteUrl);
1621
}
22+
23+
public static void WaitForElementToBeVisible(this IWebDriver browser, By by, int timeoutInSeconds = 5)
24+
{
25+
var wait = new DefaultWait<IWebDriver>(browser)
26+
{
27+
Timeout = TimeSpan.FromSeconds(timeoutInSeconds),
28+
PollingInterval = TimeSpan.FromMilliseconds(100)
29+
};
30+
wait.IgnoreExceptionTypes(typeof(NoSuchElementException), typeof(StaleElementReferenceException));
31+
wait.Until(driver =>
32+
{
33+
try
34+
{
35+
var element = driver.FindElement(by);
36+
return element.Displayed;
37+
}
38+
catch (StaleElementReferenceException)
39+
{
40+
// Retry finding the element
41+
return false;
42+
}
43+
});
44+
}
45+
46+
public static long GetElementPositionWithRetry(this IWebDriver browser, string elementId, int retryCount = 3, int delayBetweenRetriesMs = 100)
47+
{
48+
var jsExecutor = (IJavaScriptExecutor)browser;
49+
string script = GetFindPositionScript(elementId);
50+
browser.WaitForElementToBeVisible(By.Id(elementId));
51+
for (int i = 0; i < retryCount; i++)
52+
{
53+
try
54+
{
55+
var result = jsExecutor.ExecuteScript(script);
56+
if (result != null)
57+
{
58+
return (long)result;
59+
}
60+
}
61+
catch (OpenQA.Selenium.JavaScriptException)
62+
{
63+
// JavaScript execution failed, retry
64+
}
65+
66+
Thread.Sleep(delayBetweenRetriesMs);
67+
}
68+
69+
throw new Exception($"Failed to execute script after {retryCount} retries.");
70+
}
1771
}

0 commit comments

Comments
 (0)