chore(schematics): keep non-legacy @taiga-ui/styles imports out of @taiga-ui/legacy#14587
chore(schematics): keep non-legacy @taiga-ui/styles imports out of @taiga-ui/legacy#14587mdlufy wants to merge 1 commit into
@taiga-ui/styles imports out of @taiga-ui/legacy#14587Conversation
…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
Tests completed successfully ✅Good job 🔥 |
There was a problem hiding this comment.
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.
BundleMonUnchanged files (2)
No change in files bundle size Unchanged groups (1)
Final result: ✅ View report in BundleMon website ➡️ |
|
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 |
Playwright test results
Details
Flaky testschromium › tests/kit/input-chip/input-chip.pw.spec.ts › InputChip › Examples › regex separator works when copying values with newline Skipped testschromium › tests/addon-doc/navigation.pw.spec.ts › Navigation › anchor links navigation works › scroll to "tui-doc-example" |
| // 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 { |
There was a problem hiding this comment.
Excessive comment ?
| // 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 { |
@taiga-ui/styles imports out of @taiga-ui/legacy@taiga-ui/styles imports out of @taiga-ui/legacy
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:That relied on the input only ever containing v4 paths. In v4
@taiga-ui/stylesheld exactlybasic,markupandtaiga-ui-global, all of which moved to@taiga-ui/legacy/stylesin v5 — so the blanket replace happened to be correct for a clean v4 project.But the paths that stay in
@taiga-ui/stylesin v5 (taiga-ui-theme,taiga-ui-fonts,utils,components,mixins,variables,theme) were also rerouted to@taiga-ui/legacy/styleswhenever 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/stylesalone:@taiga-ui/core/stylesand@taiga-ui/kit/stylesnever containedbasic/markup/taiga-ui-globalin v4, so there is no collision with the core/kit → styles conversions.Before / After
Input already on v5 paths:
@taiga-ui/styles/taiga-ui-theme.less@taiga-ui/legacy/styles/taiga-ui-theme.less@taiga-ui/styles/taiga-ui-fonts.less@taiga-ui/legacy/styles/taiga-ui-fonts.less@taiga-ui/styles/utils@taiga-ui/legacy/styles/utils@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
.less, oneproject.json) proving v5@taiga-ui/stylestheme/fonts/utils are left in place whilemarkup/taiga-ui-globalstill move to legacy with their TODO comments.ng-update/v5suite green: 107 suites / 659 tests / 754 snapshots, no existing snapshot changed.