Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Zoramite
Copy link
Member

@Zoramite Zoramite commented Mar 22, 2023

Updates the afterRender hook to not be async since it needs to use the results of the previous plugin to make the next set of changes.

@Zoramite Zoramite added the bug Something isn't working label Mar 22, 2023
@Zoramite Zoramite requested a review from jeremydw March 22, 2023 06:29
@Zoramite Zoramite self-assigned this Mar 22, 2023
@jeremydw
Copy link
Member

Think it's safe to make this change? Is it needed with the submission of 85db1a5

@Zoramite
Copy link
Member Author

It is needed because the logic for the afterRender hook is that you can change the contents after the render, this should have been sync because you want to be able to chain plugins together to have them modify things after the previous plugin is done changing it.

For example, if you have one plugin that prettifies the html and another that replaces all occurances of foo with bar, if they are done async you technically might run one before the other in an inconsistent manner or overwrite the changes that the other plugin performed.

@Zoramite Zoramite force-pushed the fix/sync-afterRender branch from 0cf6d52 to c24f3f9 Compare March 22, 2023 16:17
@Zoramite Zoramite merged commit 99ce31a into main Mar 22, 2023
@Zoramite Zoramite deleted the fix/sync-afterRender branch March 22, 2023 16:21
@github-actions github-actions bot mentioned this pull request Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants