Skip to content

Commit

Permalink
refactor: #21 Remove .NetCore from namespace (#24)
Browse files Browse the repository at this point in the history
* add ApiKey to appsettings.json in tests

* apply naming suggestions by Rider IDE

* inject mocked IJSRuntime

* HttpMethod should be String not type HttpMethod

* wip fixing tests

* simple fix

* fix tests

* cleanup

* cleanup

* test cleanup

* more cleanup

* restore file

* ci: dotnet formatting

* simplify job

* test break formatting

* fix format

* dotnet format

* fixing warnings

* fix warnings

* 5 warnings

* ci: Code formatting (#7)

* ci: dotnet formatting

* simplify job

* test break formatting

* fix format

* dotnet format

* fix acronym formatting

* dotnet format

* refactor: remove .NetCore from Raygun.NetCore.Blazor

* WIP

* fix visibility after refactor

* more refactor

* fix merge errors

* docs: update README.md
  • Loading branch information
miquelbeltran authored Jul 29, 2024
1 parent e0444c2 commit 37659e7
Show file tree
Hide file tree
Showing 76 changed files with 147 additions and 130 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ builder.UseRaygunBlazor();

The `RaygunSettings` will be obtained from the `appsettings.json` under the configuration section name `Raygun`.

For all configuration values, check the `RaygunSettings` class under `src/Raygun.NetCore.Blazor/RaygunSettings.cs`.
For all configuration values, check the `RaygunSettings` class under `src/Raygun.Blazor/RaygunSettings.cs`.

#### Initalize the client

Expand All @@ -36,34 +36,34 @@ Inject the `RaygunBlazorClient` in your code:

And call to `raygunClient.InitializeAsync()` at least once.

- [ ] TODO: Add more info. See `src/Raygun.NetCore.Blazor/RaygunBlazorClient.cs` for more information.
- [ ] TODO: Add more info. See `src/Raygun.Blazor/RaygunBlazorClient.cs` for more information.

### Recording an error

Call to `raygunClient.RecordExceptionAsync(...)`

- [ ] TODO: Add more info. See `src/Raygun.NetCore.Blazor/RaygunBlazorClient.cs` for more information.
- [ ] TODO: Add more info. See `src/Raygun.Blazor/RaygunBlazorClient.cs` for more information.

### Recording a breadcrumb

Call to `raygunClient.RecordBreadcrumb(...);`

- [ ] TODO: Add more info. See `src/Raygun.NetCore.Blazor/RaygunBlazorClient.cs` for more information.
- [ ] TODO: Add more info. See `src/Raygun.Blazor/RaygunBlazorClient.cs` for more information.

### `RaygunErrorBoundary`

- [ ] TODO: Document when to use the `RaygunErrorBoundary`.

Currently used in `src/Raygun.NetCore.Samples.Blazor.WebAssembly/App.razor`
Currently used in `src/Raygun.Samples.Blazor.WebAssembly/App.razor`

## Example Project

Example project is located in `src/Raygun.NetCore.Samples.Blazor.WebAssembly`
Example project is located in `src/Raygun.Samples.Blazor.WebAssembly`

To run the example:

1. Install `dotnet-sdk` minimum version supported in `8.0.300`.
2. Add the `ApiKey` property to in `src/Raygun.NetCore.Samples.Blazor.WebAssembly/wwwroot/appsettings.json`
2. Add the `ApiKey` property to in `src/Raygun.Samples.Blazor.WebAssembly/wwwroot/appsettings.json`

```
{
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.*" PrivateAssets="All" />

<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>$(AssemblyName.Replace("Raygun.NetCore.", "Raygun.NetCore.Tests.")), $(StrongNamePublicKey)</_Parameter1>
<_Parameter1>$(AssemblyName.Replace("Raygun.", "Raygun.Tests.")), $(StrongNamePublicKey)</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Raygun.NetCore.Blazor.Server
namespace Raygun.Blazor.Server
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Raygun.NetCore.Blazor.Server.Extensions
namespace Raygun.Blazor.Server.Extensions
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<DocumentationFile>$(DocumentationFile)\$(AssemblyName).xml</DocumentationFile>
<RootNamespace>Raygun.Blazor.Server</RootNamespace>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
using Microsoft.AspNetCore.Components;
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Rendering;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.Extensions.Options;
using Microsoft.JSInterop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Raygun.NetCore.Blazor.WebAssembly.Controls
namespace Raygun.Blazor.WebAssembly.Controls
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using KristofferStrube.Blazor.Window;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Raygun.NetCore.Blazor;
using System;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Raygun.Blazor.Extensions;

namespace Microsoft.AspNetCore.Components.WebAssembly.Hosting

namespace Raygun.Blazor.WebAssembly.Extensions
{

/// <summary>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>net8.0;</TargetFrameworks>
<DocumentationFile>$(DocumentationFile)\$(AssemblyName).xml</DocumentationFile>
<RootNamespace>Raygun.Blazor.WebAssembly</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand All @@ -14,7 +15,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Raygun.NetCore.Blazor\Raygun.NetCore.Blazor.csproj" />
<ProjectReference Include="..\Raygun.Blazor\Raygun.Blazor.csproj" />
</ItemGroup>

</Project>
12 changes: 6 additions & 6 deletions src/Raygun.NetCore.Blazor.sln → src/Raygun.Blazor.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.34929.205
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raygun.NetCore.Blazor", "Raygun.NetCore.Blazor\Raygun.NetCore.Blazor.csproj", "{8A3CFEA0-2E8B-4C45-91A8-2FD075486B11}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raygun.Blazor", "Raygun.Blazor\Raygun.Blazor.csproj", "{8A3CFEA0-2E8B-4C45-91A8-2FD075486B11}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{4DC8B2BE-3AB9-4068-BC72-F97B75716E85}"
EndProject
Expand All @@ -12,7 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks",
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{A27A5729-C507-433E-8A2B-DEB55C3B6B66}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raygun.NetCore.Blazor.WebAssembly", "Raygun.NetCore.Blazor.WebAssembly\Raygun.NetCore.Blazor.WebAssembly.csproj", "{AA9AC6CD-D344-42E7-908B-8252466CB26D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raygun.Blazor.WebAssembly", "Raygun.Blazor.WebAssembly\Raygun.Blazor.WebAssembly.csproj", "{AA9AC6CD-D344-42E7-908B-8252466CB26D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9275CC2B-11CA-4D7D-B2EC-2227F410599B}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -22,13 +22,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\README.md = ..\README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raygun.NetCore.Tests.Blazor", "Raygun.NetCore.Tests.Blazor\Raygun.NetCore.Tests.Blazor.csproj", "{D21D30DD-3133-483E-ABF9-F1AA552B11B4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raygun.Tests.Blazor", "Raygun.Tests.Blazor\Raygun.Tests.Blazor.csproj", "{D21D30DD-3133-483E-ABF9-F1AA552B11B4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raygun.NetCore.Tests.Blazor.WebAssembly", "Raygun.NetCore.Tests.Blazor.WebAssembly\Raygun.NetCore.Tests.Blazor.WebAssembly.csproj", "{A9A0782E-395E-413B-80E3-BE2C18E25ECB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raygun.Tests.Blazor.WebAssembly", "Raygun.Tests.Blazor.WebAssembly\Raygun.Tests.Blazor.WebAssembly.csproj", "{A9A0782E-395E-413B-80E3-BE2C18E25ECB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raygun.NetCore.Blazor.Server", "Raygun.NetCore.Blazor.Server\Raygun.NetCore.Blazor.Server.csproj", "{F05FD8B3-E379-4520-9008-013D0CD3C983}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raygun.Blazor.Server", "Raygun.Blazor.Server\Raygun.Blazor.Server.csproj", "{F05FD8B3-E379-4520-9008-013D0CD3C983}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raygun.NetCore.Samples.Blazor.WebAssembly", "Raygun.NetCore.Samples.Blazor.WebAssembly\Raygun.NetCore.Samples.Blazor.WebAssembly.csproj", "{CDBE774B-4AEA-4277-9044-A9718C03CEF6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raygun.Samples.Blazor.WebAssembly", "Raygun.Samples.Blazor.WebAssembly\Raygun.Samples.Blazor.WebAssembly.csproj", "{CDBE774B-4AEA-4277-9044-A9718C03CEF6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Raygun.NetCore.Blazor.Converters
namespace Raygun.Blazor.Converters
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

namespace System.Diagnostics
namespace Raygun.Blazor.Extensions
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using KristofferStrube.Blazor.Window;
using System;
using System.Net.Http.Headers;
using KristofferStrube.Blazor.Window;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Raygun.NetCore.Blazor;
using System;
using System.Net.Http.Headers;

namespace Microsoft.Extensions.DependencyInjection
namespace Raygun.Blazor.Extensions
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Raygun.NetCore.Blazor;
using System.Diagnostics;

namespace System.Diagnostics
namespace Raygun.Blazor.Extensions
{

/// <summary>
Expand All @@ -18,7 +18,7 @@ internal static class Raygun_Blazor_StackFrameExtensions
/// </returns>
/// <remarks>
/// RWM: This exists because the Razor-based stack traces will contain names like
/// "Raygun.NetCore.Samples.Blazor.WebAssembly.ViewModels.CounterViewModel+<IncrementCountAsync>d__10" which contains
/// "Raygun.Samples.Blazor.WebAssembly.ViewModels.CounterViewModel+<IncrementCountAsync>d__10" which contains
/// both the class and method names in the type name, and the reported method name will be "MoveNext" for async methods.
/// Obviously this is totally unhelpful for developers, so we need to make it more magical.
/// </remarks>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Raygun.NetCore.Blazor
namespace Raygun.Blazor.Interfaces
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Raygun.NetCore.Blazor
namespace Raygun.Blazor.Interfaces
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Raygun.NetCore.Blazor.Models;
using Raygun.Blazor.Models;

namespace Raygun.NetCore.Blazor
namespace Raygun.Blazor.Interfaces
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
using System.Diagnostics;
using System.Linq;
using System.Text.Json.Serialization;
using Raygun.Blazor.Extensions;

namespace Raygun.NetCore.Blazor.Models
namespace Raygun.Blazor.Models
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Raygun.NetCore.Blazor.Converters;
using System.Text.Json.Serialization;
using System.Text.Json.Serialization;
using Raygun.Blazor.Converters;

namespace Raygun.NetCore.Blazor.Models
namespace Raygun.Blazor.Models
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Raygun.NetCore.Blazor.Converters;
using System.Text.Json.Serialization;
using System.Text.Json.Serialization;
using Raygun.Blazor.Converters;

namespace Raygun.NetCore.Blazor.Models
namespace Raygun.Blazor.Models
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using MyCSharp.HttpUserAgentParser;
using System;
using System;
using MyCSharp.HttpUserAgentParser;

namespace Raygun.NetCore.Blazor.Models
namespace Raygun.Blazor.Models
{
/// <summary>
/// Attributes about the Browser that are <i>highly unlikely</i> to change at runtime.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Raygun.NetCore.Blazor.Models
namespace Raygun.Blazor.Models
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;

namespace Raygun.NetCore.Blazor.Models
namespace Raygun.Blazor.Models
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Reflection;
using System.Text.Json.Serialization;

namespace Raygun.NetCore.Blazor.Models
namespace Raygun.Blazor.Models
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using System.Text.Json.Serialization;

namespace Raygun.NetCore.Blazor.Models
namespace Raygun.Blazor.Models
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
using System.Diagnostics;
using System.Linq;
using System.Text.Json.Serialization;
using Raygun.Blazor.Extensions;
using NonGeneric = System.Collections;

namespace Raygun.NetCore.Blazor.Models
namespace Raygun.Blazor.Models
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace Raygun.NetCore.Blazor.Models
namespace Raygun.Blazor.Models
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;

namespace Raygun.NetCore.Blazor.Models
namespace Raygun.Blazor.Models
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Text.Json.Serialization;

namespace Raygun.NetCore.Blazor.Models
namespace Raygun.Blazor.Models
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Raygun.NetCore.Blazor.Converters;
using System.Collections.Generic;
using System.Net.Http;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace Raygun.NetCore.Blazor.Models
namespace Raygun.Blazor.Models
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Raygun.NetCore.Blazor.Models
namespace Raygun.Blazor.Models
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System.Diagnostics;
using System.Text.Json.Serialization;
using Raygun.Blazor.Extensions;

namespace Raygun.NetCore.Blazor.Models
namespace Raygun.Blazor.Models
{

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;

namespace Raygun.NetCore.Blazor.Models
namespace Raygun.Blazor.Models
{

/// <summary>
Expand Down
Loading

0 comments on commit 37659e7

Please sign in to comment.