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): flatten ui/src/app dir #13815

Merged
merged 4 commits into from
Oct 28, 2024

Conversation

agilgur5
Copy link

@agilgur5 agilgur5 commented Oct 25, 2024

Fixes #12539 "Future Work" part 2

Motivation

Remove unnecessary nesting, same as #12539

Modifications

  • move ui/src/models to ui/src/shared/models

    • fix-up various imports to account for this
  • then flatten ui/src/app to just ui/src/

  • also fix name of workflow-operation-map.tsx to .ts as it doesn't have JSX/TSX (fixes feat: Unified workflows list UI and API #11121 (comment))

  • also move webpack.config.js out of ui/src/app and to ui/

    • same with tsconfig.json
    • slightly modify directories in the config files to account for this
    • remove symlinks and config that was previously necessary due to having config in the subdirectory

Verification

  1. make start UI=true loads the UI fine and dandy and it works as before
  2. yarn lint and yarn build etc all pass
  3. make server/static/files.go STATIC_FILES=true works/passes
  4. ls dist/app looks about the same before/after:

before:

❯ ls dist/app      
775.43e8c969ca85676f528d.js                             argo-ui-logs-viewer.ae9615e8f7f5b591df8e.js.map         monaco-editor.fa9e75b9e342fbb964bb.js.LICENSE.txt
775.43e8c969ca85676f528d.js.LICENSE.txt                 assets                                                  monaco-editor.fa9e75b9e342fbb964bb.js.map
775.43e8c969ca85676f528d.js.map                         codicon.ttf                                             react-markdown-plus-gfm.3a77fefac0c77fa0b385.js
839.58e22fba88631d094daf.js                             editor.worker.js                                        react-markdown-plus-gfm.3a77fefac0c77fa0b385.js.map
839.58e22fba88631d094daf.js.LICENSE.txt                 editor.worker.js.map                                    react-monaco-editor.9c2ee7a658ee5378c65b.js
839.58e22fba88631d094daf.js.map                         index.html                                              react-monaco-editor.9c2ee7a658ee5378c65b.js.map
990.e6d98ce60f5195aec70a.js                             json.worker.js                                          reports.17861f7c283f72c6ea9b.js
990.e6d98ce60f5195aec70a.js.LICENSE.txt                 json.worker.js.LICENSE.txt                              reports.17861f7c283f72c6ea9b.js.map
990.e6d98ce60f5195aec70a.js.map                         json.worker.js.map                                      swagger-ui-react-css.dfee358b653e751976b0.js
994.eae31bc7956069a7bb1d.js                             main.e0032a966b1e70172630.js                            swagger-ui-react-css.dfee358b653e751976b0.js.map
994.eae31bc7956069a7bb1d.js.LICENSE.txt                 main.e0032a966b1e70172630.js.LICENSE.txt                swagger-ui-react.e89a642a6a2e1d7b1970.js
994.eae31bc7956069a7bb1d.js.map                         main.e0032a966b1e70172630.js.map                        swagger-ui-react.e89a642a6a2e1d7b1970.js.LICENSE.txt
argo-ui-logs-viewer.ae9615e8f7f5b591df8e.js             monaco-editor.fa9e75b9e342fbb964bb.js                   swagger-ui-react.e89a642a6a2e1d7b1970.js.map

after:

