-
-
Notifications
You must be signed in to change notification settings - Fork 230
chore: update Polyfill from 1.32.0 to 9.8.1 #4879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3976bb4
67f4d9e
23131ec
12a6a65
9a2a1fa
12ef302
d6718cc
f771386
f566def
8e1c32d
60553a2
7160554
3ec7ca2
3daa9fe
54278f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,8 +24,19 @@ | |
| https://github.com/SimonCropp/Polyfill | ||
| --> | ||
| <ItemGroup> | ||
| <PackageReference Include="Polyfill" Version="1.32.0" PrivateAssets="all" /> | ||
| <PackageReference Include="Polyfill" Version="9.8.1" PrivateAssets="all" /> | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: Test failure
|
||
| </ItemGroup> | ||
| <!-- We currently don't require Polyfills for System.Memory. Ensure the feature is disabled and suppress the MSBuild Warning from Polyfill. --> | ||
| <Target Name="BeforePreparePolyfill" BeforeTargets="PreparePolyfill"> | ||
| <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'"> | ||
| <PolyfillNoWarnIncorrectVersion>true</PolyfillNoWarnIncorrectVersion> | ||
| </PropertyGroup> | ||
| </Target> | ||
| <Target Name="AfterPreparePolyfill" AfterTargets="PreparePolyfill" DependsOnTargets="PreparePolyfill"> | ||
| <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'"> | ||
| <DefineConstants>$([System.String]::Copy('$(DefineConstants)').Replace('FeatureMemory','').Replace(';;',';'))</DefineConstants> | ||
| </PropertyGroup> | ||
| </Target> | ||
|
|
||
| <ItemGroup> | ||
| <Using Remove="System.Text.Json" /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,18 +69,14 @@ public static IEnumerable<KeyValuePair<TKey, TValue>> WhereNotNullValue<TKey, TV | |
| } | ||
| } | ||
| } | ||
|
|
||
| public static IEnumerable<KeyValuePair<TKey, TValue>> Append<TKey, TValue>( | ||
| this IEnumerable<KeyValuePair<TKey, TValue>> source, TKey key, TValue value) => | ||
| source.Append(new KeyValuePair<TKey, TValue>(key, value)); | ||
|
|
||
| public static IReadOnlyList<T> AsReadOnly<T>(this IList<T> list) => | ||
| list as IReadOnlyList<T> ?? new ReadOnlyCollection<T>(list); | ||
|
|
||
| #if !NET7_0_OR_GREATER | ||
| public static IReadOnlyDictionary<TKey, TValue> AsReadOnly<TKey, TValue>(this IDictionary<TKey, TValue> dictionary) | ||
| where TKey : notnull => | ||
| new ReadOnlyDictionary<TKey, TValue>(dictionary); | ||
| #endif | ||
|
|
||
|
Comment on lines
-78
to
-83
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: now included via |
||
| public static IEnumerable<T> ExceptNulls<T>(this IEnumerable<T?> source) => | ||
| source.Where(x => x != null).Select(x => x!); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,8 +65,13 @@ | |
| https://github.com/SimonCropp/Polyfill | ||
| --> | ||
| <ItemGroup> | ||
| <PackageReference Include="Polyfill" Version="1.32.0" PrivateAssets="all" /> | ||
| <PackageReference Include="Polyfill" Version="9.8.1" PrivateAssets="all" /> | ||
| </ItemGroup> | ||
| <PropertyGroup> | ||
| <PolyStringInterpolation>true</PolyStringInterpolation> | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: |
||
| <DefineConstants Condition="'$(TargetFramework)' == 'netstandard2.0'">$(DefineConstants);FeatureHttp</DefineConstants> | ||
| <DefineConstants Condition="'$(TargetFramework)' == 'netstandard2.1'">$(DefineConstants);FeatureHttp</DefineConstants> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- | ||
| On .NET Framework, we need a package reference to System.Runtime.InteropServices.RuntimeInformation. | ||
|
|
@@ -86,6 +91,12 @@ | |
| <PackageReference Include="System.Text.Json" Version="8.0.5" /> | ||
| </ItemGroup> | ||
|
|
||
| <!-- Due to Polyfill, System.Memory needs to be a top-level dependency, otherwise app start may fail with: | ||
| System.IO.FileLoadException: Could not load file or assembly 'System.Memory' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. --> | ||
| <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'net462'"> | ||
| <PackageReference Include="System.Memory" Version="4.6.3" /> | ||
| </ItemGroup> | ||
|
|
||
|
Comment on lines
+94
to
+99
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thought: This could be an issue! related to https://github.com/getsentry/sentry-dotnet/pull/4879/changes#r2895293577 I wonder if this may be considered a breaking change, But this would mean to similarly hold off on follow-up changes like (although, actually, we could simply write our own
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I'd say we avoid adding dependencies to the core package... especially when it's just for polyfills which we don't need for any functional reason (they're just to make the code slightly more attractive to read really). What's the most recent version of Polyfill that doesn't require we change any dependencies for SDK users? We could try bumping to that instead maybe?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great idea!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| <!-- | ||
| Include Sentry's custom targets file in the nuget package. | ||
| This file contains targets that are invoked during the end-user's build. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: this (and see also
test/Directory.Build.props) is requiredbecause some of the Polyfills have been moved into the
Polyfillsnamespace.This needs to be conditional,
because
Sentry, to whichPolyfillis emitting the Polyfills to asinternaltypes,does not give access of it's internals to every project in the
src(andtest) directory.Alternatively,
we could add the global using (
<Using Include="Polyfills" />) to every project that needs it,but I found that to be quite a lot of additions, and new projects don't have them then per default,
so I suggest here to do it in a more central place.