Skip to content
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

Separates test extensions into it's own assembly (Fixes #149) #150

Merged
merged 7 commits into from
Aug 7, 2021

Conversation

nshenoy
Copy link
Contributor

@nshenoy nshenoy commented Jun 15, 2021

Reduces app download size for projects that are dependant on Blazor.LocalStorage by not including bunit.core as part of the initial download. The test extensions have been pulled out into a completely separate assembly for use by unit tests. Fixes #149 .

nshenoy and others added 4 commits June 15, 2021 14:24
Reduces app download size for projects that are dependant on Blazor.LocalStorage by not including `bunit.core` as part of the initial download. The test extensions have been pulled out into a completely separate assembly for use by unit tests.
Builds and packages the TestExtensions nuget package
Separates test extensions into it's own package
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert this as it's just a whitespace change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! Good catch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted.

Comment on lines -6 to -11
[assembly: InternalsVisibleTo("Blazored.LocalStorage.Tests, PublicKey=" +
"0024000004800000940000000602000000240000525341310004000001000100e94102d6760ebc" +
"ff1970798791888ddf102ac709e19db9a312721fafca42b894652b59bada7d592a4ab62a5b7650" +
"7a27720e922bc310c4f5aa75acd8ab59632c920ac41a7e9abcaf4b8bb5525a60931faccea704db" +
"dcf68e1207616751447dcfec687f18854148aa66a9a09e1edc8fd0c9bd11950b4baf7d46fe3899" +
"3af4add4")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you choose to remove this attribute and move it to the csproj file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The presence of [InternalsVisibleTo] will auto-generate a AssemblyInfo.cs file at compile time no matter where it lives. By having it appear in the SystemTextJsonSerializer.cs file may hide that the fact that there are other arguably more important internals that we want visible to friend assemblies (e.g. IStorageProvider). Having this in the csproj gives it a centralized location. This is my own opinion of course, and I can happily revert. 😄

Comment on lines +52 to +64
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>
Blazored.LocalStorage.TestExtensions, PublicKey=0024000004800000940000000602000000240000525341310004000001000100e94102d6760ebcff1970798791888ddf102ac709e19db9a312721fafca42b894652b59bada7d592a4ab62a5b76507a27720e922bc310c4f5aa75acd8ab59632c920ac41a7e9abcaf4b8bb5525a60931faccea704dbdcf68e1207616751447dcfec687f18854148aa66a9a09e1edc8fd0c9bd11950b4baf7d46fe38993af4add4
</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>
Blazored.LocalStorage.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100e94102d6760ebcff1970798791888ddf102ac709e19db9a312721fafca42b894652b59bada7d592a4ab62a5b76507a27720e922bc310c4f5aa75acd8ab59632c920ac41a7e9abcaf4b8bb5525a60931faccea704dbdcf68e1207616751447dcfec687f18854148aa66a9a09e1edc8fd0c9bd11950b4baf7d46fe38993af4add4
</_Parameter1>
</AssemblyAttribute>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment about removal of attribute.

Comment on lines +42 to +46
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>
Blazored.LocalStorage.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100e94102d6760ebcff1970798791888ddf102ac709e19db9a312721fafca42b894652b59bada7d592a4ab62a5b76507a27720e922bc310c4f5aa75acd8ab59632c920ac41a7e9abcaf4b8bb5525a60931faccea704dbdcf68e1207616751447dcfec687f18854148aa66a9a09e1edc8fd0c9bd11950b4baf7d46fe38993af4add4
</_Parameter1>
</AssemblyAttribute>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment about removal of attribute

@@ -11,6 +11,7 @@ env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
PROJECT_NAME: LocalStorage
TESTEXTENSIONS_PROJECT_NAME: $PROJECT_NAME.TestExtensions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about it, it might be better to have two separate build pipelines, one for each package. That way they can be released independently, if required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea. I can work on that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted the change to this file and introduced a new ci-testextensions.yml pipeline definition (not loving the file name).

nshenoy and others added 3 commits June 18, 2021 17:53
Reverts the main pipeline to just build the main Blazored.LocalStorage library. Introduces new pipeline yml for building and packaging the Blazored.LocalStorage.TestExtensions library.
@chrissainty chrissainty added Feature New feature that will be added to the project Maintenance General maintenance and removed Feature New feature that will be added to the project labels Aug 7, 2021
@chrissainty chrissainty merged commit 9434db4 into Blazored:main Aug 7, 2021
@chrissainty
Copy link
Member

Thanks for doing this @nshenoy. Apologies for taking a while to get it merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance General maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bunit.core.dll dependency is included as part of app download
3 participants