Skip to content

Conversation

NWRichmond
Copy link

@NWRichmond NWRichmond commented Aug 12, 2025

Motivation

The motivation is two-fold:

Friction installing @grafana/scenes-react

In projects that use version 12.x of @grafana/data, @grafana/runtime, etc., @grafana/scenes-react cannot be installed due to conflicting peer dependencies:

➜  metrics-drilldown git:(main) npm i @grafana/scenes-react
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: @grafana/[email protected]
npm error node_modules/@grafana/data
npm error   @grafana/data@"^12.1.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @grafana/data@"^11.0.0" from @grafana/[email protected]
npm error node_modules/@grafana/scenes-react
npm error   @grafana/scenes-react@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /Users/nick/.npm/_logs/2025-08-12T21_13_49_851Z-eresolve-report.txt
npm error A complete log of this run can be found in: /Users/nick/.npm/_logs/2025-08-12T21_13_49_851Z-debug-0.log

Alignment with Grafana support schedule

https://grafana.com/docs/grafana/latest/upgrade-guide/when-to-upgrade/#what-to-know-about-version-support describes Grafana's support schedule. The peer dependencies in @grafana/scenes and @grafana/scenes-react use versions of @grafana/<some-core-package> that are no longer supported. This is an opportunity to align Scenes packages with the broader support schedule.

What's changed?

This PR updates @grafana/* peer dependencies to "at least 11.6" in @grafana/scenes and @grafana-scenes-react. In @grafana/scenes, this means dropping support for 10.x. In @grafana/scenes-react, this change is less restrictive, requiring a minimum version of 11.6.x but allowing, for example, 12.1.0. This aligns @grafana/scenes-react with the peerDep version pattern used by @grafana/scenes.

@NWRichmond NWRichmond requested a review from mdvictor August 21, 2025 13:38
@torkelo
Copy link
Collaborator

torkelo commented Sep 8, 2025

think these are to lax, latest scenes lib requires at least 11.3 or 11.4

@NWRichmond
Copy link
Author

NWRichmond commented Sep 8, 2025

It looks like the latest scenes lib is still requiring 10.4:

"peerDependencies": {
"@grafana/data": ">=10.4",
"@grafana/e2e-selectors": ">=10.4",
"@grafana/i18n": "*",
"@grafana/runtime": ">=10.4",
"@grafana/schema": ">=10.4",
"@grafana/ui": ">=10.4",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-router-dom": "^6.28.0"
},

We could switch both to ">=11.6" to align with the broader support schedule for the previous major. If that sounds good, I'm happy to update @grafana/scenes peer deps too :)

@NWRichmond NWRichmond requested a review from torkelo September 8, 2025 20:17
@torkelo
Copy link
Collaborator

torkelo commented Sep 9, 2025

yea, we need to update those as well

@NWRichmond
Copy link
Author

I've updated the @grafana/scenes peerDeps and am finding that this test is failing:

describe('Time zone change to Africa/Addis_Ababa', () => {
it('should display the correct start time in the time start panel and time picker tooltip', () => {
const timeRange = new SceneTimeRange({ from: '2025-01-01T00:00:00.000Z', to: '2025-12-31T23:59:59.999Z' });
timeRange.onTimeZoneChange('Africa/Addis_Ababa');
expect(timeRange.getTimeZone()).toBe('Africa/Addis_Ababa');
// Verify the time start panel reads the correct start time
expect(timeRange.state.value.from.format('YYYY-MM-DD HH:mm:ss')).toBe('2025-01-01 00:00:00');
// Verify the time picker tooltip reads the correct start time
const tooltipStartTime = timeRange.state.value.from.format('HH:mm:ss');
expect(tooltipStartTime).toBe('00:00:00');
});
});

I'll revisit this with fresh eyes.

@NWRichmond NWRichmond changed the title ScenesReact: Less restrictive peer dependencies chore!: update peer dependencies of scenes packages Sep 10, 2025
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.

2 participants