Skip to content

Separate media components into Microsoft.AspNetCore.Components.Media package#67130

Open
Copilot wants to merge 2 commits into
mainfrom
copilot/separate-components-into-media-package
Open

Separate media components into Microsoft.AspNetCore.Components.Media package#67130
Copilot wants to merge 2 commits into
mainfrom
copilot/separate-components-into-media-package

Conversation

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor
  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Extract media components into standalone Microsoft.AspNetCore.Components.Media package.

Description

Moves Image, Video, FileDownload, MediaSource, MediaContext, and MediaComponentBase out of Microsoft.AspNetCore.Components.Web into their own package as discussed in #63540.

Namespace change: Microsoft.AspNetCore.Components.Web.MediaMicrosoft.AspNetCore.Components.Media

New package structure:

  • src/Components/Media/src/ — library targeting Microsoft.AspNetCore.Components + Microsoft.JSInterop (no Web dependency)
  • src/Components/Media/test/ — unit tests (all 14 pass)

What was removed from Microsoft.AspNetCore.Components.Web:

  • Web/src/Media/ directory (6 source files)
  • Web/test/Media/ directory (2 test files)
  • All Web.Media.* entries from PublicAPI.Unshipped.txt

Infrastructure:

  • Registered in eng/ProjectReferences.props
  • Added to AspNetCore.slnx, Components.slnf, ComponentsNoDeps.slnf
  • InternalsVisibleTo added for test project in Microsoft.AspNetCore.Components.csproj
  • BasicTestApp updated to reference new package and namespace
// Before
@using Microsoft.AspNetCore.Components.Web.Media

// After
@using Microsoft.AspNetCore.Components.Media

…package

Move Image, Video, FileDownload, MediaSource, MediaContext, and MediaComponentBase
from Microsoft.AspNetCore.Components.Web into a new standalone
Microsoft.AspNetCore.Components.Media package. Update namespace from
Microsoft.AspNetCore.Components.Web.Media to Microsoft.AspNetCore.Components.Media.

- Create new src/Components/Media/src project
- Create new src/Components/Media/test project with all media unit tests
- Remove media files from Web project and its PublicAPI
- Update BasicTestApp and _Imports.razor to use new namespace
- Register new project in eng/ProjectReferences.props
- Update AspNetCore.slnx and solution filters

Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Copilot AI requested a review from javiercn June 10, 2026 16:09
@javiercn javiercn marked this pull request as ready for review June 10, 2026 16:11
@javiercn javiercn requested review from a team and tdykstra as code owners June 10, 2026 16:11
Copilot AI review requested due to automatic review settings June 10, 2026 16:11
@javiercn javiercn requested review from a team and wtgodbe as code owners June 10, 2026 16:11
@github-actions github-actions Bot added the area-blazor Includes: Blazor, Razor Components label Jun 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extracts the Blazor media component suite (Image, Video, FileDownload, plus supporting types) out of Microsoft.AspNetCore.Components.Web into a new standalone Microsoft.AspNetCore.Components.Media package, including a namespace move from Microsoft.AspNetCore.Components.Web.Media to Microsoft.AspNetCore.Components.Media.

Changes:

  • Introduces a new src/Components/Media/ library + test project, with corresponding PublicAPI files.
  • Updates test assets (BasicTestApp) and unit tests to reference the new package/namespace.
  • Wires the new projects into repo infrastructure (project reference providers and solution/solution-filter inclusion) and updates Components.Web’s unshipped API list to reflect the move.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Components/Web/src/PublicAPI.Unshipped.txt Removes the unshipped Microsoft.AspNetCore.Components.Web.Media API entries now moved to the new package.
src/Components/test/testassets/BasicTestApp/MediaTest/VideoTestComponent.razor Updates @using to the new Microsoft.AspNetCore.Components.Media namespace.
src/Components/test/testassets/BasicTestApp/MediaTest/ImageTestComponent.razor Updates @using to the new Microsoft.AspNetCore.Components.Media namespace.
src/Components/test/testassets/BasicTestApp/MediaTest/FileDownloadTestComponent.razor Updates @using to the new Microsoft.AspNetCore.Components.Media namespace.
src/Components/test/testassets/BasicTestApp/BasicTestApp.csproj Adds a reference to Microsoft.AspNetCore.Components.Media for the test app.
src/Components/test/testassets/BasicTestApp/_Imports.razor Updates global imports to the new media namespace.
src/Components/Media/test/Microsoft.AspNetCore.Components.Media.Tests.csproj Adds the new Media test project.
src/Components/Media/test/ImageTest.cs Moves unit tests to the new namespace and updates usings to Components.Media.
src/Components/Media/test/FileDownloadTest.cs Moves unit tests to the new namespace and updates usings to Components.Media.
src/Components/Media/src/Video.cs Updates namespace to Microsoft.AspNetCore.Components.Media.
src/Components/Media/src/PublicAPI.Unshipped.txt Adds the unshipped public API surface for the new package.
src/Components/Media/src/PublicAPI.Shipped.txt Adds initial shipped API file for the new assembly.
src/Components/Media/src/Microsoft.AspNetCore.Components.Media.csproj Adds the new Media library project and its references/metadata.
src/Components/Media/src/MediaSource.cs Updates namespace to Microsoft.AspNetCore.Components.Media.
src/Components/Media/src/MediaContext.cs Updates namespace to Microsoft.AspNetCore.Components.Media.
src/Components/Media/src/MediaComponentBase.cs Updates namespace to Microsoft.AspNetCore.Components.Media.
src/Components/Media/src/Image.cs Updates namespace to Microsoft.AspNetCore.Components.Media.
src/Components/Media/src/FileDownload.cs Updates namespace to Microsoft.AspNetCore.Components.Media.
src/Components/ComponentsNoDeps.slnf Includes the new Media projects in the “no deps” solution filter.
src/Components/Components/src/Microsoft.AspNetCore.Components.csproj Adds InternalsVisibleTo for the new Media test assembly.
src/Components/Components.slnf Includes the new Media projects in the Components solution filter.
eng/ProjectReferences.props Registers Microsoft.AspNetCore.Components.Media as a reference provider for repo build infrastructure.
AspNetCore.slnx Adds the new Media projects to the main solution structure.

…ew Media package

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants