Skip to content

Commit 734e83f

Browse files
committed
Use browser hooks for Chrome Next state
Keep useIsNextChrome in the browser hooks package only and remove duplicate browser-components feature flag plumbing.
1 parent bea176f commit 734e83f

8 files changed

Lines changed: 1 addition & 20 deletions

File tree

src/core/packages/chrome/browser-components/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ export { GridLayoutProjectSideNav } from './src/project/sidenav/grid_layout_side
2121
export { Sidebar } from './src/sidebar';
2222
export { AppMenuBar } from './src/project/app_menu';
2323
export { HeaderBreadcrumbsBadges, HeaderTopBanner, ChromelessHeader } from './src/shared';
24-
export { useHasAppMenu, useHasInlineAppHeader, useIsNextChrome } from './src/shared/chrome_hooks';
24+
export { useHasAppMenu, useHasInlineAppHeader } from './src/shared/chrome_hooks';

src/core/packages/chrome/browser-components/moon.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,9 @@ dependsOn:
3535
- '@kbn/core-chrome-layout-constants'
3636
- '@kbn/core-chrome-sidebar-components'
3737
- '@kbn/ui-side-navigation'
38-
- '@kbn/core-chrome-feature-flags'
3938
- '@kbn/core-custom-branding-browser'
4039
- '@kbn/core-custom-branding-common'
4140
- '@kbn/core-doc-links-browser'
42-
- '@kbn/core-feature-flags-browser'
43-
- '@kbn/core-feature-flags-browser-mocks'
4441
- '@kbn/core-doc-links-browser-mocks'
4542
- '@kbn/core-http-browser'
4643
- '@kbn/core-http-browser-mocks'

src/core/packages/chrome/browser-components/src/context.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import type { InternalApplicationStart } from '@kbn/core-application-browser-int
1313
import type { DocLinksStart } from '@kbn/core-doc-links-browser';
1414
import type { HttpStart } from '@kbn/core-http-browser';
1515
import type { CustomBrandingStart } from '@kbn/core-custom-branding-browser';
16-
import type { FeatureFlagsStart } from '@kbn/core-feature-flags-browser';
1716

1817
export interface ChromeComponentsDeps {
1918
application: Pick<
@@ -23,7 +22,6 @@ export interface ChromeComponentsDeps {
2322
http: Pick<HttpStart, 'basePath' | 'getLoadingCount$'>;
2423
docLinks: DocLinksStart;
2524
customBranding: Pick<CustomBrandingStart, 'customBranding$'>;
26-
featureFlags: Pick<FeatureFlagsStart, 'getBooleanValue' | 'getBooleanValue$'>;
2725
}
2826

2927
const ChromeComponentsContext = createContext<ChromeComponentsDeps | null>(null);

src/core/packages/chrome/browser-components/src/shared/chrome_hooks.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import type { DocLinksStart } from '@kbn/core-doc-links-browser';
2626
import type { CustomBranding } from '@kbn/core-custom-branding-common';
2727
import { useObservable } from '@kbn/use-observable';
2828
import { useChromeService } from '@kbn/core-chrome-browser-context';
29-
import { isNextChrome } from '@kbn/core-chrome-feature-flags';
3029
import { useChromeComponentsDeps } from '../context';
3130

3231
/**
@@ -284,12 +283,6 @@ export function useGlobalSearch(): GlobalSearchConfig | undefined {
284283
return useObservable(config$, undefined);
285284
}
286285

287-
/** Returns whether the next-chrome experience is enabled via feature flag. */
288-
export function useIsNextChrome(): boolean {
289-
const { featureFlags } = useChromeComponentsDeps();
290-
return isNextChrome(featureFlags);
291-
}
292-
293286
/** Whether an inline `AppHeader` is currently mounted by the active app. */
294287
export function useHasInlineAppHeader(): boolean {
295288
const chrome = useChromeService();

src/core/packages/chrome/browser-components/src/test_helpers.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { applicationServiceMock } from '@kbn/core-application-browser-mocks';
1515
import { docLinksServiceMock } from '@kbn/core-doc-links-browser-mocks';
1616
import { chromeServiceMock } from '@kbn/core-chrome-browser-mocks';
1717
import { coreContextMock } from '@kbn/core-base-browser-mocks';
18-
import { coreFeatureFlagsMock } from '@kbn/core-feature-flags-browser-mocks';
1918
import { ChromeServiceProvider } from '@kbn/core-chrome-browser-context';
2019
import { CoreEnvContextProvider } from '@kbn/react-kibana-context-env';
2120
import type { InternalChromeStart } from '@kbn/core-chrome-browser-internal-types';
@@ -39,7 +38,6 @@ export const createMockChromeComponentsDeps = () => {
3938
customBranding: {
4039
customBranding$: new BehaviorSubject<CustomBranding>({}),
4140
},
42-
featureFlags: coreFeatureFlagsMock.createStart(),
4341
} satisfies ChromeComponentsDeps;
4442
};
4543

src/core/packages/chrome/browser-components/tsconfig.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,9 @@
3535
"@kbn/core-chrome-layout-constants",
3636
"@kbn/core-chrome-sidebar-components",
3737
"@kbn/ui-side-navigation",
38-
"@kbn/core-chrome-feature-flags",
3938
"@kbn/core-custom-branding-browser",
4039
"@kbn/core-custom-branding-common",
4140
"@kbn/core-doc-links-browser",
42-
"@kbn/core-feature-flags-browser",
43-
"@kbn/core-feature-flags-browser-mocks",
4441
"@kbn/core-doc-links-browser-mocks",
4542
"@kbn/core-http-browser",
4643
"@kbn/core-http-browser-mocks",

src/core/packages/chrome/browser-internal/src/chrome_service.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ describe('start', () => {
247247
http: startDeps.http,
248248
docLinks: startDeps.docLinks,
249249
customBranding: startDeps.customBranding,
250-
featureFlags: startDeps.featureFlags,
251250
});
252251

253252
it('ClassicHeader renders within ChromeComponentsProvider', async () => {

src/core/packages/chrome/layout/core-chrome-layout/layouts/grid/grid_layout.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export class GridLayout implements LayoutService {
101101
http,
102102
docLinks,
103103
customBranding,
104-
featureFlags,
105104
};
106105

107106
const GridLayoutContent = React.memo(() => {

0 commit comments

Comments
 (0)