Skip to content

feat: shellui migrate rewrites pages for template API changes - #78

Open
Shewart wants to merge 4 commits into
mainfrom
feat/migrate-command
Open

Shewart wants to merge 4 commits into
mainfrom
feat/migrate-command

Conversation

@Shewart

@Shewart Shewart commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #58.

shellui update replaces a component but leaves your pages on the old API, so the build breaks. shellui migrate fixes the known cases:

shellui migrate --dry-run      # show the changes
shellui migrate                # show them, then ask before writing
shellui migrate date-picker    # only some migrations
shellui migrate --yes          # write without asking (required in CI or a pipe)

It reads the project's own .razor and .cs files. It skips the installed components under ComponentsPath (update rewrites those) and bin, obj and node_modules. It shows each changed line, and nothing is written without a yes.

Migrations, taken from the release notes' upgrade sections:

Name Change
input Input.InputVariant.X → InputVariant.X
date-picker SelectedDate / SelectedDateChanged / @bind-SelectedDate → Value / ValueChanged / @bind-Value, on <DatePicker> tags only, so Calendar is untouched
time-picker the same for SelectedTime on <TimePicker>
pagination OnPageChange → CurrentPageChanged, except on a tag that binds CurrentPage (that would set it twice)
calendar reports SelectedDateChanged handlers that take a DateTime (now DateTime?). Not rewritten, since the handler body may need changes too.

Tag rewrites scan to the tag's closing > outside quotes, so attributes spread over several lines and > inside a quoted value are handled.

Checked end to end in a fresh dotnet new blazor app:

  1. Installed input, date-picker, time-picker, pagination and calendar with the local CLI, then wrote a page in the old API. It failed to build.
  2. migrate --dry-run showed the four rewrites and flagged the Calendar handler.
  3. Without --yes in a pipe, nothing was written (exit 1).
  4. --yes rewrote the page. After fixing the flagged handler, the app built with 0 errors and 0 warnings, and a second run said "Nothing to migrate".

On the demo app it found one real case, the deprecated Pagination.OnPageChange, which is migrated here.

Tests: 540 passing on net8.0 and net10.0, 0 warnings.

shellui update replaces a component but leaves the app's pages on the
old API, so the build breaks. migrate reads the project's .razor and
.cs files (not the installed components or build output), shows each
changed line and asks before writing; --dry-run only shows, --yes
writes without asking and is required outside an interactive terminal.

Migrations, from the release notes' upgrade sections:
- input: Input.InputVariant.X -> InputVariant.X
- date-picker / time-picker: SelectedDate / SelectedTime (with Changed
  and @bind-) -> Value, on those tags only, so Calendar is untouched
- pagination: OnPageChange -> CurrentPageChanged, unless the tag binds
  CurrentPage
- calendar: reports SelectedDateChanged handlers that take a DateTime
  instead of DateTime?; nothing is rewritten

Fixes #58
Each migration, tag scoping (Calendar left alone, > inside a quoted value), the bound-CurrentPage exception, skipping installed components and obj, the Calendar note and an up-to-date app.
Applied with shellui migrate pagination.
Copilot AI balanced review requested due to automatic review settings October 23, 2026 05:03

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shellui migrate for template API changes

2 participants