Skip to content

chore(schematics): keep non-legacy @taiga-ui/styles imports out of @taiga-ui/legacy#14587

Open
mdlufy wants to merge 1 commit into
mainfrom
fix/styles-legacy-imports
Open

chore(schematics): keep non-legacy @taiga-ui/styles imports out of @taiga-ui/legacy#14587
mdlufy wants to merge 1 commit into
mainfrom
fix/styles-legacy-imports

Conversation

@mdlufy

@mdlufy mdlufy commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Addresses the style-imports item reported by @hakimio in #13823.

Problem

The style import migration blanket-replaced @taiga-ui/styles@taiga-ui/legacy/styles:

fileContent.replaceAll('@taiga-ui/styles', '@taiga-ui/legacy/styles')

That relied on the input only ever containing v4 paths. In v4 @taiga-ui/styles held exactly basic, markup and taiga-ui-global, all of which moved to @taiga-ui/legacy/styles in v5 — so the blanket replace happened to be correct for a clean v4 project.

But the paths that stay in @taiga-ui/styles in v5 (taiga-ui-theme, taiga-ui-fonts, utils, components, mixins, variables, theme) were also rerouted to @taiga-ui/legacy/styles whenever they were already present — e.g. when re-running the migration or on partially-updated configs. The step was not idempotent.

Fix

Redirect only the three prefixes that actually moved to the legacy package and leave everything else in @taiga-ui/styles alone:

fileContent
    .replaceAll('@taiga-ui/styles/basic', '@taiga-ui/legacy/styles/basic')
    .replaceAll('@taiga-ui/styles/markup', '@taiga-ui/legacy/styles/markup')
    .replaceAll('@taiga-ui/styles/taiga-ui-global', '@taiga-ui/legacy/styles/taiga-ui-global')
    // ...unchanged core/kit → styles conversions

@taiga-ui/core/styles and @taiga-ui/kit/styles never contained basic/markup/taiga-ui-global in v4, so there is no collision with the core/kit → styles conversions.

Before / After

Input already on v5 paths:

Import Before (buggy) After
@taiga-ui/styles/taiga-ui-theme.less @taiga-ui/legacy/styles/taiga-ui-theme.less unchanged ✅
@taiga-ui/styles/taiga-ui-fonts.less @taiga-ui/legacy/styles/taiga-ui-fonts.less unchanged ✅
@taiga-ui/styles/utils @taiga-ui/legacy/styles/utils unchanged ✅
@taiga-ui/styles/markup/tui-space.less @taiga-ui/legacy/styles/markup/tui-space.less @taiga-ui/legacy/styles/markup/tui-space.less (+ TODO)
@taiga-ui/styles/taiga-ui-global.less @taiga-ui/legacy/styles/taiga-ui-global.less @taiga-ui/legacy/styles/taiga-ui-global.less (+ TODO)

Tests

  • Added 2 cases (one .less, one project.json) proving v5 @taiga-ui/styles theme/fonts/utils are left in place while markup/taiga-ui-global still move to legacy with their TODO comments.
  • Full ng-update/v5 suite green: 107 suites / 659 tests / 754 snapshots, no existing snapshot changed.

