mirror of
https://github.com/langgenius/dify.git
synced 2026-03-05 23:57:06 +08:00
2.3 KiB
2.3 KiB
Overlay Migration Guide
This document tracks the migration away from legacy overlay APIs.
Scope
- Deprecated imports:
@/app/components/base/portal-to-follow-elem@/app/components/base/tooltip@/app/components/base/modal@/app/components/base/confirm@/app/components/base/select(includingcustom/pure)
- Replacement primitives:
@/app/components/base/ui/tooltip@/app/components/base/ui/dropdown-menu@/app/components/base/ui/popover@/app/components/base/ui/dialog@/app/components/base/ui/alert-dialog@/app/components/base/ui/select
- Tracking issue: https://github.com/langgenius/dify/issues/32767
ESLint policy
no-restricted-importsblocks all deprecated imports listed above.- The rule is enabled for normal source files (
.ts/.tsx) and test files are excluded. - Legacy
app/components/base/*callers are temporarily allowlisted inOVERLAY_MIGRATION_LEGACY_BASE_FILES(web/eslint.constants.mjs). - New files must not be added to the allowlist without migration owner approval.
Migration phases
- Business/UI features outside
app/components/base/**- Migrate old calls to semantic primitives from
@/app/components/base/ui/**. - Keep deprecated imports out of newly touched files.
- Migrate old calls to semantic primitives from
- Legacy base components in allowlist
- Migrate allowlisted base callers gradually.
- Remove migrated files from
OVERLAY_MIGRATION_LEGACY_BASE_FILESimmediately.
- Cleanup
- Remove remaining allowlist entries.
- Remove legacy overlay implementations when import count reaches zero.
Allowlist maintenance
- After each migration batch, run:
pnpm -C web lint:fix --prune-suppressions <changed-files>
- If a migrated file was in the allowlist, remove it from
web/eslint.constants.mjsin the same PR. - Never increase allowlist scope to bypass new code.
React Refresh policy for base UI primitives
- We keep primitive aliases (for example
DropdownMenu = Menu.Root) in the same module. - For
app/components/base/ui/**/*.tsx,react-refresh/only-export-componentsis currently set tooffin ESLint to avoid false positives and IDE noise during migration. - Do not use file-level
eslint-disablecomments for this policy; keep control in the scoped ESLint override.