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

Make loader context nullable and cleanup loader cleanup #5552

Merged
merged 1 commit into from
Jun 16, 2023

Conversation

robwalch
Copy link
Collaborator

@robwalch robwalch commented Jun 7, 2023

This PR will...

Make loader context nullable and cleanup loader cleanup

Why is this Pull Request needed?

context is undefined before load() is called. Making it nullable and clearing it on destroy makes it easier to deal with loader usage after the end of its lifecycle.

Are there any points in the code the reviewer needs to double check?

Do apps currently use these loader properties after loaders are destroyed (context or stats)? At the very least we should clear (xhr|fetch)Setup callbacks on destroy to remove any references hoisted into the scope of these functions.

Resolves issues:

Followup to #5494

@robwalch
Copy link
Collaborator Author

robwalch commented Jun 7, 2023

Hi @lvnam96,

Here are some followup changes to #5494. Your feedback is appreciated.

Copy link
Contributor

@lvnam96 lvnam96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about logic in fetch loader & xhr loader, but typing is correct.
The rest looks good.

@robwalch robwalch added this to the 1.5.0 milestone Jun 16, 2023
@robwalch robwalch merged commit 3f89a39 into master Jun 16, 2023
@robwalch robwalch deleted the task/loader-cleanup branch June 16, 2023 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants