grandma-collaboration / skyportal_grandma_dev

Little Git Repo to keep track of the work done by the A4 ESILV TEAM
2 stars 0 forks source link

Document the JS component tree #3846 #45

Open Adiman007 opened 1 year ago

Adiman007 commented 1 year ago

Ok, I open an issue here regarding this issue ( https://github.com/skyportal/skyportal/issues/3846 ) @KodeurFou and I will have a look on if something already exist to make an automated JSX component tree and if not we will try to make a script that check all the files in the component directory and then check the dependencies. We will go back to you when we have something that might be useful :+1: @mcoughlin @Theodlz

Adiman007 commented 1 year ago

hi @Theodlz, quick question, Guy said "Add a short code comment at the beginning of each file, saying e.g., "this is in the Source page, under the annotations table, etc."." So are we supposed to add a comment on the 250 components of the app ?

mcoughlin commented 1 year ago

@Adiman007 No. I foresee this as part of the docs, i.e. some kind of figure and how to understand it.

Theodlz commented 1 year ago

Personally what I got from Guy's comment is to add a short comment (few lines) at the top of each file to describe/explain what it contains, and NOT add comments for every methods.

Theodlz commented 1 year ago

You just need to read each file quickly, understand what each component does and then add a short summary of what you understood at the top of the file.

That should also help you guys a lot to understand the entire frontend architecture of SP.

KodeurFou commented 1 year ago

dependency-graph

We used dependency-cruiser to model the architecture of SP, we can see the react components and their relations

The graph is a little messy we tried having it displayed in a reactive way in an html format but so far no success

The problem we've had is it doesn't seem to be fitted to run on the same version of react that SP does image

but the output we still get seems to be correct

KodeurFou commented 1 year ago

should we try another way to try and automate the process or should we document the way we got it working so it can be rerendered when some new components are added?

mcoughlin commented 1 year ago

@KodeurFou @Adiman007 Could you open this as a PR or issue on skyportal to discuss?

KodeurFou commented 1 year ago

I've copied it to the original issue on skyportal !