Skip to content

Commit 8a25506

Browse files
authored
[browser] Remove WASM HybridGlobalization from runtime code (#110567)
* Removal of `HybridGlobalization` code from the runtime and libs. * Remove `HybridGlobalization` flag and clean the tests from it. * Fix build. * Fix build, remove unused leftovers. * Fix linker tests. * Fix the CI error, revert "icudt_hybrid.dat" removal. * Fix WBT that expected `icudt_hybrid.dat` to be missing.
1 parent ce9dd2a commit 8a25506

File tree

69 files changed

+79
-2218
lines changed

Some content is hidden

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

69 files changed

+79
-2218
lines changed

eng/liveBuilds.targets

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,13 @@
207207
$(LibrariesNativeArtifactsPath)dotnet.js;
208208
$(LibrariesNativeArtifactsPath)dotnet.js.map;
209209
$(LibrariesNativeArtifactsPath)dotnet.native.js;
210-
$(LibrariesNativeArtifactsPath)dotnet.globalization.js;
211210
$(LibrariesNativeArtifactsPath)dotnet.runtime.js;
212211
$(LibrariesNativeArtifactsPath)dotnet.runtime.js.map;
213212
$(LibrariesNativeArtifactsPath)dotnet.d.ts;
214213
$(LibrariesNativeArtifactsPath)package.json;
215214
$(LibrariesNativeArtifactsPath)dotnet.native.wasm;
216215
$(LibrariesNativeArtifactsPath)dotnet.native.js.symbols;
217-
$(LibrariesNativeArtifactsPath)*.dat;
218-
$(LibrariesNativeArtifactsPath)segmentation-rules.json;"
216+
$(LibrariesNativeArtifactsPath)*.dat;"
219217
IsNative="true" />
220218
<!-- for threaded wasm -->
221219
<LibrariesRuntimeFiles Condition="'$(TargetOS)' == 'browser' and Exists('$(LibrariesNativeArtifactsPath)dotnet.native.worker.mjs')"

src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@
224224
<PlatformManifestFileEntry Include="dotnet.runtime.js" IsNative="true" />
225225
<PlatformManifestFileEntry Include="dotnet.runtime.js.map" IsNative="true" />
226226
<PlatformManifestFileEntry Include="dotnet.native.js" IsNative="true" />
227-
<PlatformManifestFileEntry Include="dotnet.globalization.js" IsNative="true" />
228227
<PlatformManifestFileEntry Include="dotnet.native.worker.mjs" IsNative="true" />
229228
<PlatformManifestFileEntry Include="dotnet.native.js.symbols" IsNative="true" />
230229
<PlatformManifestFileEntry Include="dotnet.d.ts" IsNative="true" />
@@ -236,7 +235,6 @@
236235
<PlatformManifestFileEntry Include="icudt_optimal.dat" IsNative="true" />
237236
<PlatformManifestFileEntry Include="icudt_optimal_no_CJK.dat" IsNative="true" />
238237
<PlatformManifestFileEntry Include="icudt_hybrid.dat" IsNative="true" />
239-
<PlatformManifestFileEntry Include="segmentation-rules.json" IsNative="true" />
240238
<PlatformManifestFileEntry Include="package.json" IsNative="true" />
241239
<PlatformManifestFileEntry Include="dotnet.es6.pre.js" IsNative="true" />
242240
<PlatformManifestFileEntry Include="dotnet.es6.lib.js" IsNative="true" />

src/libraries/Common/src/Interop/Browser/Interop.Calendar.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/libraries/Common/src/Interop/Browser/Interop.CompareInfo.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/libraries/Common/src/Interop/Browser/Interop.Locale.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ internal static partial class Interop
77
{
88
internal static unsafe partial class JsGlobalization
99
{
10-
[MethodImplAttribute(MethodImplOptions.InternalCall)]
11-
internal static extern unsafe nint GetCultureInfo(char* culture, int cultureLength, char* buffer, int bufferMaxLength, out int resultLength);
12-
[MethodImplAttribute(MethodImplOptions.InternalCall)]
13-
internal static extern unsafe nint GetFirstDayOfWeek(char* culture, int cultureLength, out int resultPtr);
14-
[MethodImplAttribute(MethodImplOptions.InternalCall)]
15-
internal static extern unsafe nint GetFirstWeekOfYear(char* culture, int cultureLength, out int resultPtr);
1610
[MethodImplAttribute(MethodImplOptions.InternalCall)]
1711
internal static extern unsafe nint GetLocaleInfo(char* locale, int localeLength, char* culture, int cultureLength, char* buffer, int bufferLength, out int resultLength);
1812
}

src/libraries/Common/src/Interop/Browser/Interop.TextInfo.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.Browser.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
<ILLinkSubstitutionsXmls Include="$(ILLinkSharedDirectory)ILLink.Substitutions.NoX86Intrinsics.xml" Condition="'$(SupportsX86Intrinsics)' != 'true'" />
6262
<ILLinkSubstitutionsXmls Include="$(ILLinkSharedDirectory)ILLink.Substitutions.NoWasmIntrinsics.xml" Condition="'$(SupportsWasmIntrinsics)' != 'true'" />
6363
<ILLinkSubstitutionsXmls Include="$(ILLinkSharedDirectory)ILLink.Substitutions.iOS.xml" Condition="'$(IsiOSLike)' == 'true'" />
64-
<ILLinkSubstitutionsXmls Include="$(ILLinkSharedDirectory)ILLink.Substitutions.Browser.xml" Condition="'$(TargetsBrowser)' == 'true'" />
6564
<ILLinkLinkAttributesXmls Include="$(ILLinkSharedDirectory)ILLink.LinkAttributes.Shared.xml" />
6665
<ILLinkSuppressionsLibraryBuildXml Include="$(ILLinkSharedDirectory)ILLink.Suppressions.LibraryBuild.xml" />
6766
<ILLinkDescriptorsLibraryBuildXml Include="$(ILLinkSharedDirectory)ILLink.Descriptors.LibraryBuild.xml" />
@@ -337,7 +336,6 @@
337336
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\Calendar.cs" />
338337
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CalendarAlgorithmType.cs" />
339338
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CalendarData.cs" />
340-
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CalendarData.Browser.cs" Condition="'$(TargetsBrowser)' == 'true'" />
341339
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CalendarData.iOS.cs" Condition="'$(IsiOSLike)' == 'true'" />
342340
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CalendarData.Icu.cs" />
343341
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CalendarData.Nls.cs" />
@@ -351,7 +349,6 @@
351349
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CompareInfo.Invariant.cs" />
352350
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CompareInfo.Nls.cs" />
353351
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CompareInfo.Utf8.cs" />
354-
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CompareInfo.WebAssembly.cs" Condition="'$(TargetsBrowser)' == 'true'" />
355352
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CompareInfo.iOS.cs" Condition="'$(IsiOSLike)' == 'true'" />
356353
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CompareOptions.cs" />
357354
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\CultureData.cs" />
@@ -413,7 +410,6 @@
413410
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\TextInfo.Icu.cs" />
414411
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\TextInfo.Nls.cs" />
415412
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\TextInfo.iOS.cs" Condition="'$(IsiOSLike)' == 'true'" />
416-
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\TextInfo.WebAssembly.cs" Condition="'$(TargetsBrowser)' == 'true'" />
417413
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\ThaiBuddhistCalendar.cs" />
418414
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\TimeSpanFormat.cs" />
419415
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\TimeSpanParse.cs" />
@@ -1341,18 +1337,9 @@
13411337
<Compile Include="$(MSBuildThisFileDirectory)System\WeakReference.cs" />
13421338
<Compile Include="$(MSBuildThisFileDirectory)System\WeakReference.T.cs" />
13431339
<Compile Include="$(MSBuildThisFileDirectory)System\ComAwareWeakReference.cs" />
1344-
<Compile Include="$(CommonPath)Interop\Browser\Interop.CompareInfo.cs" Condition="'$(TargetsBrowser)' == 'true'">
1345-
<Link>Common\Interop\Interop.CompareInfo.cs</Link>
1346-
</Compile>
1347-
<Compile Include="$(CommonPath)Interop\Browser\Interop.Calendar.cs" Condition="'$(TargetsBrowser)' == 'true'">
1348-
<Link>Common\Interop\Interop.Calendar.cs</Link>
1349-
</Compile>
13501340
<Compile Include="$(CommonPath)Interop\Browser\Interop.Locale.cs" Condition="'$(TargetsBrowser)' == 'true'">
13511341
<Link>Common\Interop\Browser\Interop.Locale.cs</Link>
13521342
</Compile>
1353-
<Compile Include="$(CommonPath)Interop\Browser\Interop.TextInfo.cs" Condition="'$(TargetsBrowser)' == 'true'">
1354-
<Link>Common\Interop\Interop.TextInfo.cs</Link>
1355-
</Compile>
13561343
<Compile Include="$(CommonPath)Interop\Interop.Calendar.cs">
13571344
<Link>Common\Interop\Interop.Calendar.cs</Link>
13581345
</Compile>

src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Browser.cs

Lines changed: 0 additions & 57 deletions
This file was deleted.

src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Unix.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ internal sealed partial class CalendarData
99
{
1010
private bool LoadCalendarDataFromSystemCore(string localeName, CalendarId calendarId)
1111
{
12-
#if TARGET_BROWSER
13-
return GlobalizationMode.Hybrid ?
14-
JSLoadCalendarDataFromBrowser(localeName, calendarId) :
15-
IcuLoadCalendarDataFromSystem(localeName, calendarId);
16-
#elif TARGET_MACCATALYST || TARGET_IOS || TARGET_TVOS
12+
#if TARGET_MACCATALYST || TARGET_IOS || TARGET_TVOS
1713
return GlobalizationMode.Hybrid ?
1814
LoadCalendarDataFromNative(localeName, calendarId) :
1915
IcuLoadCalendarDataFromSystem(localeName, calendarId);

0 commit comments

Comments
 (0)