chore(ui-babel-preset): remove dead babel plugins - #2682
joyenjoyer wants to merge 1 commit into
Conversation
|
Visual regression reportCypress suite: ✅ Passing Visual diff:
Accessibility (axe): ✅ No violations. 📊 View full report — click a screenshot's ⚠ badge to see each violation boxed on the image, with the offending element named and contrast failures shown as color swatches. Baselines come from the |
|
|
||
| let plugins = [] | ||
|
|
||
| if (opts.transformImports) { |
There was a problem hiding this comment.
FYI this is referenced in lots of babel.config.js files, it needs to be deleted from there too
There was a problem hiding this comment.
I removed all the obsolete plugin references and workarounds.
Please check the PR again.
82dba5e to
0b9bd46
Compare
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0b9bd46 to
b02a710
Compare
| // this bug is very likely caused by `babel-plugin-transform-imports` and can be reverted once it is removed from the codebase | ||
| import { isSafari, safeLinkProps } from '@instructure/ui-utils' | ||
| import { combineDataCid } from '@instructure/ui-utils' | ||
| import { isSafari, safeLinkProps, combineDataCid } from '@instructure/ui-utils' |
There was a problem hiding this comment.
Consolidated back into one import statement. The old split-line workaround was needed because babel-plugin-transform-imports would drop isSafari from the build when it shared a line with other named imports — that plugin is gone now, so the workaround (and its TODO) is no longer needed. Same change applied in v2.
| colorToRGB: colorToRGB | ||
| } | ||
|
|
||
| export type { RGBType, HSVType, HSLType, RGBAType } from './colorTypes' |
There was a problem hiding this comment.
Removed the default-export table, it only existed because babel-plugin-transform-imports required the exported name to match the filename. All internal consumers (ui-color-picker) were switched from import conversions from ... to named imports in this same PR.
| getCommand('babel', [...babelArgs, '--out-dir', 'lib'], { | ||
| ...envVars, | ||
| ...{ TRANSFORM_IMPORTS: '1' } | ||
| ...envVars |
There was a problem hiding this comment.
Dropped TRANSFORM_IMPORTS: 1 from the CJS build env vars.
| // TODO remove when we get rid of babel-plugin-transform-imports | ||
| // This default export is needed because babel-plugin-transform-imports will | ||
| // fail if the exported name is not the same as the filename | ||
| export default { | ||
| color2hex: color2hex, | ||
| colorToHex8: colorToHex8, | ||
| colorToHsva: colorToHsva, | ||
| colorToHsla: colorToHsla, | ||
| colorToRGB: colorToRGB | ||
| } |
There was a problem hiding this comment.
hmm this is a breaking change technically.... Can you please do a quick check that on one is using this?

Summary
babel-plugin-transform-imports(only rewrote imports for the CommonJS/lib build output; unused)babel-plugin-add-displayname-for-react(static displayName plugin for class components; unused)Test Plan
Fixes INSTUI-5149
🤖 Generated with Claude Code