❯ ls dist/app/
775.43e8c969ca85676f528d.js                           argo-ui-logs-viewer.ae9615e8f7f5b591df8e.js.map       monaco-editor.92ae73621991273cd7fa.js.LICENSE.txt
775.43e8c969ca85676f528d.js.LICENSE.txt               assets/                                               monaco-editor.92ae73621991273cd7fa.js.map
775.43e8c969ca85676f528d.js.map                       codicon.ttf                                           react-markdown-plus-gfm.d507f040b86c97f5d729.js
839.58e22fba88631d094daf.js                           editor.worker.js                                      react-markdown-plus-gfm.d507f040b86c97f5d729.js.map
839.58e22fba88631d094daf.js.LICENSE.txt               editor.worker.js.map                                  react-monaco-editor.9c2ee7a658ee5378c65b.js
839.58e22fba88631d094daf.js.map                       index.html                                            react-monaco-editor.9c2ee7a658ee5378c65b.js.map
990.e6d98ce60f5195aec70a.js                           json.worker.js                                        reports.aeeaa52ae94633cc90fc.js
990.e6d98ce60f5195aec70a.js.LICENSE.txt               json.worker.js.LICENSE.txt                            reports.aeeaa52ae94633cc90fc.js.map
990.e6d98ce60f5195aec70a.js.map                       json.worker.js.map                                    swagger-ui-react-css.dfee358b653e751976b0.js
994.eae31bc7956069a7bb1d.js                           main.4c6024a7ded227c8d4f0.js                          swagger-ui-react-css.dfee358b653e751976b0.js.map
994.eae31bc7956069a7bb1d.js.LICENSE.txt               main.4c6024a7ded227c8d4f0.js.LICENSE.txt              swagger-ui-react.e89a642a6a2e1d7b1970.js
994.eae31bc7956069a7bb1d.js.map                       main.4c6024a7ded227c8d4f0.js.map                      swagger-ui-react.e89a642a6a2e1d7b1970.js.LICENSE.txt
argo-ui-logs-viewer.ae9615e8f7f5b591df8e.js           monaco-editor.92ae73621991273cd7fa.js                 swagger-ui-react.e89a642a6a2e1d7b1970.js.map

Notes to Reviewers

  • Use the sidebar in GH to see the files that weren't just renamed, which is only a small handful and mostly the last few config files

  • This will merge conflict with some of my other open PRs that delete or change imports; can update depending on what is merged first

Copy link
Author

Choose a reason for hiding this comment

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

the {} -> any change made this a full delete/add instead of a rename

Copy link
Author

@agilgur5 agilgur5 Oct 25, 2024

Choose a reason for hiding this comment

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

not sure why git didn't detect this as a rename 🤔 possibly because of the existing symlink in ui/tsconfig.json? it's not letting me comment on specific lines in that file either

EDIT: yea it seems to be because of the prior symlink

Copy link
Author

@agilgur5 agilgur5 Oct 25, 2024

Choose a reason for hiding this comment

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

outDir here and output.path in webpack.config.js need a bit of carefulness since they're used in the Dockerfile and Makefile

@agilgur5 agilgur5 marked this pull request as ready for review October 25, 2024 03:06
Anton Gilgur added 3 commits October 25, 2024 13:28
- move `ui/src/models` to `ui/src/shared/models`
- and flatten the rest

- also fix name of `workflow-operation-map.tsx` to `.ts` as it doesn't have JSX/TSX

- also move `webpack.config.js` out of `ui/src/app` and to `ui/`
  - same with `tsconfig.json`
  - remove symlinks and config that was previously necessary due to having config in the subdirectory

Signed-off-by: Anton Gilgur <[email protected]>
- these all failed to typecheck due to using `{}` as a type -- use `any` instead

Signed-off-by: Anton Gilgur <[email protected]>
Signed-off-by: Anton Gilgur <[email protected]>
@agilgur5 agilgur5 force-pushed the refactor-ui-flatten-app-dir branch from 7cc27cc to b4735a6 Compare October 25, 2024 17:28
Copy link
Member

@tczhao tczhao left a comment

Choose a reason for hiding this comment

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

Note: tsconfig.json and webpack.config.js are moved to their default path so that we don't need to specify the location

@agilgur5
Copy link
Author

Yes I mentioned that under "Modifications"

@agilgur5 agilgur5 merged commit 9f158ae into argoproj:main Oct 28, 2024
16 checks passed
@agilgur5 agilgur5 deleted the refactor-ui-flatten-app-dir branch October 28, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants