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

[Data Explorer] Add lazy loading to enable all the services for canvas #4432

Conversation

ananzh
Copy link
Member

@ananzh ananzh commented Jun 28, 2023

Description

Currently the createCanvas function is indeed being called only once when the Discover plugin is being set up. The return value of this function (a React Element) is then saved in the ui object of the registered view and this same React Element is used every time the DataExplorerApp is rendered. Because React Elements are plain objects and not functions, they don't get re-evaluated or re-rendered. This PR is just a minor adds-up to unblock implementation table vis by adding lazy load. This will render the actual component in place of the fallback when the component becomes available.

Issues Resolved

#4419

Screenshot

Screenshot 2023-06-28 at 16 15 56

@ashwin-pc ashwin-pc self-assigned this Jun 28, 2023
@ananzh ananzh force-pushed the feature/data-explorer-lazy branch 2 times, most recently from 9867fca to 62b06bb Compare June 28, 2023 23:52
@ananzh ananzh changed the title Feature/data explorer lazy [Data Explorer] Add lazy loading to enable all the services for canvas Jun 28, 2023
@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Merging #4432 (49d1c51) into feature/data-explorer (d4acb33) will decrease coverage by 0.01%.
The diff coverage is 14.28%.

@@                    Coverage Diff                    @@
##           feature/data-explorer    #4432      +/-   ##
=========================================================
- Coverage                  66.56%   66.55%   -0.01%     
=========================================================
  Files                       3278     3279       +1     
  Lines                      62654    62660       +6     
  Branches                    9760     9761       +1     
=========================================================
- Hits                       41703    41702       -1     
- Misses                     18585    18592       +7     
  Partials                    2366     2366              
Flag Coverage Δ
Linux 66.49% <14.28%> (-0.01%) ⬇️
Windows 66.49% <14.28%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...plication/view_components/canvas/create_canvas.tsx 33.33% <0.00%> (-16.67%) ⬇️
...ication/view_components/canvas/discover_canvas.tsx 20.00% <20.00%> (ø)

... and 1 file with indirect coverage changes

@ananzh
Copy link
Member Author

ananzh commented Jul 13, 2023

We have implemented a dynamic approach. Close this tmp solution.

@ananzh ananzh closed this Jul 13, 2023
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