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

refactor(ui): code-split out large xterm dep #12158

Merged
merged 7 commits into from
May 24, 2024

Commits on May 14, 2024

  1. refactor(ui): code-split out large xterm dep

    - after the past few code-splits, `xterm` was left as one of the largest deps in the main bundle
      - `xterm` is only used by `argo-ui` in its `LogsViewer` component, which is only used by Workflows' `FullHeightLogsViewer` component
        - so lazy load `LogsViewer` within `FullHeightLogsViewer` in order to code-split it
          - add a [`webpackPrefetch`](https://webpack.js.org/guides/code-splitting/#prefetchingpreloading-modules) magic comment as logs are _very_ commonly used, at least in my experience
    
    - **NOTE**: this is currently **not working** as a code-split as `argo-ui` does not seem to be tree-shakeable
      - so even with this code-split, the component is still being imported from other imports
      - from a quick glance, the lack of tree-shaking may be due to [this SCSS import](https://github.com/argoproj/argo-ui/blob/5ff344ac9692c14dd108468bd3c020c3c75181cb/src/components/index.ts#L1) in `argo-ui`, which is a side-effect
        - a potential workaround may be to import all the components individually and then import the styles individually in our own code
          - started on this, did not finish, still draft
    
    Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
    agilgur5 committed May 14, 2024
    Configuration menu
    Copy the full SHA
    3a0d878 View commit details
    Browse the repository at this point in the history
  2. refactor more components to use individual imports

    - this should be pretty much all components except for the few context references
    
    Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
    agilgur5 committed May 14, 2024
    Configuration menu
    Copy the full SHA
    33ca6b0 View commit details
    Browse the repository at this point in the history
  3. last general 'argo-ui' import

    Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
    agilgur5 committed May 14, 2024
    Configuration menu
    Copy the full SHA
    0d5e7b7 View commit details
    Browse the repository at this point in the history
  4. ok a few more places, but code split is working now

    Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
    agilgur5 committed May 14, 2024
    Configuration menu
    Copy the full SHA
    64e0584 View commit details
    Browse the repository at this point in the history
  5. and make sure to import the CSS ofc

    Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
    agilgur5 committed May 14, 2024
    Configuration menu
    Copy the full SHA
    0477372 View commit details
    Browse the repository at this point in the history
  6. fix lint -- NotificationType is an enum used as a value

    Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
    agilgur5 committed May 14, 2024
    Configuration menu
    Copy the full SHA
    9cb1645 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2024

  1. Configuration menu
    Copy the full SHA
    db0ce23 View commit details
    Browse the repository at this point in the history