reanahub / reana-ui

REANA UI frontend
http://reana-ui.rtfd.io
MIT License
4 stars 33 forks source link

wf-details: add preview of ROOT files #326

Closed mdonadoni closed 1 year ago

mdonadoni commented 1 year ago

Closes #322

How to test:

mdonadoni commented 1 year ago

Currently there is some padding around the preview of ROOT files and of PDF files. Should I remove it?

Also, what do you think about moving all the logic regarding the preview of files (e.g. checking constraints, fetching the file, how to display each type of file, etc.) to a new React component, so that it is not mixed with the logic of the "Workspace" tab (e.g. files sorting, etc.)?

tiborsimko commented 1 year ago

Works nicely :+1: In view of longer term, it'll be really good to separate the previewer logic into a new component.

giuseppe-steduto commented 1 year ago

I very slightly prefer the version without padding, both for the ROOT file preview and for the PDF preview. I also agree on extracting the logic of previewing the files to a new React component.

mdonadoni commented 1 year ago

I have just found out that the final js bundle is much bigger than before (sizes reported by yarn build after gzip): Before

225.62 kB  build/static/js/main.bebbe785.js
101.64 kB  build/static/css/main.730fe37a.css

After

735.92 kB (+510.31 kB)  build/static/js/main.1debd93c.js
101.71 kB (+68 B)       build/static/css/main.0c6eca96.css
[many other smaller files...]

The build time has also increased:

I will investigate how to improve bundle size and/or build time

mdonadoni commented 1 year ago

After lazy loading:

508.7 kB   build/static/js/200.d642ac61.chunk.js
231.06 kB  build/static/js/main.fee16449.js
101.76 kB  build/static/css/main.440a8806.css
[many other smaller files...]

Main application bundle is back to less than 250kB