Skip to content

Conversation

@asirvadAbrahamVarghese
Copy link
Contributor

@asirvadAbrahamVarghese asirvadAbrahamVarghese commented Nov 17, 2025

Fixes #1300

Description
PR with carbon-11 migration.

References:
https://carbondesignsystem.com/migrating/guide/develop/
https://github.com/carbon-design-system/carbon/blob/main/docs/migration/v11.md

Schema (if applicable)

Checklist: (please see documentation page for more information)

  • Yarn build passes
image
  • Yarn lint passes
image
  • Yarn test passes
image
  • Test coverage for new code (if applicable)
image
  • Documentation update (if applicable)
  • Correct commit message
    • format fix|feat({scope}): {description}
    • i.e. fix(pf3): wizard correctly handles next button
    • fix will release a new _._.X version
    • feat will release a new _.X._ version (use when you introduce new features)
      • we want to avoid any breaking changes, please contact us, if there is no way how to avoid them
    • scope: package
    • if you update the documentation or tests, do not use this format
      • i.e. Fix button on documenation example page

@vercel
Copy link

vercel bot commented Nov 17, 2025

@asirvadAbrahamVarghese is attempting to deploy a commit to the data-driven-forms Team on Vercel.

A member of the Team first needs to authorize it.

@asirvadAbrahamVarghese
Copy link
Contributor Author

@Hyperkid123 This was implemented prior to the manage-iq-ui-classic migration to v11, which we intend to start ASAP.

cc: @Fryguy

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.28%. Comparing base (15bd0b2) to head (7165f18).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1522      +/-   ##
==========================================
+ Coverage   94.27%   94.28%   +0.01%     
==========================================
  Files         185      185              
  Lines        3389     3397       +8     
  Branches     1462     1461       -1     
==========================================
+ Hits         3195     3203       +8     
  Misses        194      194              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

"webpack-dev-server": "^4.7.3"
},
"resolutions": {
"react-is": "^19.0.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

react-is has moved from being a hard dependency to instead being a peer dependency. This change was done to facilitate React 19 support, so we will need this resolution for Tabs component to get rendered.

see: carbon-design-system/carbon#19538

<Button
disabled={fieldArrayProps.fields.length >= maxItems}
renderIcon={AddAlt32}
renderIcon={(props) => <AddAlt size={32} {...props} />}
Copy link
Contributor Author

@asirvadAbrahamVarghese asirvadAbrahamVarghese Nov 17, 2025

Choose a reason for hiding this comment

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

For button's renderIcon, passing the props to the function component is needed for the proper styles to get applied to the icon(missing classes on the SVG element)
See: carbon-design-system/carbon#11168

{selectedValues.includes(value) && <CheckmarkFilled16 />}
</Column>
</Row>
<Grid condensed {...GridProps}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Grid system has changed. The Row component no longer exists - it's been removed. In v11, we should use Grid and Column directly without Row.
See: https://github.com/carbon-design-system/carbon/blob/main/docs/migration/v11.md#grid


const SingleCheckboxInCommon = ({ label, isDisabled, id, meta, option: { value, name, ...rest }, onChange, ...props }) => (
<CarbonCheckbox id={id} labelText={label} disabled={isDisabled} {...props} {...rest} onChange={(_value, _name, event) => onChange(event)} />
<CarbonCheckbox id={id} labelText={label} disabled={isDisabled} {...props} {...rest} onChange={(event, data) => onChange(event, data)} />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Carbon v11, the Checkbox onChange callback receives:

  • event - The change event
  • an object with { checked, id } - The new checked state and the checkbox ID

See: https://github.com/carbon-design-system/carbon/blob/main/docs/migration/v11.md#checkbox

return (
<div {...WrapperProps}>
<Toggle {...inputRest} toggled={checked} key={input.name} id={input.name} labelA={offText} labelB={onText} {...rest} />
<Toggle {...inputRest} toggled={checked} onToggle={onChange} key={name} id={name} labelA={offText} labelB={onText} {...rest} />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Carbon v11, the Toggle component structure has changed - The underlying element has been changed from a checkbox (<input type="checkbox">) to a switch button (<button role="switch">).
We can use either onClick or onToggle, going with onToggle because it provides the checked state
See: https://github.com/carbon-design-system/carbon/blob/main/docs/migration/v11.md#toggle

const Component = input.type === 'number' ? NumberInput : TextInput;

const setValue = (e, input) => (input.type === 'number' ? e.imaginaryTarget.value : e.target.value);
const setValue = (e, state, input) => (input.type === 'number' ? `${state.value}` : e.target.value);
Copy link
Contributor Author

@asirvadAbrahamVarghese asirvadAbrahamVarghese Nov 17, 2025

Choose a reason for hiding this comment

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

In carbon-11 for NumberInput, imaginaryTarget is no longer available on the onChange event. The signature for onChange is onChange(event, {value, direction})
See: https://github.com/carbon-design-system/carbon/blob/main/docs/migration/v11.md#numberinput

<div {...WrapperProps}>
<CarbonDatePicker {...input} datePickerType={datePickerType} {...DatePickerProps}>
<DatePickerInput id={input.name} invalid={Boolean(invalid)} invalidText={invalid ? invalid : ''} {...rest} />
<CarbonDatePicker {...input} datePickerType={datePickerType} invalid={Boolean(invalid)} {...DatePickerProps}>
Copy link
Contributor Author

@asirvadAbrahamVarghese asirvadAbrahamVarghese Nov 17, 2025

Choose a reason for hiding this comment

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

invalid prop on DatePickerInput has no impact now. So invalid should be passed to DatePicker and invalidText should be passed to DatePickerInput(as it is now) - this is not referenced in the migration docs, after discussing with the Carbon team, I have opened an issue: carbon-design-system/carbon#21035

@Hyperkid123
Copy link
Member

Hello @asirvadAbrahamVarghese I'll do a review shortly. Just FYI, we are currently migrating to a new release process and will be doing some additional housekeeping soon. There may be a few conflicts appearing in this PR shortly.

Copy link
Member

@Hyperkid123 Hyperkid123 left a comment

Choose a reason for hiding this comment

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

This is great!

@Hyperkid123 Hyperkid123 merged commit 1fb351e into data-driven-forms:master Nov 18, 2025
4 of 5 checks passed
@Hyperkid123
Copy link
Member

Thank you foe the contribution @asirvadAbrahamVarghese. All works as expected.

@rvsia
Copy link
Contributor

rvsia commented Nov 18, 2025

@rvsia rvsia added the released label Nov 18, 2025
@Fryguy
Copy link
Contributor

Fryguy commented Nov 18, 2025

Thanks @Hyperkid123 and @rvsia ❤️

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate to new version of carbon components

4 participants