From dd2c4e7124b0295be81abaf67e966c8c3d0277e4 Mon Sep 17 00:00:00 2001 From: Isaac Hellendag <2823852+hellendag@users.noreply.github.com> Date: Wed, 26 Jun 2024 19:26:45 -0500 Subject: [PATCH] [ui] Fix Storybook memory bug (#22742) ## Summary & Motivation Disable react-docgen in Storybook build, because pulling in massive generated GraphQL types is causing memory failures in CI/Vercel. ## How I Tested These Changes Add a memory-limited build command to package.json: ``` "build-storybook-limited": "NODE_OPTIONS=--max_old_space_size=2048 storybook build" ``` Run this to repro the memory failure. Kill docgen (as in the PR), rerun. Verify that the build completes correctly. --- .../dagster-ui/packages/ui-components/.storybook/main.js | 3 +-- js_modules/dagster-ui/packages/ui-core/.storybook/main.js | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/js_modules/dagster-ui/packages/ui-components/.storybook/main.js b/js_modules/dagster-ui/packages/ui-components/.storybook/main.js index 1363a2d1bcaa2..fbe62b14b90de 100644 --- a/js_modules/dagster-ui/packages/ui-components/.storybook/main.js +++ b/js_modules/dagster-ui/packages/ui-components/.storybook/main.js @@ -21,9 +21,8 @@ const config = { name: getAbsolutePath('@storybook/nextjs'), options: {}, }, - // https://github.com/hipstersmoothie/react-docgen-typescript-plugin/issues/78#issuecomment-1409224863 typescript: { - reactDocgen: 'react-docgen-typescript-plugin', + reactDocgen: false, }, docs: {}, env: (config) => ({ diff --git a/js_modules/dagster-ui/packages/ui-core/.storybook/main.js b/js_modules/dagster-ui/packages/ui-core/.storybook/main.js index c94b43331d4b1..a7b469bf76ad9 100644 --- a/js_modules/dagster-ui/packages/ui-core/.storybook/main.js +++ b/js_modules/dagster-ui/packages/ui-core/.storybook/main.js @@ -17,9 +17,11 @@ const config = { getAbsolutePath('@storybook/addon-mdx-gfm'), '@chromatic-com/storybook', ], + typescript: { + reactDocgen: false, + }, framework: { name: getAbsolutePath('@storybook/nextjs'), - options: {}, }, // https://github.com/storybookjs/storybook/issues/16690#issuecomment-971579785 webpackFinal: async (config) => {