Skip to content
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

[core] Improve React 19 support #16048

Merged
merged 30 commits into from
Jan 2, 2025
Merged

[core] Improve React 19 support #16048

merged 30 commits into from
Jan 2, 2025

Conversation

LukasTy
Copy link
Member

@LukasTy LukasTy commented Dec 31, 2024

Cherry-pick #15769.

  • Introduce new changes and different fixes appropriate to v7 to avoid TS issues.
  • Bump certain dependencies to avoid duplications after bumping @mui/internal-test-utils
    • @testing-library/react, sinon, jsdom, mocha

renovate bot and others added 12 commits December 31, 2024 15:57
@LukasTy LukasTy added core Infrastructure work going on behind the scenes dependencies Update of dependencies React 19 support About improving React 19 support labels Dec 31, 2024
@LukasTy LukasTy self-assigned this Dec 31, 2024
@LukasTy LukasTy added the cherry-pick The PR was cherry-picked from the newer alpha/beta/stable branch label Dec 31, 2024
@mui-bot
Copy link

mui-bot commented Dec 31, 2024

Deploy preview: https://deploy-preview-16048--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against cad51b6

@@ -12,7 +12,7 @@ export function ItemTooltipFixedY() {
const svgRef = useSvgRef(); // Get the ref of the <svg/> component.
const drawingArea = useDrawingArea(); // Get the dimensions of the chart inside the <svg/>.

if (!tooltipData || !mousePosition) {
if (!tooltipData || !mousePosition || !svgRef.current) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This change is unique to v7.

@@ -29,7 +29,8 @@ export function ItemTooltipTopElement() {
if (
tooltipData.identifier.type !== 'bar' ||
tooltipData.identifier.dataIndex === undefined ||
tooltipData.value === null
tooltipData.value === null ||
svgRef.current === null
Copy link
Member Author

Choose a reason for hiding this comment

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

This change is unique to v7.

return undefined;
}
const element = svgRef.current;
Copy link
Member Author

Choose a reason for hiding this comment

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

This basically replicated the situation in master to avoid the element being | null below.

packages/x-charts/src/LineChart/AnimatedLine.tsx Outdated Show resolved Hide resolved
skipAnimation
slots={slots}
slotProps={slotProps}
sx={{ shapeRendering: 'auto' }}
Copy link
Member Author

Choose a reason for hiding this comment

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

This works on v7, but is once again an unknown prop. 🤔 🙈
How do you want to handle it for v7 @mui/xcharts?
Reference for v8/master: https://github.com/mui/mui-x/pull/15769/files#r1892161016

Copy link
Member Author

Choose a reason for hiding this comment

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

@JCQuintas WDYT about this case?
For v7 this is a tiny behavior change as sx works. 🤔
Maybe we should just ignore this line on v7 to avoid unwanted changes. 🤔

Copy link
Member

Choose a reason for hiding this comment

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

just remove is ok, doesn't affect visual it seems

@@ -7,7 +7,7 @@ import { Initializable } from './context.types';

export interface DrawingProviderProps extends LayoutConfig {
children: React.ReactNode;
svgRef: React.RefObject<SVGSVGElement>;
svgRef: React.RefObject<SVGSVGElement | null>;
Copy link
Member Author

Choose a reason for hiding this comment

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

These changes are unique to v7.

@JCQuintas
Copy link
Member

@LukasTy charts are not working on the preview. I guess some of the changes broke it. I'll eventually check it this week 😆

.eslintrc.js Outdated Show resolved Hide resolved
@JCQuintas
Copy link
Member

Why argos has a lot of changes and additions? 🤔

@LukasTy
Copy link
Member Author

LukasTy commented Jan 2, 2025

Why argos has a lot of changes and additions? 🤔

It might have been a flaky run/diff on Argos side. 🤔
Will retry.

@LukasTy
Copy link
Member Author

LukasTy commented Jan 2, 2025

Why argos has a lot of changes and additions? 🤔

It might have been a flaky run/diff on Argos side. 🤔 Will retry.

@JCQuintas it could have been produced by the run on react 18.3.1. 🙈
The latest run is still flaky on 2 tests, rerunning once more. 👍

@LukasTy LukasTy merged commit 707a652 into mui:v7.x Jan 2, 2025
20 checks passed
@LukasTy LukasTy deleted the cherry-pick-15769 branch January 2, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick The PR was cherry-picked from the newer alpha/beta/stable branch core Infrastructure work going on behind the scenes dependencies Update of dependencies React 19 support About improving React 19 support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants