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

fix(prerender): call prerender:route before freeing up memory #1537

Merged
merged 3 commits into from
Aug 4, 2023

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Aug 4, 2023

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

With #1536, we are freeing up route contents from memory but this was causing prender:route to lose access to the route contents.

This PR fixes this by fixing the ordering and calling the hook directly inside generateRoute before freeing up memory and also simplifying the code. (previously we were wrongly catching unhandled internal errors as route errors now it uses simple console log to only avoid hiding edge cases with internal nitro bugs)

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codecov
Copy link

codecov bot commented Aug 4, 2023

Codecov Report

Merging #1537 (4c0fed3) into main (2adeebb) will decrease coverage by 0.05%.
The diff coverage is 93.33%.

❗ Current head 4c0fed3 differs from pull request most recent head ec0631a. Consider uploading reports for the commit ec0631a to get more accurate results

@@            Coverage Diff             @@
##             main    #1537      +/-   ##
==========================================
- Coverage   76.15%   76.10%   -0.05%     
==========================================
  Files          73       73              
  Lines        7494     7491       -3     
  Branches      733      730       -3     
==========================================
- Hits         5707     5701       -6     
- Misses       1786     1788       +2     
- Partials        1        2       +1     
Files Changed Coverage Ξ”
src/prerender.ts 84.94% <93.33%> (+0.13%) ⬆️

... and 1 file with indirect coverage changes

@pi0 pi0 merged commit f8d176b into main Aug 4, 2023
4 checks passed
@pi0 pi0 deleted the fix/generate-route branch August 4, 2023 19:48
@pi0 pi0 mentioned this pull request Aug 21, 2023
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.

1 participant