Skip to content

Conversation

@artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented May 13, 2025

Closes #2136

PR to merge these changes with current major.

Goals:

  1. Allow further refactoring of additional props - prevent props drilling, use funcs in place
  2. Single API for external options, function and configs

Usage when ui as a package:

const {store, history} = configureStore();

configureUIFactory({
    onCreateDB: getCreateDBDialog,
    onDeleteDB: getDeleteDBDialog,

    getLogsLink: getLogsLink,
    getMonitoringLink: getMonitoringLinkExtended,
    getMonitoringClusterLink: getMonitoringClusterLinkExtended,
});

componentsRegistry
    .set('StaffCard', StaffCard)
    .set('AsideNavigation', AsideNavigationInternal)
    .set('ShardsTable', ShardsTable);

function render() {
    const container = document.getElementById('root');
    if (!container) {
        throw new Error("Can't find root element");
    }

    const root = ReactDOM.createRoot(container);

    root.render(
        <ErrorBoundary>
            <App store={store} history={history} userSettings={internalSettings} />
        </ErrorBoundary>,
    );
}

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
318 317 0 1 0

😟 No changes in tests. 😕

Bundle Size: ✅

Current: 83.47 MB | Main: 83.47 MB
Diff: +0.33 KB (0.00%)

✅ Bundle size unchanged.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

@artemmufazalov artemmufazalov force-pushed the 2136-ui-factory-for-external-props branch from 80272f9 to f00e5d0 Compare May 13, 2025 09:28
getLogsLink={getLogsLink}
getMonitoringLink={getMonitoringLink}
getMonitoringClusterLink={getMonitoringClusterLink}
getLogsLink={uiFactory.getLogsLink}
Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't refactored additional props themselves, it's could be done further, these changes are to merge with current major and to not do another

@artemmufazalov artemmufazalov added this pull request to the merge queue May 13, 2025
Merged via the queue into main with commit 974775f May 13, 2025
7 checks passed
@artemmufazalov artemmufazalov deleted the 2136-ui-factory-for-external-props branch May 13, 2025 11:02
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.

Use uiFactory for external props

3 participants