frittatelle / oxycloud-frontend

MIT License
0 stars 2 forks source link

Sidebar #9

Open frittatelle opened 3 years ago

frittatelle commented 3 years ago

File explorer and sidebar share the same kind of data (s3 data). Try different approaches to see which is the simplest and effective one.

frittatelle commented 3 years ago

I just pushed the first try with react-query + aws-sdk and it is working fine! #10
Take a look at a58007a0dc2d8be192d03559102c4488fc3fc6cf to see how react-query is retrieving data and managing it (cache, status, errors etc.)

frittatelle commented 3 years ago

Folder explorer in sidebar

Problem: data retrieved by react-query needs a dfifferent type of processing based on the component is requesting it. File explorer needs files and folders (request can be made by using delimiter="/" so that everything can be organized easily) while Sidebar needs the whole file tree so delimiter should be removed.

Two different solutions:

  1. Different components make different queries →
    • we lose react-query capability of dealing with same data across multiple components (-)
    • fast for mvp (+)
  2. Process data after query
    • single query (+)
    • extra oxycloud api component to deal with processing s3 api responses (-)
    • partial refactor of fileExplorer
    • less requests (+)
frittatelle commented 3 years ago

Problem part 2: Solution 2 isn't a solution 👎 The problem persist because it's at the storage.ls level.