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

Remove unnecessary re-renders / page refresh #330

Closed
Falsal opened this issue May 10, 2024 · 6 comments
Closed

Remove unnecessary re-renders / page refresh #330

Falsal opened this issue May 10, 2024 · 6 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Falsal
Copy link
Collaborator

Falsal commented May 10, 2024

In certain cases like when using the search bar/button the page re-renders a few times, making unnecessary calls to the backend.
Normally, in development there are 2 re-renders (React 18) but this case goes beyond that and actually making an additional call.

If you slow the speed of Network , you can better follow the unwanted re-renders.

The goal of this issue is, to remove all unnecessary re-renders and reloads.

Installation:

  1. nvm install 20.5.0
  2. nvm use 20.5.0
  3. npm install

Running the application:

  1. npm run start-remote-api
  2. http://localhost:3000/suche?city=wien

GitHub Branch:

@Falsal Falsal added the bug Something isn't working label May 10, 2024
@Falsal Falsal assigned Falsal and unassigned Falsal May 10, 2024
@martinheppner martinheppner added the help wanted Extra attention is needed label May 10, 2024
@martinheppner
Copy link
Contributor

The video shows the unnecessary reloads:

Unnecessary-Reloading.mp4

@Falsal
Copy link
Collaborator Author

Falsal commented May 18, 2024

we seem to have different behavior in the search functionality depending on the network speed.
So on slow 3G speed, upon clicking search and after a few renders the final-render is giving the correct cards on top of the list shown but below them other cards which should not be there. On fast networks we get the correct result list of cards after a few renders.

@Falsal
Copy link
Collaborator Author

Falsal commented May 21, 2024

@martinheppner :
Situation on Tuesday 21st May:
checked the updated version of branch "unnecessary-reloads", but the behaviour of the search functionality on results page (Main.js) remains the same as before. A video link is pasted here:
https://www.loom.com/share/9af0e0b96f3d43c694dc7d19ba20ba6f?sid=1bfb7ba3-fd37-43bd-8837-df29474460a0

@Falsal Falsal self-assigned this May 27, 2024
@Falsal
Copy link
Collaborator Author

Falsal commented May 28, 2024

The job is completed except for one item that was a result of this work, FAL will do the fix and will close this issue as soon as it is done.

@Falsal
Copy link
Collaborator Author

Falsal commented May 31, 2024

issue is setting filter to localStorage value when re-opening filter form.

@Falsal
Copy link
Collaborator Author

Falsal commented Jun 3, 2024

done

@Falsal Falsal closed this as completed Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
Status: Done
Development

No branches or pull requests

2 participants