Skip to content

chore(ui-babel-preset): remove dead babel plugins - #2682

Open
joyenjoyer wants to merge 1 commit into
masterfrom
chore-remove-dead-babel-plugins
Open

joyenjoyer wants to merge 1 commit into
masterfrom
chore-remove-dead-babel-plugins

Conversation

@joyenjoyer

Copy link
Copy Markdown
Contributor

Summary

  • Remove babel-plugin-transform-imports (only rewrote imports for the CommonJS/lib build output; unused)
  • Remove babel-plugin-add-displayname-for-react (static displayName plugin for class components; unused)

Test Plan

  • No manual verification needed; covered by existing build/lint/tests.

Fixes INSTUI-5149

🤖 Generated with Claude Code

@joyenjoyer joyenjoyer self-assigned this Aug 10, 2026
@joyenjoyer
joyenjoyer requested a review from HerrTopi August 10, 2026 12:45
@github-actions

github-actions Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://instructure.design/pr-preview/pr-2682/

Built to branch gh-pages at 2026-09-24 14:34 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

github-actions Bot pushed a commit that referenced this pull request Aug 10, 2026
@github-actions

github-actions Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Visual regression report

Cypress suite: ✅ Passing

Visual diff: ⚠️ Changes detected.

Status Count
Unchanged 98
Changed 1
New 0
Removed 0

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.

Diff images (1)

badge-canvas.png — 1573 pixels differ

Baselines come from the visual-baselines branch. They refresh on every merge to master. The Cypress suite line covers the a11y and console-error assertions — a ❌ there means the suite found real issues even if the visual diff is clean.

@HerrTopi
HerrTopi requested a review from balzss August 14, 2026 09:20

let plugins = []

if (opts.transformImports) {

@matyasf matyasf Aug 18, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

FYI this is referenced in lots of babel.config.js files, it needs to be deleted from there too

@joyenjoyer joyenjoyer Sep 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed all the obsolete plugin references and workarounds.

Please check the PR again.

@balzss
balzss removed their request for review September 1, 2026 08:44
@joyenjoyer
joyenjoyer marked this pull request as draft September 7, 2026 14:26
@joyenjoyer
joyenjoyer force-pushed the chore-remove-dead-babel-plugins branch from 82dba5e to 0b9bd46 Compare September 24, 2026 13:48
@joyenjoyer
joyenjoyer marked this pull request as ready for review September 24, 2026 13:51
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@joyenjoyer
joyenjoyer force-pushed the chore-remove-dead-babel-plugins branch from 0b9bd46 to b02a710 Compare September 24, 2026 14:31
// 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'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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'

@joyenjoyer joyenjoyer Sep 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

@joyenjoyer joyenjoyer Sep 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Dropped TRANSFORM_IMPORTS: 1 from the CJS build env vars.

@joyenjoyer
joyenjoyer requested a review from matyasf September 24, 2026 14:35
github-actions Bot pushed a commit that referenced this pull request Sep 24, 2026
Comment on lines -49 to -58
// 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
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

hmm this is a breaking change technically.... Can you please do a quick check that on one is using this?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants