-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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 js file structure #25003
Refactor js file structure #25003
Conversation
Update jest, webpack and ts config files to allow for two aliased paths: `app` = `static/js` `grid` = `static/js/grid`
get ready for graph view in grid and other react pages like datasets and dag dependencies
@@ -26,8 +26,7 @@ const config = { | |||
setupFilesAfterEnv: ['./jest-setup.js'], | |||
moduleDirectories: ['node_modules'], | |||
moduleNameMapper: { // Listing all aliases | |||
'^app/(.*)$': '<rootDir>/static/js/$1', | |||
'^grid/(.*)$': '<rootDir>/static/js/grid/$1', | |||
'^src/(.*)$': '<rootDir>/static/js/$1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src
made more sense than app
@@ -17,32 +17,22 @@ | |||
* under the License. | |||
*/ | |||
|
|||
/* global document */ | |||
/* | |||
Base setup for anywhere we add react to the UI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will reuse App
for datasets and other reactified pages
@@ -22,7 +22,7 @@ import { Button, useDisclosure } from '@chakra-ui/react'; | |||
|
|||
import { useMarkFailedRun } from '../../../api'; | |||
import ConfirmDialog from '../ConfirmDialog'; | |||
import { getMetaValue } from '../../../../utils'; | |||
import { getMetaValue } from '../../../utils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a later PR I will update more js/jsx files to typescript so we can remove more relative paths. I was having issues getting relative paths for js and ts to play nicely in our existing webpack configuration.
@@ -73,7 +73,7 @@ const config = { | |||
task: `${JS_DIR}/task.js`, | |||
taskInstances: `${JS_DIR}/task_instances.js`, | |||
tiLog: `${JS_DIR}/ti_log.js`, | |||
grid: [`${JS_DIR}/grid/index.jsx`], | |||
grid: `${JS_DIR}/dag/index.tsx`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This key should stay as grid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we still have dag.js
, I figured yes.
We are going to reactify more of the UI.
inside of
js/dag
is code relevant to just the grid view split between the grid itself and the details panelcontext
,components
,theme
,api
will all be shared between however many react pages we create.^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.