-
Notifications
You must be signed in to change notification settings - Fork 3.3k
refactor: ECHO-421: remove bem from lso left overs #8814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: ECHO-421: remove bem from lso left overs #8814
Conversation
✅ Deploy Preview for label-studio-docs-new-theme ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for heartex-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for label-studio-storybook canceled.
|
✅ Deploy Preview for label-studio-playground canceled.
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## develop #8814 +/- ##
===========================================
- Coverage 66.05% 57.78% -8.28%
===========================================
Files 828 561 -267
Lines 64381 40439 -23942
Branches 10938 10938
===========================================
- Hits 42530 23369 -19161
+ Misses 21847 17066 -4781
Partials 4 4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d633545 to
06de89d
Compare
nass600
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, only the modal to change
06de89d to
1ff0e5d
Compare
Migrated Space component from BemWithSpecificContext() to cn() helper.
- Replaced BemWithSpecificContext import with cn import
- Removed const { Block } = BemWithSpecificContext() pattern
- Converted Block name="space-ls" with mod and mix to div with cn().mod().mix()
- Preserved all props, mods (direction, size, spread, stretch, align), and children
- No behavior change, equivalent class strings
Part of Label Studio BEM migration (Additional files)
Migrated RadioGroup and RadioButton components from BemWithSpecificContext() to cn() helper.
- Replaced BemWithSpecificContext import with cn import
- Removed const { Block, Elem } = BemWithSpecificContext() pattern
- Converted Block name="radio-group-ls" with mod and mix to div with cn().mod().mix()
- Converted Elem name="buttons" to div with cn().elem()
- Converted Elem name="button" in RadioButton to div with cn().elem().mod()
- Preserved all props, refs, context, handlers, and form integration
- No behavior change, equivalent class strings
Part of Label Studio BEM migration (Additional files)
Migrated Breadcrumbs component from BemWithSpecificContext() to cn() helper.
- Replaced BemWithSpecificContext import with cn import
- Removed const { Block, Elem } = BemWithSpecificContext() pattern
- Converted Block name="breadcrumbs" to div with cn("breadcrumbs")
- Converted Elem tag="ul" name="list" to ul with cn().elem()
- Converted Elem tag="span" name="label" to span with cn().elem().mod()
- Converted all Elem tag="li" name="item" variations to li with cn().elem().mod()
- Converted Elem with component={Dropdown.Trigger} to Dropdown.Trigger with component="li"
- Preserved all props, handlers, dropdown integration, and conditional rendering
- No behavior change, equivalent class strings
Part of Label Studio BEM migration (Additional files)
Migrated ExportPage and FormatInfo components from BemWithSpecificContext() to cn() helper.
- Replaced BemWithSpecificContext import with cn import
- Removed const { Block, Elem } = BemWithSpecificContext() pattern
- Converted Block name="export-page" to div with cn("export-page")
- Converted Block name="formats" to div with cn("formats")
- Converted all Elem components (footer, recent, actions, info, list, item, name, tag, description, feedback)
- Preserved all props, handlers, modal integration, and format selection logic
- No behavior change, equivalent class strings
Part of Label Studio BEM migration (Additional files - FINAL!)
Migrated InviteLink InvitationModal from Block to cn() helper.
- Replaced Block import from MenuContext with cn import
- Converted Block name="invite" to div with cn("invite")
- Preserved all props and Input integration
- No behavior change, equivalent class strings
Part of Label Studio BEM migration (Additional files)
Migrated Menu, Menu.Spacer, Menu.Divider, and Menu.Group from Block/Elem to cn() helper.
- Removed Block/Elem imports from MenuContext
- Converted Block tag="ul" name="main-menu" with mod and mix to ul with cn().mod().mix()
- Converted Menu.Spacer Elem to li with cn("main-menu").elem("spacer")
- Converted Menu.Divider Elem to li with cn("main-menu").elem("divider")
- Converted Menu.Group Block and Elems to div/ul structure with cn()
- Preserved all props, refs, handlers, context, and dropdown integration
- No behavior change, equivalent class strings
Part of Label Studio BEM migration (Additional files)
Cleaned up MenuContext to remove unused Block/Elem exports. - Removed BemWithSpecificContext import - Removed Block/Elem exports (no longer used after Menu.jsx migration) - Only MenuContext remains (still needed for menu state) - No behavior change Part of Label Studio BEM migration (Additional files)
1ff0e5d to
1e1baf5
Compare
refactor(bem): complete BEM migration - remove remaining BemWithSpecificContext usage
Summary
Completes the Label Studio BEM migration by migrating 7 additional files that used
BemWithSpecificContext()pattern, which were not included in PR #8765.Total migrated: 7 files
Pattern:
const { Block, Elem } = BemWithSpecificContext()Result: 100% BEM migration complete for Label Studio
Background
PR #8765 migrated 24 files that used direct
Block/Elemimports. This PR covers the remaining files that used theBemWithSpecificContext()pattern - a different import style that creates isolated BEM contexts.Changes
Migration Pattern
Before:
After:
Files Migrated
Components (6 files):
Cleanup (1 file):
7. MenuContext.js - Removed unused Block/Elem exports
Verification
bem.tsx (final):
Safety Analysis
Why these migrations are safe:
BemWithSpecificContext creates isolated contexts
Each call creates a separate Block/Elem instance - children cannot inherit context from parents in different files.
No cross-repository dependencies
LSE has its own copies of these components (Space, Menu, etc.) and doesn't import from LSO.
Internal children migrated together
Components like
RadioGroup.ButtonandMenu.Spacerare defined in the same file and migrated simultaneously.No external Block/Elem children
Verified that no external code passes
<Block>or<Elem>as children to these components.Statistics
Commits: 7
Lines changed: 67 insertions, 84 deletions
Files modified: 9
Combined with PR #8765: