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

Replace usage of resize-observer-polyfill dependency #3824

Open
abbyhu2000 opened this issue Apr 11, 2023 · 3 comments · May be fixed by #7007
Open

Replace usage of resize-observer-polyfill dependency #3824

abbyhu2000 opened this issue Apr 11, 2023 · 3 comments · May be fixed by #7007
Labels
good first issue Good for newcomers help wanted Community development is encouraged OSCI Open Source Contributor Initiative

Comments

@abbyhu2000
Copy link
Member

resize-observer-polyfill is a JavaScript library that provides a way to observe changes to the size of elements in the browser's viewport. It works by adding a ResizeObserver API to browsers that do not natively support it, allowing developers to use this functionality in their projects.

Task: Drop the usage of libraries resize-observer-polyfill in favor of more performant native implementations.

Usage:

  1. Usage of ResizeObserver in src/plugins/data/public/ui/search_bar/search_bar.tsx
public ro = new ResizeObserver(this.setFilterBarHeight);
  1. Usage of ResizeObserver in class ResizeChecker in src/plugins/opensearch_dashboards_utils/public/resize_checker/resize_checker.ts and resize_checker.test.ts
observer = new ResizeObserver(() => {
      if (this.expectedSize) {
        const sameSize = isEqual(getSize(el), this.expectedSize);
        this.expectedSize = null;

        if (sameSize) {
          // don't trigger resize notification if the size is what we expect
          return;
        }
      }

      this.emit('resize');
    });
@abbyhu2000 abbyhu2000 added good first issue Good for newcomers help wanted Community development is encouraged OSCI Open Source Contributor Initiative labels Apr 11, 2023
@sayuree
Copy link
Contributor

sayuree commented Apr 11, 2023

Hi, I want to work on this issue

@abbyhu2000
Copy link
Member Author

@sayuree I assigned #3822 (removing deep-freeze-strict dependency) to you. Do you want to work on that first? Once that is finished, can assign this next.

@sayuree
Copy link
Contributor

sayuree commented Apr 12, 2023

@abbyhu2000 I have finished #3822 and submitted a PR on that issue. Until the changes are being reviewed, I want to work on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Community development is encouraged OSCI Open Source Contributor Initiative
Projects
None yet
3 participants