…i/legacy`

The style import migration blanket-replaced `@taiga-ui/styles` with
`@taiga-ui/legacy/styles`, which also rerouted paths that stay in
`@taiga-ui/styles` in v5 (`taiga-ui-theme`, `taiga-ui-fonts`, `utils`,
`components`, `mixins`, `variables`, `theme`). Only `basic`, `markup` and
`taiga-ui-global` actually moved to the legacy package.

Redirect only those three prefixes to `@taiga-ui/legacy/styles` and leave every
other `@taiga-ui/styles` import untouched. This also makes the step idempotent
on already-migrated files.

Ref #13823
@mdlufy
mdlufy requested a review from a team as a code owner July 17, 2026 05:04
@mdlufy
mdlufy requested review from MarsiBarsi, nsbarsukov, vladimirpotekhin and waterplea and removed request for a team July 17, 2026 05:04
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Tests completed successfully ✅

Good job 🔥

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the style import migration logic in the v5 ng-update schematic. Instead of redirecting the entire @taiga-ui/styles package to @taiga-ui/legacy/styles, it now only redirects the specific subpaths that were actually moved (basic, markup, and taiga-ui-global), keeping other paths like theme, fonts, and utils in @taiga-ui/styles. Additionally, corresponding unit tests and snapshots have been added to verify this behavior. I have no feedback to provide as the changes are well-implemented and covered by tests.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@bundlemon

bundlemon Bot commented Jul 17, 2026

Copy link
Copy Markdown

BundleMon

Unchanged files (2)
Status Path Size Limits
demo/browser/styles-(hash).css
20.65KB +10%
demo/browser/main-(hash).js
1018B +10%

No change in files bundle size

Unchanged groups (1)
Status Path Size Limits
demo/browser/*.js
3.21MB -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@github-actions

Copy link
Copy Markdown
Contributor

Visit the preview URL for this PR (updated for commit 658b8e5):

https://taiga-preview-demo--pr14587-fix-styles-legacy-imports-b9v5pcyz.web.app

(expires Sat, 18 Jul 2026 05:07:05 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: beab8d9bd402ea46497a5d590da24d00c4035f00

@github-actions

Copy link
Copy Markdown
Contributor

Playwright test results

passed  1501 passed
flaky  2 flaky
skipped  61 skipped

Details

report  Open report ↗︎
stats  1564 tests across 89 suites
duration  11 minutes, 44 seconds
commit  658b8e5

Flaky tests

chromium › tests/kit/input-chip/input-chip.pw.spec.ts › InputChip › Examples › regex separator works when copying values with newline
chromium › tests/kit/input-phone/input-phone.pw.spec.ts › InputPhone › iphone-x › mask="+7 (###) ###-##-##" › Text selection › Select range and press "Backspace" › +7 (912) 345-6|7-89| => Backspace => +7 (912) 345-6|

Skipped tests

chromium › tests/addon-doc/navigation.pw.spec.ts › Navigation › anchor links navigation works › scroll to "tui-doc-example"
chromium › tests/core/dropdown/dropdown.pw.spec.ts › Dropdown › Esc -> Hosted Dropdown
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputCard › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputCard › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputCard › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputCardGroup › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputCardGroup › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputCardGroup › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputChip › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputChip › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputChip › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputColor › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputColor › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputColor › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputDate › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputDate › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputDate › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputDateMulti › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputDateMulti › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputDateMulti › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputDateRange › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputDateRange › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputDateRange › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputDateTime › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputDateTime › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputDateTime › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputInline › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputInline › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputInline › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputMonth › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputMonth › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputMonth › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputNumber › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputNumber › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputNumber › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputPhone › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputPhone › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputPhone › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputPhoneInternational › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputPhoneInternational › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputPhoneInternational › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputPin › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputPin › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputPin › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › Pincode › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › Pincode › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › Pincode › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputTime › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputTime › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputTime › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputYear › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputYear › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputYear › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputFiles › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputFiles › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › InputFiles › update on submit
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › Input › update on change
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › Input › update on blur
chromium › tests/inputs/update-on.pw.spec.ts › Inputs - updateOn › Input › update on submit
chromium › tests/kit/input-date-range/input-date-range.pw.spec.ts › InputDateRange › items › Press backspace to remove item, textfield is empty
chromium › tests/kit/input-date-time/input-date-time.pw.spec.ts › InputDateTime › API page › should time to pre-fill with zeros on blur

Comment on lines +1 to 5
// Only `basic`, `markup` and `taiga-ui-global` were dropped from `@taiga-ui/styles`
// and now live in `@taiga-ui/legacy/styles`. Everything else (`taiga-ui-theme`,
// `taiga-ui-fonts`, `utils`, `components`, `mixins`, `variables`, `theme`) stays in
// `@taiga-ui/styles`, so redirect only the moved paths instead of the whole package.
export function migrateImports(fileContent: string): string {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Excessive comment ?

Suggested change
// Only `basic`, `markup` and `taiga-ui-global` were dropped from `@taiga-ui/styles`
// and now live in `@taiga-ui/legacy/styles`. Everything else (`taiga-ui-theme`,
// `taiga-ui-fonts`, `utils`, `components`, `mixins`, `variables`, `theme`) stays in
// `@taiga-ui/styles`, so redirect only the moved paths instead of the whole package.
export function migrateImports(fileContent: string): string {
export function migrateImports(fileContent: string): string {

@mdlufy mdlufy changed the title fix(cdk): keep non-legacy @taiga-ui/styles imports out of @taiga-ui/legacy chore(schematics): keep non-legacy @taiga-ui/styles imports out of @taiga-ui/legacy Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants